Tuesday, September 25, 2012

When my little boy grows up


In no particular order, when my little boy grows up:

I'll miss...
.. how he runs and hugs me when I come home
.. how he looks at me with big curious eyes when I explain something
.. how he assumes that his daddy can do anything and everything
.. how he loves it when I hold him close and read to him
.. how he endlessly plays silly little games
.. how he dances without getting self conscious
.. how he learns everything as quickly as he does
.. how much he loves his mother
.. how there's so much trepidation and excitement in his eyes about something new
.. how he runs around the house without a break
.. how he loves to hide behind things and play peek-a-boo
.. how the most silly thing makes him laugh out loud
.. holding him close to me when he's scared
.. how much he loves to ride on my back
.. how he takes the most incredible things at face value
.. how he never lies, even if that gets him into trouble
.. how he's the most maddening person ever by far
.. how he holds my finger when we go out for a walk
.. how he holds on to my finger from his crib when I lie down next to him on the floor
.. how his mother and I cannot stop talking about him
.. how he walks around the house with his stuffed dog in his arms
.. how much he depends upon me
.. how he makes me smile
.. his cute mispronunciations

I'll miss that little boy when he grows up.

Android In-app Billing notes

In the notes below, I have distilled the knowledge I gained implementing Android In-app billing. All of this is current and correct as of this writing (Sept 2012). However, given the pace at which the In-app billing framework seems to evolve, a lot of this might not be applicable by the time you read this. Take it for what it's worth.

Development

- Read this http://developer.android.com/guide/google/play/billing/index.html carefully. All of it. Multiple times.
- Don't start from scratch. Grab the in-app billing sample that ships with the SDK and re-purpose it. Create a library from the sample app after stripping out things you don't need. Include that in your main application.
- Changes made in the Play developer console don't take effect instantaneously. Sometimes for hours. Don't despair if you see unexpected responses from the Play service.
- If your app is about subscriptions rather than plain old one-time purchases, do yourself a favor and implement a service on your backend to keep track of subscriptions. This will eliminate a whole host of edge cases that arise if you don't have a backend to keep track of active subscriptions and cancellations.
- Make sure that the ITEM_TYPE property in the request bundle passed in sendBillingRequest is correct. If there's a mismatch between the product type configured in Play and your request you'll just get an ITEM_UNAVAILABLE response with no explanations.
- Stackoverflow is your friend. See the in-app-billing tag
- This is another great resource to save you some heartache.

Developer testing

Pay careful attention to the table in this section: http://developer.android.com/guide/google/play/billing/billing_testing.html#billing-testing-static.  The table is fairly confusing, but the bottom line is this: use a developer account for testing responses from Play.

Here's a good way to test your app during development:
1. Make sure you have the com.android.vending.BILLING permission in your Manifest.
2. Upload the app to the Play Console and leave it unpublished. Make sure the versionCode of the latest uploaded APK in Play is the same as in the app you test with. This is important. You won't get signed responses unless these match.
3. Make sure the primary account on the device that you plan to test with is configured as a developer in your Google Play account. This is especially important if your app has never been published before. You won't get a signed response otherwise.
4. Don't test till at least a few hours have elapsed from the time you uploaded your app. For best results test it the next day.
5. Test your app's flow using static test product IDs e.g. android.test.purchased.
6. If you wish to test it with a real product ID make sure you wait for some time after creating the product in Play before testing with that ID.

QA

Final testing just before launch
1. Bump up your app's versionCode and upload the APK again. Leave the app unpublished.
2. If this app has never been published before, test using a developer account. If your app has been published before you can use any account. 

Gotchas

- Can't stress on this enough. Changes made in the Play console don't necessarily take effect right away. If you don't see an updated response from the Play service, give it some time to catch up.
- If you upload an app and leave it unpublished, unless you are added as a devloper in the Play dev console, you'll always see an empty signature string. 
- Google Play doesn't let you query published products for pricing information. If you plan to display the price of a product in your app, make sure there's a way to keep the price published in Play in synch with what you display in the app. This should be via a CMS or something similar.
- Google Play will not let you edit products once they are created. Publish with care.

Sunday, September 16, 2012

Shaving the Yak

All I wanted, was to choose the right wordpress theme for some blog I was helping set up. To do this I had to install MySQL. To do that I ended up upgrading my Ubuntu install from 12.04 to 12.04.1. All of this to decide which wordpress theme to mooch off of. Talk about Yak Shaving.