1

background

since it could be useful for testing of apps that need to run based on dates and time, it could be nice to create a widget/shortcut on the "desktop" of android, and by a single click to skip a few hours/days/...

the problem

i don't think there is such a thing using the normal API. the only similar thing is to use an intent to open the date options.

the question

is it possible to do it using the API of android? if not, is it possible to do it using ROOT? how?


EDIT: i've found a way to do it using root, here , but i can't find the correct parameters and documentation of how to use it (the link isn't correct about the parameters for android).

android developer
  • 114,585
  • 152
  • 739
  • 1,270

1 Answers1

0

You don't need to root your device, just use following code,

startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));

The another way is by using SystemClock class's setCurrentTimeMillis(long millis) method.

Vigbyor
  • 2,568
  • 4
  • 21
  • 35
  • again, i already know that there is an intent for going to the settings. i've asked how i can change it myself, without letting the user going over the settings. – android developer Jul 17 '13 at 06:34
  • Yes, and how about another way ? – Vigbyor Jul 17 '13 at 06:35
  • i don't think that a normal permission can be used for this. i've now found this link: http://stackoverflow.com/a/8752130/878126 . not sure i understand how it works though, but it seems that root is required. – android developer Jul 17 '13 at 06:40