Monday, August 15, 2011

Getting rid of the ads and other fine points

So, we're at the point now where all the ad networks are set up and we're waiting for the go-ahead from them. However, there are a couple of not-so-minor details to attend to. The first is that, we want to exclude the ads from the paid version. The second is that we want to vary the publisher / app id in the MobFox component in the layout between the free apps, since they each have their own app id.

In terms of code, the first requirement is pretty simple - just check if it's the paid version, and if so set the component to invisible. The problem is it may look a bit top-heavy in the full version, with no app element. So, let's modify the StartActivity:

if (Utils.isFree(this)) {

handlePayButton(payButton);

}

else {

// Don't show ads in pay version

View mobFoxView = (View) findViewById(R.id.mobFoxView);

mobFoxView.setVisibility(View.INVISIBLE);

}

So, if it's not free, don't display it. Btw, does anyone else think it's pretty odd to have setVisibility's parameter as an integer instead of a boolean?

Anyway - let's see how this looks.

Hmm. There's a minor problem. The bootstrap activity flashes the start screen with the ads displayed. That's unfortunate; probably not enough to worry about. It will remind the customer of what they don't have to put up with now that they've paid. It looks good enough. So does the free version.

My next question is, I wonder if it makes more sense to just leave everything under one appId?The big reason is I would likely hit my payment minimums much quicker. And it would simplify the code, as i wouldn't have to create an extra string in each shell folder to hold the product id. I think the quickstart guide (http://www.projectjourneyman.com/free-android-income-quickstart-guide) maybe said something about that.

Here it is:

Quick Tip: You will create one (or more) publisher codes for each app

you create, as they help you track how each app is performing.

I dunno. My apps are identical, except for the Jlpt level. I like the idea of the cash flow. For stats I can always use flurry, etc. Well, maybe they pay on the total owed. Let's be optimistic and assume they do that.

In which case, I'll need to pull the publisher id from the xml string resource in the shell project. So, for that, let's change the MobFoxView in the layout:

publisherId=?@string/mobfox_id"

We'll add a dummy string so the core project compiles;

<string name="mobfox_id">111111111string>


And then just copy it to each string.xml in the shell project. There should be a way to test that it's correct, but to play it safe, i'll just put the level 1 string in the dummy string.

Ok, that's a wrap for now. The last step will be getting the go-ahead and uploading. Oh, and changing the "test" to "live" on the MobFoxView.



No comments:

Post a Comment