SettingsApi Deprecated Android.
Alway’s find the alternative.
The SettingsApi make easy for an app to ensure that the device system settings are properly configured with the location.
It’s a very useful API, we don’t need to send a user to the settings screen to turn on the location, The SettingsAPI will give a smooth experience to turn on-location services.
Now, this API is no longer, It’s alternative is SettingsClient.
How we will use this SettingsClient Let’s start with the implementation.
Visit my website at https://danishamjad.com/
First, you just need to define LocationRequest in LocationSettingsRequest like below:
Then check whether current location settings are satisfied:
After that just call the addOnCompleteListener to check the location is satisfied by the user or not:
That’s it…
Sharing the knowledge is Caring :-)
If you want to learn about some other topic check the link below:
Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.
If you need any help then Join me on Twitter, Linkedin, Github, and Subscribe to my Youtube Channel.