Skip to content
GPS AIR Native Extension gives you access to device's gps tool
ActionScript AngelScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
AIR V3.3.41 Aug 4, 2019

GPS ANE for Android+iOS

Although there is a GPS API coming with AIR SDK, in a real app development scenario, you need a better GPS solution. You need an exact and faster Gps solution which you can really trust. That's why we decided to build this cool GPS extension. it's highly optimized for automatic provider picker to ensure your app will get user location as fast as possible even if indoor. it's also optimized for battery usage so you don't have to worry about your app's battery usage at all. try the extension right now for free and see how fast it is.

Main Features:

  • start/stop GPS service periodically
  • get one time location finder for better battery usage
  • geocoding reverse to convert gps coordinates to real addresses
  • geocoding reverse to convert gps coordinates to real addresses

find the latest asdoc for this ANE here.

AIR Usage - location

For the complete AS3 code usage, see the demo project here.

     import com.myflashlab.air.extensions.gps.*;

        Make sure you have asked for location permission using the
        permissionCheck ANE.
     Gps.init(); // call init only once in your project
     // will return null if no known last location has been found
     // may take a while depending on when gps info is found
     function onLocationResult($result:Location):void
         if (!$result)
             trace("location is null");
         trace("accuracy = " + $result.accuracy);
         trace("altitude = " + $result.altitude);
         trace("bearing = " + $result.bearing);
         trace("latitude = " + $result.latitude);
         trace("longitude = " + $result.longitude);
         trace("provider = " + $result.provider);
         trace("speed = " + $result.speed);
         trace("time = " + $result.time);
     // use the start method to get gps information periodically (the gps icon will be shown at your device status bar)
     Gps.location.addEventListener(GpsEvent.LOCATION_UPDATE, onLocationUpdate);
     Gps.location.start(LocationAccuracy.HIGH, 0, 5000);
     // simply stop the gps service when you don't need to get location information periodically anymore.
     Gps.location.removeEventListener(GpsEvent.LOCATION_UPDATE, onLocationUpdate);
     function onLocationUpdate(e:GpsEvent):void
         trace(" ------------------------------- onLocationUpdate");
         var loc:Location = e.param;
         trace("accuracy = " + loc.accuracy);
         trace("altitude = " + loc.altitude);
         trace("bearing = " + loc.bearing);
         trace("latitude = " + loc.latitude);
         trace("longitude = " + loc.longitude);
         trace("provider = " + loc.provider);
         trace("speed = " + loc.speed);
         trace("time = " + loc.time);

AIR Usage - Geocoding

     Gps.geocoding.reverse(-33.7969235, 150.9224326, onResultGeocodingReverse);
     function onResultGeocodingReverse($address:Array):void
         // there might be more than one address found for this location
         trace("$address.length = " + $address.length);
         trace("$address = " + JSON.stringify($address));
 "Sydney", onResultGeocodingDirect);
     function onResultGeocodingDirect($location:Array):void
         // there might be more than one location found for this address
         trace("$location.length = " + $location.length);
         trace("$location = " + JSON.stringify($location));

AIR .xml manifest

<manifest android:installLocation="auto">
		<uses-permission android:name="android.permission.WAKE_LOCK" />
		<uses-permission android:name="android.permission.INTERNET" />
		<uses-sdk android:targetSdkVersion="28"/>
		<!-- required for GPS -->
		<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
		<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
		<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
		<uses-permission android:name="" />
		<uses-permission android:name="" />
		<application android:hardwareAccelerated="true" android:allowBackup="true">
			<activity android:hardwareAccelerated="true">
					<action android:name="android.intent.action.MAIN" />
					<category android:name="android.intent.category.LAUNCHER" />
					<action android:name="android.intent.action.VIEW" />
					<category android:name="android.intent.category.BROWSABLE" />
					<category android:name="android.intent.category.DEFAULT" />
			<!-- required for GPS -->
			<service android:name="io.nlopez.smartlocation.geocoding.providers.AndroidGeocodingProvider$AndroidGeocodingService" android:exported="false" />
			<service android:name="io.nlopez.smartlocation.activity.providers.ActivityGooglePlayServicesProvider$ActivityRecognitionService" android:exported="false" />
			<service android:name="io.nlopez.smartlocation.geofencing.providers.GeofencingGooglePlayServicesProvider$GeofencingService" android:exported="false" />
			<meta-data android:name="" android:value="@integer/google_play_services_version" />

		<true />
		<!--required for GPS-->
		<string>I need location reason</string>
		<string>I need location reason</string>
		<string>I need location reason</string>
			<!-- iPhone support -->
			<!-- iPad support -->
Embedding the ANE:


        <!-- Required for gps ANE to work -->
	    <!-- Dependency ANEs -->



  • Android API 15+
  • iOS SDK 10.0+
  • AIR SDK 30+


Below are the list of Permissions this ANE might require. Check out the demo project available at this repository to see how we have used the PermissionCheck ANE to ask for the permissions.

Necessary Optional

Commercial Version



How to embed ANEs into FlashBuilder, FlashCC and FlashDevelop

Premium Support

Premium Support package If you are an active MyFlashLabs club member, you will have access to our private and secure support ticket system for all our ANEs. Even if you are not a member, you can still receive premium help if you purchase the premium support package.

You can’t perform that action at this time.