updated code samples to work with Android 4.3 API Level 18