0

I need a help, I have to set date and time on android, but being a time and date customized by me. Android version is 4.2 but I don't know how to do this in Android Studio.

I'm trying to set a specific date and time in the application, because it's getting lost in time due to the equipment not having access to the internet.

I have an app an his Android Version is 4.2, and this app don't have internet acess. Sometimes the date are totaly wrong, and I need to put a right date/time.

The android is rooted, and I don't know how I set the right date/time before the app start.

  • For a manual solution see https://stackoverflow.com/q/19496907/150978. Alternatively consider searching for an app that uses GPS as time source. – Robert May 19 '23 at 19:43
  • So I need to make this change while the app is being compiled. – Android_junior May 19 '23 at 20:18
  • Not sure what you are talking about. You simply need an app that uses root to correct date. As Java/Kotlin code of an app never runs with root permissions you have to make a command line with `su` that sets date and time. Or you simply set time and date manually in Android settings. – Robert May 19 '23 at 21:00
  • I find the solution here https://stackoverflow.com/questions/20772270/how-to-set-time-zone-for-android-rooted-device. – Android_junior May 23 '23 at 11:59

0 Answers0