SlideShare a Scribd company logo
1 of 29
Download to read offline
Android
GoogleMap V2
資管系研⼀一 鍾聖彥 TA
指導⽼老師 余仁朋 博⼠士
Agenda
•

Features

•

Showcase

•

How to begin
and develop?

•

Q&A
Google Map V2 Features
•

3D Rendering

•

Draw on the Map

•

•
•

•
•

Customize markers and info windows,
or add polylines and polygons.

Vector Tiles
Faster Loading with fewer demands on
bandwidth.

Gesture Control
Intuitive tilt, rotate and zoom gesture
controls.

•

Indoor Floor Plans

•

Location Services
3
Showcases(1/3)
Showcases(2/3)
Showcases(3/3)

More…
How to Begin and Develop?
Answer is step by step.And learning example.
Downloading Google Play Services
Open Eclipse

Windows

Android SDK Manager
Importing Google Play Services into Eclipse
File

Import

Android

Existing Android Code Into Workspace

Windows os :android-sdk-windowsextrasgooglegoogle_play_serviceslibprojectgoogle-play-services_lib
Getting the Google Maps API key
Window

Preferences

Android

Build

We need to copy SHA1 fingerprint like this : C1:C8:C4:5F:15:82:BC:85:E2:5B:CA:F2:6F:C3:EF:02:01:A1:F2:F4
Now open
Google API Console
If you have no Google Account…please hurry to registry
Enabled Google Maps Android API v2
We need to copy SHA1 fingerprint like this : C1:C8:C4:5F:15:82:BC:85:E2:5B:CA:F2:6F:C3:EF:02:01:A1:F2:F4
New Project
We need to copy SHA1 fingerprint like this : C1:C8:C4:5F:15:82:BC:85:E2:5B:CA:F2:6F:C3:EF:02:01:A1:F2:F4
Registered apps
We need to copy SHA1 fingerprint like this : C1:C8:C4:5F:15:82:BC:85:E2:5B:CA:F2:6F:C3:EF:02:01:A1:F2:F4

Package Name要與專案package相同
⾛走上這條路都是為了它...
AIzaSyDacsY4MMgCfjc5A4IwLS6LQpz1ykIgzJk
Creating New Project

File

New

Android Application Project

We need to copy Map API Key like this : AIzaSyDacsY4MMgCfjc5A4IwLS6LQpz1ykIgzJk
Google Play Services project as a library to use project.

So right click on project and select properties.
We need to copy Map API Key like this : AIzaSyDacsY4MMgCfjc5A4IwLS6LQpz1ykIgzJk
Add the Map Key in the manifest file.
We need to copy Map API Key like this : AIzaSyDacsY4MMgCfjc5A4IwLS6LQpz1ykIgzJk

<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Google maps needs following permissions and features.
ACCESS_NETWORK_STATE
– To check network state whether data can be downloaded or not

INTERNET
– To check internet connection status

WRITE_EXTERNAL_STORAGE
– To write to external storage as google maps store map data in external storage

ACCESS_COARSE_LOCATION
– To determine user’s location using WiFi and mobile cell data

ACCESS_FINE_LOCATION
– To determine user’s location using GPS

OpenGL ES V2
– Required for Google Maps V2
GoogleMap Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</RelativeLayout>
Let’s Coding.
Placing a Marker
// latitude and longitude
double latitude = ;
double longitude = ;
 
// create marker
MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps ");
 
// adding marker
googleMap.addMarker(marker);
Changing Marker Color
// ROSE color icon
marker.icon(BitmapDescriptorFactory.defaultMarker(
BitmapDescriptorFactory.HUE_ROSE));
 
// GREEN color icon
marker.icon(BitmapDescriptorFactory.defaultMarker(
BitmapDescriptorFactory.HUE_GREEN));

!
Changing Marker Color
// ROSE color icon
marker.icon(BitmapDescriptorFactory.defaultMarker(
BitmapDescriptorFactory.HUE_ROSE));
 
// GREEN color icon
marker.icon(BitmapDescriptorFactory.defaultMarker(
BitmapDescriptorFactory.HUE_GREEN));

!
Custom Marker Icon
// latitude and longitude
double latitude = 17.385044;
double longitude = 78.486671;
 
