1

I am trying to see if there is any API I can use to read the user's settings like date/time etc on Android device. If the user selects 24 hour format or changes any other setting, I should be able to know about it.

Any info on this will be helpful.

Thanks in advance.

pg238
  • 1,145
  • 2
  • 15
  • 26

1 Answers1

1

There is no all encompassing API to gather user settings. You will need to query a few different APIs to get what you need.

One is Device

Device.getLocale()
Device.getScreenSize()

is the common way to get the current locale setting.

If you want to get an update when the user changes it you could try a broadcast receiver like in this answer:

Android - Listening to a locale change without static variables

You can access the user date preferences via DateFormat.

DateFormat.is24HourFormat(context)
Community
  • 1
  • 1
Cory Roy
  • 5,379
  • 2
  • 28
  • 47