0

Background: I am developing an app for commercial use, that will be sold with a dedicated device. In other words the customer will buy an android table from us, with a custom rom that restricts the use of the device to our software.

The Problem: It is vital to the operation that the clock in the android device is synced to the server, which means that the app needs to be able to update the time.

The information that I have found so far seems to be sketchy tbh, but this is what I have found:

  • I Need the SET_TIME Permission
    • To get this I will need to be installed as a System app (I do this by placing the apk in the system/app folder)...
    • ...and I will need to sign my application with the same keys that built the system image
    • I will need to add android:sharedUserId="android.uid.system" to the manifest

Am I on the right track?

CurlyPaul
  • 1,138
  • 1
  • 10
  • 29
  • 1
    If this is a custom ROM, it would seem to be simpler to modify the SNTP logic in the custom ROM to reference the SNTP server that you want, rather than trying to do this at the app level. – CommonsWare Jul 19 '13 at 12:18
  • @CommonsWare - That sounds like a reasonable idea, we have not started working on the ROM yet so I'm not sure what is and isn't possible at that level. The devices that we have suffer terrible time drift so I assumed that they did not reference an SNTP at all. – CurlyPaul Jul 19 '13 at 12:27

1 Answers1

1

Well I read up some more, and I'm still not sure if its possible to use an NTP server even when building my own ROM. Most android devices will use NITZ to get the date from the mobile network, but my target device is WIFI only.

I found the answer here Setting system time of ROOTED phone - specifically @CrazyCoder's answer that revealed how his ClockSync app works.

This solution requires the device to be rooted, but does not need to be a system app or any of the permissions that go with that.

Community
  • 1
  • 1
CurlyPaul
  • 1,138
  • 1
  • 10
  • 29