1. Trang chủ
  2. » Giáo án - Bài giảng

Android + Google API

11 338 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 11
Dung lượng 0,95 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Google APIs & Location Based Applications -Krishna Achanta krishna.achanta@gmail.com... Google Maps Api for Android.. For applications using Google MapViews 2.. Android Location Package

Trang 1

Google APIs 

Location Based Applications

-Krishna Achanta krishna.achanta@gmail.com

Trang 2

• Eclipse with Android SDK and

AVD Manager

• Google Apis

• Java

• XML

• Android device[or Emulator] to

test

Trang 3

1 Google Maps Api for Android.

For applications using Google MapViews

2 Android Location Package.

The classes required to access the users location without having to use maps.

Trang 4

• Adding Google APIs

• Obtaining Maps Key

• Using MapActivity

• Showing current location

• Adding Overlay items

Trang 5

MapView: Adding Google APIs

All you need [not really]

http://code.google.com/android/add-ons/google-apis/index.html

Trang 6

MapView: Obtaining Maps Key

• Generate Certificate

• 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 : E0:9D:58:9F:B2:CD:5C:9C:42:8B:60:0F:23:BC:24:11

• Register the fingerprint with Google Maps Service

• http://code.google.com/android/maps-api-signup.html

• Key is: 0zu3JWra9vK5LxswGR1V4Wh3SztudX-UjgLWLJA

Trang 7

MapView: Create Maps Activity

• Include Maps library

• <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 MapView layout and add the key

• <com.google.android.maps.MapView

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:apiKey="0zu3JWra9vK5LxswGR1V4Wh3SztudX-UjgLWLJA"/>

Trang 8

MapView Coding

• Layers

• Zoom

• Center

• Overlays

• MyLocation

Trang 9

Find Location

Location Sources

LocationManager & Location Providers

Criteria

LocationListener

locationManager.requestLocationUpdates(bestProvider, time, distance , locationListener);

Trang 10

OUT OF TIME

Trang 11

- http://developer.android.com/guide/topics/location/index.ht ml

- http://code.google.com/android/add-ons/google-apis/

- http://www.anddev.org/index.php

- http://itouchmap.com/latlong.html [For finding location

coordinates].

Ngày đăng: 22/04/2016, 10:06

TỪ KHÓA LIÊN QUAN

w