Updated Code for Android