Wednesday, June 27, 2012

Using the Android Monkey tool

Android comes with a command-line tool (Monkey) that allows you to stress-test your application.  Monkey generates some random user events and will stop and report any errors that it encounters. It is very useful in helping to flesh out some not so obvious bugs that could be lurking in your application.  Below is an example of how we used it to test one of our applications under development.


cmd> adb shell monkey -p com.sivart.buddingbaby -v 200


Results:
:Monkey: seed=0 count=200
:AllowPackage: com.sivart.buddingbaby
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Event percentages:
// 0: 15.0%
// 1: 10.0%
// 2: 15.0%
// 3: 25.0%
// 4: 15.0%
// 5: 2.0%
// 6: 2.0%
// 7: 1.0%
// 8: 15.0%
:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10000000;component=com.sivart.buddingbaby/.SplashScreenActivity;end
// Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sivart.buddingbaby/.SplashScreenActivity } in package com.sivart.buddingbaby
:Sending Pointer ACTION_MOVE x=-4.0 y=2.0
:Sending Pointer ACTION_UP x=0.0 y=0.0
// activityResuming(com.android.launcher)
// Rejecting resume of package com.android.launcher
:Sending Pointer ACTION_DOWN x=47.0 y=496.0
:Sending Pointer ACTION_UP x=29.0 y=503.0
:Sending Pointer ACTION_DOWN x=255.0 y=143.0
:Sending Pointer ACTION_UP x=255.0 y=143.0
:Sending Pointer ACTION_DOWN x=295.0 y=659.0
:Sending Pointer ACTION_UP x=290.0 y=649.0
:Sending Pointer ACTION_MOVE x=-5.0 y=3.0
:Sending Pointer ACTION_MOVE x=0.0 y=-5.0
// Rejecting start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] cmp=com.android.launcher/com.android.launcher2.Launcher } in package com.android.launcher
:Sending Pointer ACTION_DOWN x=74.0 y=803.0
:Sending Pointer ACTION_UP x=74.0 y=803.0
:Sending Pointer ACTION_MOVE x=3.0 y=-2.0
:Sending Pointer ACTION_UP x=0.0 y=0.0
:Sending Pointer ACTION_MOVE x=-4.0 y=2.0
//[calendar_time:2012-06-22 22:19:07.777 system_uptime:307227]
// Sending event #100
:Sending Pointer ACTION_MOVE x=4.0 y=2.0
:Sending Pointer ACTION_DOWN x=309.0 y=694.0
:Sending Pointer ACTION_UP x=322.0 y=694.0
:Sending Pointer ACTION_MOVE x=0.0 y=-1.0
:Sending Pointer ACTION_DOWN x=294.0 y=319.0
:Sending Pointer ACTION_UP x=294.0 y=319.0
:Sending Pointer ACTION_DOWN x=118.0 y=497.0
:Sending Pointer ACTION_UP x=119.0 y=493.0
:Sending Pointer ACTION_DOWN x=137.0 y=284.0
:Sending Pointer ACTION_UP x=124.0 y=295.0
:Sending Pointer ACTION_DOWN x=258.0 y=403.0
// Rejecting start of Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity } in package android
:Sending Pointer ACTION_UP x=273.0 y=403.0
:Sending Pointer ACTION_MOVE x=-5.0 y=-5.0
// Rejecting start of Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity } in package android
Events injected: 200
Dropped: keys=0 pointers=0 trackballs=0 flips=0
## Network stats: elapsed time=6268ms (6268ms mobile, 0ms wifi, 0ms not connected)
// Monkey finished


Have you used Monkey successfully?  Leave a comment below to share your results.

Sunday, April 22, 2012

Adding a Application Rating Dialog to your Android Game

UPDATE: Also get users to recommend your app via Google+

In order to increase the number of engaged users who were rating the Android version of Word Crank, we used a small piece of code from Android Snippets that shows a dialog to the user after a number of predefined uses to rate your Application. What were the results?

There were 0.2 App Ratings/day previous to adding the App Rater Dialog, after adding the App Rater dialog we went to 0.33 App Ratings/day.  That is equivalent to a 65% increase in user app ratings by making such a small change.  We felt that this was an important change as user ratings can help increase your placement in the Android Market.  Also, we were hoping to get more positive ratings as the dialog only appears after a user has played the game at least 3 times.

So why not give it a try in your game?  Let us know your results in the comments below.

Monday, March 5, 2012

Android Market Publisher Statistics Gets an Update

Last Thursday when logging into my Publisher account on the Android Market, I was pleasantly surprised to find out that Google had updated the available statistics.  Previously, the available data was very limited; focusing primarily on Active Device Installs.

The new statistics page now exposes the number of daily uninstalls, active installs, and user installs.  It also provides a comparison of your application's numbers versus other apps in your same category.  This additional information was very useful in seeing how Word Crank stacked up to other apps in the Brain and Puzzle category.



Word Crank Daily Installs



Word Crank Daily Installs by Version



Word Crank Installs Compared to Other Brain and Puzzle Apps

Have you found the new format useful?  Leave a comment below.