wesley tanaka


Setting a system property in Gradle


Java system properties can be specified in Gradle by creating a file in one of these locations:

  • $HOME/.gradle/gradle.properties
  • $MAIN_PROJECT_DIR/gradle.properties

And creating a property name that's prefixed with systemProp. For example, to set a system property called appengine.sdk.root, you'd create a gradle.properties file with this contents:


What is Groovy?


I started looking at Groovy the other day while trying to understand how Gradle works.  Here are some initial impressions:

What is Gradle? (comparison of gradle vs ant vs make)


Gradle is a build tool similar to make or ant which is being adopted by the Android project as a replacement for ant scripts and the automated "build" step in Eclipse.

There's a useful book about Gradle available online for free at http://www.gradleware.com/registered/books/building-and-testing/

Here is a comparison between gradle and two other commonly used build tools:

Android SQLiteOpenHelper onUpgrade()


It's not necessary to wrap your SQLiteOpenHelper.onUpgrade() code in beginTransaction() and endTransaction() pairs, because ever since the earliest version of SQLiteOpenHelper, the Android source code has done this for you:

Query the COUNT of rows in a SQLite table in Android


There's a function DatabaseUtils.queryNumEntries() which can be used to query SELECT COUNT(*) FROM table; in a SQLite database in Android.

java.lang.VerifyError: com.google.analytics.tracking.android.AppFieldsDefaultProvider


The Google Analytics SDK for Android v3 (Beta) does not support Android 1.5 (API version 3).  When you try to call EasyTracker.getInstance(this).activityStart(this); you will get this error:

java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable


"java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable" can occur in an Android program if you try to do an operation (like run a .query()) on a SQLiteDatabase object which has already been

Regression testing sqlite database migrations in Android


One strategy to test Android sqlite database upgrades is to make a copy of your SQLiteOpenHelper class each time you create a new database version. That way, you can use the older revisions of SQLiteOpenHelper to create legacy versions of your database schema and make sure that when you open the database with newer versions, the upgrade works properly.

3D models from a single photo


Drop, modify, change or rename a column from a SQLite table in Android


SQLite only supports a limited subset of ALTER TABLE, so to modify an existing column, it's necessary to create a separate table. The SQLite documentation recommends doing two separate INSERT/SELECT operations using a temporary table, instead of doing an INSERT/SELECT followed by an ALTER TABLE RENAME TO.

Syndicate content
by Wesley Tanaka