bruce scharlau, university of aberdeen, 2010 android and location mobile computing unless otherwise...
TRANSCRIPT
![Page 1: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/1.jpg)
Bruce Scharlau, University of Aberdeen, 2010
Android and Location
Mobile Computing
Unless otherwise stated, images are from android sdk
![Page 2: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/2.jpg)
Latitude and Longitude determine location
• Latitude = north/south of the equator
• Longitude = east/west of Greenwich
Bruce Scharlau, University of Aberdeen, 2010
![Page 3: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/3.jpg)
And where is Aberdeen?
What’s the latitude and longitude of Aberdeen?
Bruce Scharlau, University of Aberdeen, 2010
![Page 4: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/4.jpg)
Aberdeen is west of London
Bruce Scharlau, University of Aberdeen, 2010
http://www.earthtools.org/
57.1467°N 2.0901°W
![Page 5: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/5.jpg)
Use Google API for location
• Select Google APIs for new projects using maps and location
• Otherwise your app won’t run
Bruce Scharlau, University of Aberdeen, 2010
![Page 6: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/6.jpg)
Also put permissions in manifest
• Need to add permissions for
• INTERNET
• ACCESS_COURSE_LOCATION
• ACCESS_FINE_LOCATION
Bruce Scharlau, University of Aberdeen, 2010
![Page 7: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/7.jpg)
Manifest also needs to specify map library
Apps with maps need to specify need as ‘true’ for com.google.android.maps library in manifest
Bruce Scharlau, University of Aberdeen, 2010
![Page 8: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/8.jpg)
Map layouts need API key
• Need to get Google MAPs API key to use maps in your apps – referenced in layout
Bruce Scharlau, University of Aberdeen, 2010
http://code.google.com/android/add-ons/google-apis/mapkey.html
This allows map tiles to be downloaded to your application
![Page 9: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/9.jpg)
Direction API for routes included
Bruce Scharlau, University of Aberdeen, 2010
Can use direction API within maps API for routes
http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html
![Page 10: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/10.jpg)
LocationListener updates map
Bruce Scharlau, University of Aberdeen, 2010
This is about as simple as it gets for map display
http://www.vogella.de/articles/Android/article.html#locationapi
![Page 11: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/11.jpg)
Use DDMS tool to set location
Bruce Scharlau, University of Aberdeen, 2010
![Page 12: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/12.jpg)
Geocoder library to look up location
Bruce Scharlau, University of Aberdeen, 2010
![Page 13: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/13.jpg)
Can’t use external Bluetooth GPS devices with Android
• Can’t use external BT device for location determination, as you can with Java ME
• There is a separate app for this you can install and enable this feature: Bluetooth GPS Provider (not tried it yet)
Bruce Scharlau, University of Aberdeen, 2010
![Page 14: Bruce Scharlau, University of Aberdeen, 2010 Android and Location Mobile Computing Unless otherwise stated, images are from android sdk](https://reader033.vdocuments.mx/reader033/viewer/2022051210/5515d886550346d46f8b498e/html5/thumbnails/14.jpg)
Summary
• Maps need API key to be displayed
• Maps needs permissions set in manifest
• Maps need API enabled
• Lots of work done over network
Bruce Scharlau, University of Aberdeen, 2010