0

If user change the datetime from android phone settings,then it will not provide real time from activity class using java datetime.

So how to get realtime,if user change it from settings.

Vidhya
  • 443
  • 8
  • 27

2 Answers2

0

Get it from Api. There is a lot of time providing Apis. Or use your own Api.

0

You could use an API to get the result you want.

An example of that would be this API.

  • Its a known solution,How to get this without internet? – Vidhya Apr 23 '20 at 03:23
  • This may help you with your problem : https://stackoverflow.com/questions/44408988/how-to-get-network-provided-date-and-time-without-internet-connection. The answer basically is to get the time from the last known location through the GPS provider and not internet. PS: You should make sure that you post exactly what you want in your questions , because the clarification to not use internet was not anywhere. – John - Aliferis Apr 23 '20 at 14:30