Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Google Maps API for Android

on

  • 16,863 views

Presenting use of Maps, distance calculation, geolocation.

Presenting use of Maps, distance calculation, geolocation.

Code examples.

Statistics

Views

Total Views
16,863
Views on SlideShare
16,858
Embed Views
5

Actions

Likes
5
Downloads
402
Comments
0

2 Embeds 5

http://www.linkedin.com 3
http://localhost 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Google Maps API for Android Google Maps API for Android Presentation Transcript

    • Maps API Brief introduction Maksim Golivkin www.androidaalto.org www.mobileguild.eu Twitter: MaksimGolivkin 13.11.2010 Android Aalto Community
    • Plan Intro to Google Maps API MapView & MapActivity Overlays Distances Balloons Geocoding UI update with handlers 13.11.2010 Android Aalto Community
    • Intro to maps API: New Project Target build and emulator have to use Google API for platform you have chosen. For instance, Google API for 1.6 13.11.2010 Android Aalto Community
    • Intro to maps API : AndroidManifest.xml Things to remember: uses-library declaration for runtime permissions to access Internet, GPS and network location. 13.11.2010 Android Aalto Community
    • MapView: Layout If you use inappropriate API key, map won't be displayed. For one Google account you can generate several keys. How to generate your own key: http://code.google.com/android/add-ons/google-apis/mapkey.html 13.11.2010 Android Aalto Community
    • MapActivity onCreate 13.11.2010 Android Aalto Community
    • Overlays Each overlay is information layer on the map. Google Maps provides 3 overlay classes: Overlay - drawing complex figures on the map and capturing touch moves. ItemizedOverlay - abstract, extends Overlay, for drawing of multiple markers. MyLocationOverlay - drawing user location. 13.11.2010 Android Aalto Community
    • Overlays: hierarchy 13.11.2010 Android Aalto Community
    • Overlays: ItemizedOverlay #1 Most important thing: on every content change ItemizedOverlay, call protected populate method; include populate call in contructor Reference: http://code.google.com/p/android/issues/detail?id=2035 13.11.2010 Android Aalto Community
    • Overlays: ItemizedOverlay #2 13.11.2010 Android Aalto Community
    • Overlays: ItemizedOverlay usage 13.11.2010 Android Aalto Community
    • Overlays: MyLocationOverlay Convenient to display user location on map. Most important thing: call disableMyLocation, when activity goes to background. 13.11.2010 Android Aalto Community
    • Overlays: MyLocationOverlay usage 13.11.2010 Android Aalto Community
    • Distance Note: Google Maps API uses (int) micro-degrees for coordinates; Android Location package uses (double) degrees for coordinates; microdegrees = degrees * 1000 000; or microdegrees = degress * 1E6; degrees = microdegrees / (double)1E6; 13.11.2010 Android Aalto Community
    • Distance calculation 13.11.2010 Android Aalto Community
    • Balloons : usage 13.11.2010 Android Aalto Community
    • Balloons Nice small existing library. Available at: https://github.com/jgilfelt/android- mapviewballoons 13.11.2010 Android Aalto Community
    • Geocoding Geocoding - translating coordinates to address. Reverse geocoding - translating address from coordinates. GeoCoder class. Use GeoCoder in background thread! 13.11.2010 Android Aalto Community
    • UI update with Handler Nested anonymous classes are ugly! Alternative: Handler + Message + Bundle. Note: when updating UI, be sure to instantiate in UI thread. E.x. onCreate method. 13.11.2010 Android Aalto Community
    • Example code can be found at: http://mobileguild.eu/FindHackatron.zip Thank you! 13.11.2010 Android Aalto Community