date - How to retrieve provider time in Android programmatically? -
i doing android app has display current server/network operator time since device time can changed user. don't want change/set device time. tried few source codes didn't work well. i'm able device date , time need date , time server or network provider itself. please me
it seems need interface network time protocol (ntp).
there similar questions here on use of ntp service, get datetime network provider (as noted gheo) suggesting to:
- use
android.net.sntpclient.java
source code , javadocs - read through this google groups thread
as noted in comments of these posts, of honeycomb cannot network operations in main activity thread (suggestion: use service instead).
update:
a further search led me find dominik schürmann's ntp-sync repository on github. provides different examples of how can use library can compile , run on emulator/device.
Comments
Post a Comment