Location - Manage and request the activation of the device's GPS or location services via Google Play Services

Location
Manage and request the activation of the device's GPS or location services via Google Play Services.

Displays the native Google Play Services system dialog that asks the user to enable location with a single tap (without having to manually send them to the phone's Settings screen).


IsLocationEnabled

Check if the device's location or GPS is currently enabled.

component_method (3)


OpenLocationSystemDialog

Displays the pop-up dialog to enable GPS.

component_method (2)


HasLocationPermission

Check if the application has been granted location permissions.

component_method (2)

  • ACCESS_FINE_LOCATION
  • ACCESS_COARSE_LOCATION

StartLocationUpdates

Start listening for real-time location updates.

Priority:

  • 100 (Priority.PRIORITY_HIGH_ACCURACY): High precision. It primarily uses GPS. It is ideal for navigation or mapping applications where exact location is critical. It consumes the most battery power.

  • 102 (Priority.PRIORITY_BALANCED_POWER_ACCURACY): Balanced accuracy. Uses Wi-Fi and mobile networks (cell towers). Offers an accuracy of approximately 100 meters with moderate battery consumption.

  • 104 (Priority.PRIORITY_LOW_POWER): Low power consumption. It relies primarily on cellular towers. Accuracy is at the city or neighborhood level, and it consumes very little battery power.

  • 105 (Priority.PRIORITY_PASSIVE): Passive. It does not actively request locations; it only receives locations requested by other applications on the device. It does not result in additional battery consumption..


StopLocationUpdates

Stops listening for location updates.

component_method (3)


CalculateDistance

Calculate the direct distance in meters between two geographic points (Lat1, Lng1) y (Lat2, Lng2).


GetAddressFromCoordinates

Obtains the physical address and postal code from a latitude and longitude.


GetCoordinatesFromAddress

Obtains latitude and longitude from an address string.


Latitude

Returns the last latitude obtained.

component_set_get (1)


Longitude

Returns the last length obtained.

component_set_get (2)


Altitude

Returns the current altitude in meters.

component_set_get (3)


Speed

Returns the current speed in meters per second.

component_set_get (4)


LocationChanged

It triggers when the location changes in real time.


GotAddress

It triggers when a formatted address, country, city, and postal code are successfully obtained.


GotCoordinates

It triggers when coordinates are obtained from an address.


LocationEnabled

It activates when location services are correctly enabled or are already turned on.


LocationDenied

It activates when the user rejects or cancels the request to enable location services.


LocationError

It is triggered when an error occurs while requesting location settings or checking Google Play services.


v1.1 September 05, 2026.

Location.aia (339.7 KB)

joejsanz.joedevlocation.aix (334.5 KB)


JDK: 17
Minimum API Level: 14
Bundled Dependency: com.google.android.gms:play-services-location:21.0.1
Manifest: Auto-Injected Permissions: ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION
Updated On: 2026-09-05T07:00:00Z

Built using: FAST-CLI v7.0.0-premium


Support free development

  • This extension is and will remain free. If you have found it useful and wish to support my work so I can continue creating and updating components like this one, any voluntary contribution is greatly appreciated:

Donar con PayPal


Thanks.

4 Likes

Good stuff.

Now, I do not have google play services/play store installed, can you make one for that ? :wink:

1 Like

Call the dialog without Google services?

I think that's a bit difficult; I'll look into it.

2 Likes

Thank you for your contribution!

This will not be possible as it uses the Google Play Services Location Settings API

But as fallback you just could open the location settings for the user to enable gps manually

Btw. I would rename method RequestLocationSettings to OpenLocationSystemDialog

Taifun

1 Like

Thanks Taifun, the function name has been corrected.

1 Like

Can you please also include location sensor with lat and lang, geocoding, gps stastus? So that all eelated functions, calls and events will be in a single extension.

1 Like

showing this, testing using companion

I forgot to mention that it only works with the APK installed.

1 Like

I’ve added those functions and am testing another one to calculate the distance between two coordinates.

I’ll publish it as soon as possible.

1 Like

Updatev1.1

2 Likes

testing in companion

I usually don't deal with extensions, but this is a general purpose error.

You were trying to refer to a variable local to a different event block.

ooppsss…. Sorry.. i didnot notice that

can u pls provide aia with all functions and calls?

You might have wanted to set up the block you placed like this: