The casual approach to time management in Android device is to turn on “Automatic date & time” and “Automatic time zone” in Settings – Date & Time. But what if your user who live in Helsinki (GMT+3) will move to Beijing(GMT+8), unsets both checkboxes, leaves Helsinki’s time zone intact and just adds 5 hours to his current time?
- you may get time from Internet
- you may use Google Timezone API on client or server side, but the app need to know its location
- you can delegate all time routine to server, that will recognize client’s time zone by ip (see Ruby or PHP realizations for example).
But in spite of it all, there are many cases (offline or standalone applications, geodata absence) when the only solution is to ask people to activate time and time zone synchronization.