O'Reilly logo

Flash Development for Android Cookbook by Joseph Labrecque

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Invoking Google maps from an application

Being that most Android devices are mobile, the ability to tap into some sort of mapping is expected by both developers and users. The Android OS is managed by Google, and the company has a long history of great mapping technologies on the web. This is great for developers because we can piggyback on the very cool Maps application on Android and pass in all sorts of coordinates from our application.

How to do it...

Have the application detect the device geolocation coordinates, invoke navigateToURL, and pass in a new URLRequest with a correctly formatted URL to access the Android maps application:

  1. First, import the following classes into your project:
    import flash.display.Sprite; import flash.display.StageAlign; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required