Base code for Android