Location determination with Android

782 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
782
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Location determination with Android

  1. 1. Android and Location Mobile Computing Bruce Scharlau, University of Aberdeen, 2009 Based on android-sdk_1.6-r1 Unless otherwise stated, images are from android sdk
  2. 2. Proxy issues while in eduroam <ul><li>Instructions now on assignment page </li></ul><ul><li>Java ME: see practical 3 </li></ul><ul><li>Android: see practical 8 </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  3. 3. Latitude and Longitude determine location <ul><li>Latitude = north/south of the equator </li></ul><ul><li>Longitude = east/west of Greenwich </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  4. 4. And where is Aberdeen? <ul><li>What’s the latitude and longitude of Aberdeen? </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  5. 5. Aberdeen is west of London Bruce Scharlau, University of Aberdeen, 2009 http://www.earthtools.org/ 57.1467°N 2.0901°W
  6. 6. Use Google API for location <ul><li>Select Google APIs for new projects using maps and location </li></ul><ul><li>Otherwise your app won’t run </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  7. 7. Also put permissions in manifest <ul><li>Need to add permissions for </li></ul><ul><li>INTERNET </li></ul><ul><li>ACCESS_COURSE_LOCATION </li></ul><ul><li>ACCESS_FINE_LOCATION </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  8. 8. Manifest also needs to specify map library <ul><li>Apps with maps need to specify need as ‘true’ for com.google.android.maps library in manifest </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  9. 9. Map layouts need API key <ul><li>Need to get Google MAPs API key to use maps in your apps – referenced in layout </li></ul>Bruce Scharlau, University of Aberdeen, 2009 http://code.google.com/android/add-ons/google-apis/mapkey.html This allows map tiles to be downloaded to your application
  10. 10. Direction API for routes included Bruce Scharlau, University of Aberdeen, 2009 Can use direction API within maps API for routes http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html
  11. 11. LocationListener updates map Bruce Scharlau, University of Aberdeen, 2009 This is about as simple as it gets for map display http://www.vogella.de/articles/Android/article.html#locationapi
  12. 12. Use DDMS tool to set location Bruce Scharlau, University of Aberdeen, 2009
  13. 13. Geocoder library to look up location Bruce Scharlau, University of Aberdeen, 2009
  14. 14. Can’t use external Bluetooth GPS devices with Android <ul><li>Can’t use external BT device for location determination, as you can with Java ME </li></ul><ul><li>This will, hopefully, change as android develops. </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  15. 15. Summary <ul><li>Maps need API key to be displayed </li></ul><ul><li>Maps needs permissions set in manifest </li></ul><ul><li>Maps need API enabled </li></ul><ul><li>Lots of work done over network </li></ul>Bruce Scharlau, University of Aberdeen, 2009

×