440 likes | 1.27k Views
Android location-based services. Peter Liu School of ICT, Seneca College. Android Location-Based Services. Google Maps 2 demos: MyFirstMap, MyPlaces Geocoding and Reverse Geocoding demo: GeocodingTester Location Awareness demo: MyFirstLocation Location Awareness + Google Maps
E N D
Android location-based services Peter Liu School of ICT, Seneca College
Android Location-Based Services • Google Maps • 2 demos: MyFirstMap, MyPlaces • Geocoding and Reverse Geocoding • demo: GeocodingTester • Location Awareness • demo: MyFirstLocation • Location Awareness + Google Maps • demo: I AM HERE
Google Maps Android API v2 • Warnings • API v1: deprecated in December 2012 https://developers.google.com/maps/documentation/android/v1/ • the examples in the textbook: outdated • testing on a real Android device • the Gentry emulator? • Example 1: MyFirstMap • Example 2: MyPlaces
MyFirstMap • Activity • get a handle to a Google Map object • the initial state of the map object • map types • the layout xml file • MapFragment • the Android Manifest file • permissions • Google Maps API key (How to get it?)
MyPlaces • the LatLng class • add markers to a map • move the camera
LAB 8 • Install Google Play services library for your Android SDK. • Add Google Play services as an Android library project. • Reference the Google Play services in your Android project. • More…
Geocoding and Reverse Geocoding • Android Location API • Demo: GeocodingTester • Geocoding • address => geo-coordinates: (latitude, longitude) • Reverse Geocoding • geo-coordinates: (latitude, longitude) => address
MyFirstGeocoder • emulator: Google API (NOT Android API) • the Geocoder class • the Address class • permissions in the Android manifest file
GeocodingTester • an array of addresses • an array of geo-coordinates • UI • Spinner views • EditText views: not implemented yet!
Location Awareness • get your current geographical location • Example 1: MyFirstLocation • the LocationManager object • the Criteria object • permissions in the Android Manifest file • emulator • Android API: ok! • use DDMS to send GPS coordinates
Location Awareness + Google Maps • Example (Dartmouth College): I AM HERE
Resources • the course wiki