Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lock the date & time settings android

Tags:

android

Is it possible to lock or set a password for the date and time settings of android device which is running in ICS & Jelly Bean. I've developed an android application for the company that most of the functions are dependent on Date & Time of the device since it can work even offline when internet connection is not available on area. The device is provided by the company to the users, so assuming that we have the rights to limit the settings.

I have read one of the Android tutorial from Android Developers Guide which is for Device Administration but it didn't cover what I need for the app.

http://developer.android.com/guide/topics/admin/device-admin.html

Any idea, available code or tutorial on how to achieve this is highly appreciated. Thank you.

like image 358
jamcoder Avatar asked Dec 03 '13 03:12

jamcoder


1 Answers

I think this is not possible... I've been searching for a solution and I've found nothing!

What I did was check if the user have uncheck "date/time autosync" when using some specific features that relies on system date/time and don't let the user use them.

See:

Settings.System.getInt(context.getContentResolver(), Settings.System.AUTO_TIME);
like image 169
Christian Avatar answered Sep 17 '22 16:09

Christian