Skip to content
Jan 8 11

Google fixes a bug

by admin

As I reported, Google Analytics for Android would sometimes throw an SQLiteException.  Of course the big G was getting on-line flack over that and has now put out a new version of their JAR file.  Version 1.1 claims to fix this problem.  You can check it out at at the bottom of the page.

Jan 1 11

Can Google programmers code Android?

by admin

You would think if anyone would know how to write Android code it would be coders at Google.  Yet if you use the Google Analytics library available for Android, you might run into trouble.  Google Analytics is great to track usage of your Android application, but should Google Analytics ever cause your app to crash?

Google Analytics did cause one of my apps to crash and the stack trace looked like:

android.database.sqlite.SQLiteException: unable to open database file
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unable to open database file
at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
at android.database.sqlite.SQLiteDatabase.<init>(
at android.database.sqlite.SQLiteDatabase.openDatabase(
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(
at Source)
at Source)
at Source)
at Source)

So Google Analytics tried to use SQLite to open the database, but FAILED to catch an SQLiteException.  The fix was to wrap opening up Google Analytics into a try-catch block and catch that exception.  Here are the relevant code fragments to fix the crash by catching the exception Google Analytics failed to:

GoogleAnalyticsTracker tracker = null;
try {
tracker = GoogleAnalyticsTracker.getInstance();
tracker.start("UA-123456-78", 20, this);
catch (android.database.sqlite.SQLiteException sqle)
Log.d(SUBSYSTEM_TAG, "Google Analytics SQLite exception: "+sqle);
tracker = null;
catch (Exception e)
Log.d(SUBSYSTEM_TAG, "Google Analytics exception: "+e);
tracker = null;
if (tracker != null)
tracker.trackEvent("Android", action, label, val);

The OnDestroy() method code looks like:

if (tracker != null) {
tracker = null;

Remember you have to catch these exceptions if you use Google Analytics in your Android app, otherwise one of your users may watch your app crash.  How do you think they’ll rate your app then?

Jun 8 10

Android App Store shortcomings

by admin

The Google Market has been the only game around for Android Apps, although that may be changing. Some of the Market’s shortcomings include:

  • No screenshots of your application.
  • 325 character limit on descriptions.
  • Google Checkout is the only payment option.
  • Apps are hard for users to find.
  • No way to download an application through the web via a web link.

Some improvements may be on the way, but these are gotchas for developers today.