tags:

views:

48

answers:

4

Hello In m,y android application i would like to use time which do not come from device but a standard time that the user cannot change. Is there any way to do this.

Please share your valuable suggestions.

Thanks in advance:)

A: 

I'm unclear on the question here. The time on the phone in almost all (maybe all?) cases will be from the network, which will be the official time. If you need it in a different time zone that shouldn't be a difficult conversion.

kcoppock
I need the same timezone but the issue is it shouldnot be device time because device time can vary as the user can change the device time.I need this time to validate the subscription charges.
Remmyabhavan
If you're using it for some sort of validation, you're better off sending a request to a server that you control and storing the subscription details on that. Putting billing information in the APK itself is just opening yourself up to people trying to circumvent your system.
Drew
A: 

If you don't mind the overhead, you could make a request to a time server for the official time. I'm sure there's one out there somewhere that accepts JSON or webservice requests.

Drew
Server is not providing us with time.
Remmyabhavan
+3  A: 

You can use NTP for fetching the time from any of the public NTP servers. You can read the example SNTP client code for java here.

bhups
A: 

This will give u current time..

System.currentTimeMillis();

thanks rakesh

Rakesh Gondaliya