Can we change the device time using an application?


Last Updated:

  1. MGunetileke

    MGunetileke New Member This Topic's Starter

    Joined:
    Jun 25, 2010
    Messages:
    1
    Likes Received:
    0
    Hi everyone..

    Trying to find out whether it is possible to change the TIME of the DEVICE using a third party application for us developers. Does the Android OS allow that kind of dev access to the device clock?

    If so, could you direct me to any API / Class which allows us to do so?
    (trying to find a definitive answer for a client.. :) )

    Thanks in advance!
     

    Advertisement
  2. Boogs

    Boogs Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    85
    Likes Received:
    16
    While I don't know for sure, I would guess that you could only do that if you had a rooted phone. Normally that's only something that you can do with that permission.
     
  3. Boogs

    Boogs Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    85
    Likes Received:
    16
    I looked a little more into it, and you might be able to set the system time. Try using setCurrentTimeMillis() in android.os.SystemClock It says that you need to have the appropriate permissions , but it may work.
     
  4. Boogs

    Boogs Well-Known Member

    Joined:
    Apr 6, 2010
    Messages:
    85
    Likes Received:
    16
    Use android.permission.SET_TIME in your manifest file and you should be golden.
     

Share This Page

Loading...