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:
Sharing the knowledge is Caring :-)
If you want to learn about some other topic check the link below:
View Your Drawables Images Thumbnails in Android Studio
View Your Images Thumbnails just in one Click.
Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.