// create marker
MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude,
longitude)).title("Hello Maps");
 
// Changing marker icon
marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.my_marker_icon)));
 
// adding marker
googleMap.addMarker(marker);
Moving Camera to a Location with
animation

CameraPosition cameraPosition = new CameraPosition.Builder().target(
                new LatLng(17.385044, 78.486671)).zoom(12).build();
 
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition
(cameraPosition));
Changing Map Type
googleMap.setMapType(GoogleMap.
MAP_TYPE_NORMAL);
googleMap.setMapType(GoogleMap.
MAP_TYPE_HYBRID);
googleMap.setMapType(GoogleMap.
MAP_TYPE_SATELLITE);
googleMap.setMapType(GoogleMap.
MAP_TYPE_TERRAIN);
googleMap.setMapType(GoogleMap.
MAP_TYPE_NONE);
Q&A
Reference
https://developers.google.com/maps/documentation/
android/
!

https://developers.google.com/maps/showcase/
!

http://www.androidhive.info/2013/08/android-workingwith-google-maps-v2/
!

http://blog.xuite.net/alenliu/test/66754055

More Related Content

Similar to Android google mapv2

Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Aaron Parecki
 

Similar to Android google mapv2 (20)

Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Introduction to Android - Mobile Portland
Introduction to Android - Mobile PortlandIntroduction to Android - Mobile Portland
Introduction to Android - Mobile Portland
 
Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)Big Data And HTML5 (DevCon TLV 2012)
Big Data And HTML5 (DevCon TLV 2012)
 
mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018mago3D FOSS4G NA 2018
mago3D FOSS4G NA 2018
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Simple stock market analysis
Simple stock market analysisSimple stock market analysis
Simple stock market analysis
 
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
Deep Dive into the ArcGIS Geotrigger Service - Esri DevSummit Dubai 2013
 
Rhomobile 5.5 Release Notes
Rhomobile 5.5 Release NotesRhomobile 5.5 Release Notes
Rhomobile 5.5 Release Notes
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Ky3618721875
Ky3618721875Ky3618721875
Ky3618721875
 
Android Wear: A Developer's Perspective
Android Wear: A Developer's PerspectiveAndroid Wear: A Developer's Perspective
Android Wear: A Developer's Perspective
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
 
Waleed cv gis[17]
Waleed cv gis[17]Waleed cv gis[17]
Waleed cv gis[17]
 
CartoView - Configure and Publish Apps for GeoNode
CartoView - Configure and Publish Apps for GeoNodeCartoView - Configure and Publish Apps for GeoNode
CartoView - Configure and Publish Apps for GeoNode
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
 
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
Why Deep Linking is the Next Big Thing: App Indexing - SMX East 2015
 
Offline maps for mobile developers (Android/iOS)
Offline maps for mobile developers (Android/iOS)Offline maps for mobile developers (Android/iOS)
Offline maps for mobile developers (Android/iOS)
 
Getting your app ready for android n
Getting your app ready for android nGetting your app ready for android n
Getting your app ready for android n
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
 

More from Department of Information Management Ming Chuan University, Taiwan (9)

Android googlemapv2 keyApplicance
Android googlemapv2 keyApplicanceAndroid googlemapv2 keyApplicance
Android googlemapv2 keyApplicance
 
Greedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithmGreedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithm
 
Dynamic programming lcs
Dynamic programming lcsDynamic programming lcs
Dynamic programming lcs
 
類神經網路
類神經網路類神經網路
類神經網路
 
Examining the impact of rich media on consumer willingness to pay in online ...
Examining the impact of rich media  on consumer willingness to pay in online ...Examining the impact of rich media  on consumer willingness to pay in online ...
Examining the impact of rich media on consumer willingness to pay in online ...
 
How online social ties and product-related risks influence purchase intention...
How online social ties and product-related risks influence purchase intention...How online social ties and product-related risks influence purchase intention...
How online social ties and product-related risks influence purchase intention...
 
No sql
No sqlNo sql
No sql
 
Page rank
Page rankPage rank
Page rank
 
Semantic web
Semantic webSemantic web
Semantic web
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Android google mapv2