How to adjust device time from my application? Especially with tablets, as tablets do not sync time as phones do.
Asked
Active
Viewed 1,018 times
3
-
Why would you need to do that? I'd uninstall any app which messed with the time on my device. – Squonk Dec 05 '11 at 15:14
-
I assume it's Java you're working with; if that's the case your answer has already been answered [here](http://stackoverflow.com/questions/454315/how-do-you-format-date-and-time-in-android). – Griffin Dec 05 '11 at 15:15
-
@MisterSquonk This is not market app that you choose. This is corporate app and unfortunately tablets do not sync time as phones do. We seeing all kinds of issues. Ther is always someone with time 1:30 minutes off.. – katit Dec 05 '11 at 15:22
1 Answers
1
Edit: Try
AlarmManager a = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
a.setTime(millis);
Don't forget permission SET_TIME
in your manifest.

Nikola Despotoski
- 49,966
- 15
- 119
- 148
-
Seems like it is not available to "general" public. Have you tried it yourself? http://stackoverflow.com/questions/2918624/android-os-2-2-permissions-i-have-absolutely-no-idea-why-this-simple-piece-of-c – katit Dec 05 '11 at 15:29
-
-
Nevermind it. I just got misinterpreted http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html I thought DPM can change the time as well. – Nikola Despotoski Dec 05 '11 at 15:46