Android Activity Lifecycle

This is very old topic. Back to 2009 – some day I promised to myself to read android javadoc method by method. I didn’t:) So even now from time to time I find interesting methods in interesting places. Like onUserLeaveHint() and onUserInteraction() in Activity (API v3).

Anyway, here is an interesting picture of complete Activity Lifecycle originally posted on G+. Just found it on reddit today.

complete android fragment activity lifecycle

http://staticfree.info/~steve/complete_android_fragment_lifecycle.png

just in case you missed it

//DL

Android Map v2 clustering

Just a quick reference for different Android Map clustering solutions:

android clustering

//DL

instrumentTestCompile

In case you get this error:

Build script error, unsupported Gradle DSL method found: ‘instrumentTestCompile()’!
Possible causes could be:
- you are using Gradle version where the method is absent
- you didn’t apply Gradle plugin which provides the method
- or there is a mistake in a build script

instrumentTestCompile() was renamed to androidTestCompile() in the latest version of gradle plugin

Here is a guide http://tools.android.com/tech-docs/new-build-system/migrating_to_09
//DL

Phone SMS verification for your project

twillio

If you are developing mobile application that needs phone verification – Twilio is a good start point. They also have a promotion for Google Cloud Platform http://ahoy.twilio.com/googlecloudplatform.

Here is an article how to integrate Twilio to your Google AppEngine project https://developers.google.com/appengine/articles/twilio. Upd: seems this code doesn’t work anymore

I’ve recently tried to integrate the latest Twilio python library to my GAE application. Version 3.6.2 fails with NotSupportedOnThisPlatform – Google Cloud Platform doesn’t support certificates in httplib2. Use 3.5.2 version instead.

//DL

Developing for Amazon Kindle Fire

amazon kindle fire

Kindle Fire development could be a little bit tricky. There are five different device configurations available.
One device has a little bit strange config. It is sw533dp (smallestWidth) because of 1280×800 resolution with hdpi density.

I’ve summarized info to the table:

resolution dpi size sw
Kindle Fire HDX 8.9″ 2560×1600 xhdpi xlarge sw800
Kindle Fire HDX 7″ 1920×1200 xhdpi large sw600
Kindle Fire HD 7″ (2nd/3rd gen) 1280×800 hdpi large sw533
Kindle Fire HD 8.9″ 1920×1200 hdpi xlarge sw800
Kindle Fire (1st/2nd gen) 1024×600 mdpi large sw600
Nexus 7 1280×800 tvdpi large sw600
Nexus 10 2560×1600 xhdpi xlarge sw800
So you may consider to have something like drawable-sw533dp or layout-sw533dp in your project.

How to generate unique device id

android device id

At some point of time you will need seamless user/device identification for your application.

It is not so simple to generate unique device id on Android because of:

  1. multiple Android versions
  2. Google bugs
  3. root
  4. custom ROM modifications with bad Build.SERIAL or ANDROID_ID
  5. multiuser support (4.2 and up)

First of all you can start with this:

  1. Google blog post “Identifying App Installations” http://android-developers.blogspot.ru/2011/03/identifying-app-installations.html
  2. Read stack overflow discussions http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id
  3. Read Samsung documentation http://developer.samsung.com/android/technical-docs/How-to-retrieve-the-Device-Unique-ID-from-android-device

Be aware that ANDROID_ID could be changed after user switch (multiuser in 4.2)

Continue reading

VK Stream

We’ve created the new Android and iPhone applications for Russian vk.com social network.
If you understand Russian language – you can try:)

http://vkstream.me

https://play.google.com/store/apps/details?id=com.amberfog.reader

vkstream

enjoy!

//DL

Encrypted SQLite

If you keep sensitive data in your Android application SQLite database – you probably want to keep in save and encrypted. Here is SQLCipher for Android to help you with it.

SQLCipher is an open source library that provides transparent, secure 256-bit AES encryption of SQLite database files.

One small problem – your APK size will increase for another… 3Mb:)

//DL

Wanna Key Lime Pie?

:)

source

Android UI components and libraries

Nice collections of Android UI components and libraries!

http://www.theultimateandroidlibrary.com/
http://www.androidviews.net/

//DL

© 2014 Android Tales

Theme by Anders NorenUp ↑