I'm attempting to follow the Android geofencing guide, but I immedietely get stuck when I try to declare a GeofencingClient
variable:
Normally I would be able to just press Alt+Enter and select "Import class", but this option isn't available here:
Does the GeofencingClient
class exist anymore? Do I need to install some third party library?
GeofencingClient is part of Google Play Services. You need to add the following dependency to the build.gradle file of the module, then you will be able to import the class in your code:
dependencies {
// ...
implementation 'com.google.android.gms:play-services-location:17.0.0'
//...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With