8ce4ba9a36cbf22d1a6a199da1d2772c.ppt
- Количество слайдов: 11
Google APIs & Location Based Applications -Krishna Achanta krishna. achanta@gmail. com
Prerequisites a. Eclipse with Android SDK and AVD Manager • Google Apis • Java • XML • Android device[or Emulator] to test
Agenda: 1. Google Maps Api for Android. For applications using Google Map. Views 2. Android Location Package. The classes required to access the users location without having to use maps.
Map. View a. Adding Google APIs • Obtaining Maps Key • Using Map. Activity • Showing current location • Adding Overlay items
Map. View: Adding Google APIs All you need. [not really] http: //code. google. com/android/add-ons/googleapis/index. html
Map. View: Obtaining Maps Key a. Generate Certificate b. keytool -genkey -v -keystore droid_kids. keystore -alias droid_kids -keyalg RSA -keysize 2048 validity 10000 • Get Fingerprint of the certificate • • keytool -list -alias droid_kids -keystore droid_kids. keystore Fingerprint is : E 0: 9 D: 58: 9 F: B 2: CD: 5 C: 9 C: 42: 8 B: 60: 0 F: 23: BC: 24: 11 • Register the fingerprint with Google Maps Service • • http: //code. google. com/android/maps-api-signup. html Key is: 0 zu 3 JWra 9 v. K 5 Lxsw. GR 1 V 4 Wh 3 Sztud. X-Ujg. LWLJA
Map. View: Create Maps Activity a. Include Maps library b. <uses-library android: name="com. google. android. maps" /> • Add permissions • • • <uses-permission android: name="android. permission. INTERNET" /> <uses-permission android: name="android. permission. ACCESS_FINE_LOCATION" /> <uses-permission android: name="android. permission. ACCESS_COARSE_LOCATION" /> • Create a Map. View layout and add the key • <com. google. android. maps. Map. View xmlns: android="http: //schemas. android. com/apk/res/android" android: id="@+id/mapview" android: layout_width="fill_parent" android: layout_height="fill_parent" android: clickable="true" android: api. Key="0 zu 3 JWra 9 v. K 5 Lxsw. GR 1 V 4 Wh 3 Sztud. X-Ujg. LWLJA"/>
Map. View Coding a. Layers • Zoom • Center • Overlays • My. Location
Find Location Sources Location. Manager & Location Providers Criteria Location. Listener location. Manager. request. Location. Updates(best. Provider, time, distance , location. Listener);
Questions OUT OF TIME
References http: //developer. android. com/guide/topics/location/index. htm l - http: //code. google. com/android/add-ons/google-apis/ - http: //www. anddev. org/index. php - http: //itouchmap. com/latlong. html [For finding location coordinates].
8ce4ba9a36cbf22d1a6a199da1d2772c.ppt