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:

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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -