SlideShare a Scribd company logo
1 of 19
12. Map
Oum Saokosal
Master of Engineering in Information Systems, South Korea
855-12-252-752
oum_saokosal@yahoo.com
Map
• Google owns Android, so it is obvious that
the map you're going to use in Android
app must be Google Map.
• However to use Google Map in your app
is not as easy as it should be.
Instruction how to make Map app:
1. Go to window menu -> Android SDK Manager
-> Download Google API (2.3.3 API 10)
2. Create AVD Targeting
Google API:
For this map app, you
need to create an AVD
targeting Google API. In
this case, please choose
API level 10 for 2.3.3.
3. Android Manifest: Add Google Maps Library
<application …>
<uses-library android:name="com.google.android.maps" />
<activity…>
...
</application>
4. Android Manifest: Add Internet Permission
<manifest …>
<uses-sdk android:minSdkVersion="10" />
<uses-permission
android:name="android.permission.INTERNET"/>
...
...
</manifest>
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kosalab"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:label="@string/app_name"
android:name=".GoogleMapActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
5. main.xml: replace with this codes
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mymap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="Enter Your API Key"
/>
6. Getting API Key:
6.1. Go to a website, http://code.google.com/android/add-
ons/google-apis
6.2. Click on Maps API Key Signup
6.3. Enter your MD5 fingerprint. (Scroll down a bit)
6.4. To get MD5 fingerprint
6.4.1. In Eclipse, go to Window -> Preferences -> Android ->
Build -> Default debug keystore -> Copy the path
6.4.2. In Windows Explorer, go to Java installed
folder, e.g. c:Program Files (x86)Java -> jre6 ->
bin -> keystore.exe
• 6.4.3. After you found out keystore.exe, open
cmd, and then go to folder where keystore
located.
• 6.4.4. Type a command line
keytool -list -alias androiddebugkey -keystore
"C:Userskosal.androiddebug.keystore" -storepass
android -keypass android
-> Copy the PrivateKey
• 6.4.5. Paste the PrivateKey into MD5 Fingerprint
in the website -> Click "Generate API Key"
6.4.6. Finally, you will get your API key:
7. Enter the API key into main.xml.
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mymap"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="eNtEr_y0uR_Ap1_kEy_HeRe"
/>
8. In Java, you must extends MapActivity instead of Activity:
package com.kosalab;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class GoogleMapActivity extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mymap);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
• Run the App with the AVD targeting Google API
You know what, you have
reached the end of this course!
Thank You Very Much
Good Luck!
From Prof. Oum Saokosal
On Feb 1, 2012

More Related Content

What's hot

android architecture
android architectureandroid architecture
android architecture
Aashita Gupta
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 
JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES
Aditya Shah
 

What's hot (20)

Google Maps API for Android
Google Maps API for AndroidGoogle Maps API for Android
Google Maps API for Android
 
android architecture
android architectureandroid architecture
android architecture
 
Introduction to kotlin
Introduction to kotlinIntroduction to kotlin
Introduction to kotlin
 
Android with kotlin course
Android with kotlin courseAndroid with kotlin course
Android with kotlin course
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptx
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
 
Flutter Festivals GDSC ASEB | Introduction to Dart
Flutter Festivals GDSC ASEB | Introduction to DartFlutter Festivals GDSC ASEB | Introduction to Dart
Flutter Festivals GDSC ASEB | Introduction to Dart
 
CI CD Jenkins for Swift Deployment
CI CD Jenkins for Swift DeploymentCI CD Jenkins for Swift Deployment
CI CD Jenkins for Swift Deployment
 
Cross platform mobile development
Cross platform mobile developmentCross platform mobile development
Cross platform mobile development
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
Java programming lab manual
Java programming lab manualJava programming lab manual
Java programming lab manual
 
JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES JAVA AND MYSQL QUERIES
JAVA AND MYSQL QUERIES
 
Chat Application
Chat ApplicationChat Application
Chat Application
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 

Viewers also liked

Google Map Presentation Final
Google Map Presentation FinalGoogle Map Presentation Final
Google Map Presentation Final
Frances O'Neill
 

Viewers also liked (20)

Intro To Google Maps
Intro To Google MapsIntro To Google Maps
Intro To Google Maps
 
How to Get Benefit from Google Maps
How to Get Benefit from Google MapsHow to Get Benefit from Google Maps
How to Get Benefit from Google Maps
 
Google Map Presentation Final
Google Map Presentation FinalGoogle Map Presentation Final
Google Map Presentation Final
 
07.4. Android Basic Simple Browser (WebView)
07.4. Android Basic Simple Browser (WebView)07.4. Android Basic Simple Browser (WebView)
07.4. Android Basic Simple Browser (WebView)
 
10.1. Android Audio
10.1. Android Audio10.1. Android Audio
10.1. Android Audio
 
07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto Complete07.3. Android Alert message, List, Dropdown, and Auto Complete
07.3. Android Alert message, List, Dropdown, and Auto Complete
 
11.1 Android with HTML
11.1 Android with HTML11.1 Android with HTML
11.1 Android with HTML
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and Container
 
10.3 Android Video
10.3 Android Video10.3 Android Video
10.3 Android Video
 
04. Review OOP with Java
04. Review OOP with Java04. Review OOP with Java
04. Review OOP with Java
 
Using intents in android
Using intents in androidUsing intents in android
Using intents in android
 
08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)08.1. Android How to Use Intent (explicit)
08.1. Android How to Use Intent (explicit)
 
Java Programming - Polymorphism
Java Programming - PolymorphismJava Programming - Polymorphism
Java Programming - Polymorphism
 
Objected-Oriented Programming with Java
Objected-Oriented Programming with JavaObjected-Oriented Programming with Java
Objected-Oriented Programming with Java
 
Android Studio - Tips, Tricks & little known features
Android Studio - Tips, Tricks & little known features Android Studio - Tips, Tricks & little known features
Android Studio - Tips, Tricks & little known features
 
INSTALACIÓN ANDROID STUDIO 1
INSTALACIÓN ANDROID STUDIO 1INSTALACIÓN ANDROID STUDIO 1
INSTALACIÓN ANDROID STUDIO 1
 
07.1. Android Even Handling
07.1. Android Even Handling07.1. Android Even Handling
07.1. Android Even Handling
 
10.2 Android Audio with SD Card
10.2 Android Audio with SD Card10.2 Android Audio with SD Card
10.2 Android Audio with SD Card
 
Java Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract ClassJava Programming - Introduction to Abstract Class
Java Programming - Introduction to Abstract Class
 
Java Programming - Inheritance
Java Programming - InheritanceJava Programming - Inheritance
Java Programming - Inheritance
 

Similar to 12. Android Basic Google Map

Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial ppt
Rehna Renu
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdk
Tran Le Hoan
 

Similar to 12. Android Basic Google Map (20)

Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial ppt
Android tutorial pptAndroid tutorial ppt
Android tutorial ppt
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Android tutorial1
Android tutorial1Android tutorial1
Android tutorial1
 
Android development beginners faq
Android development  beginners faqAndroid development  beginners faq
Android development beginners faq
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Android studio
Android studioAndroid studio
Android studio
 
Android
Android Android
Android
 
Android chapter02-setup1-sdk
Android chapter02-setup1-sdkAndroid chapter02-setup1-sdk
Android chapter02-setup1-sdk
 
Android Development Primer - GDG Los Angeles
Android Development Primer - GDG Los AngelesAndroid Development Primer - GDG Los Angeles
Android Development Primer - GDG Los Angeles
 
APPIUM
APPIUMAPPIUM
APPIUM
 
android level 3
android level 3android level 3
android level 3
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
 
Android Programing Course Material Labs
Android Programing Course Material LabsAndroid Programing Course Material Labs
Android Programing Course Material Labs
 

More from Oum Saokosal

More from Oum Saokosal (10)

Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Database Concept - ERD Mapping to MS Access
Database Concept - ERD Mapping to MS AccessDatabase Concept - ERD Mapping to MS Access
Database Concept - ERD Mapping to MS Access
 
Java Programming - Abstract Class and Interface
Java Programming - Abstract Class and InterfaceJava Programming - Abstract Class and Interface
Java Programming - Abstract Class and Interface
 
09.1. Android - Local Database (Sqlite)
09.1. Android - Local Database (Sqlite)09.1. Android - Local Database (Sqlite)
09.1. Android - Local Database (Sqlite)
 
More on Application Structure
More on Application StructureMore on Application Structure
More on Application Structure
 
Basic Understanding of Android XML
Basic Understanding of Android XMLBasic Understanding of Android XML
Basic Understanding of Android XML
 
02.1 - Getting Started with Android
02.1 - Getting Started with Android02.1 - Getting Started with Android
02.1 - Getting Started with Android
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
 
Android - Introduction
Android - IntroductionAndroid - Introduction
Android - Introduction
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 

Recently uploaded (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

12. Android Basic Google Map

  • 1. 12. Map Oum Saokosal Master of Engineering in Information Systems, South Korea 855-12-252-752 oum_saokosal@yahoo.com
  • 2. Map • Google owns Android, so it is obvious that the map you're going to use in Android app must be Google Map. • However to use Google Map in your app is not as easy as it should be.
  • 3. Instruction how to make Map app: 1. Go to window menu -> Android SDK Manager -> Download Google API (2.3.3 API 10)
  • 4. 2. Create AVD Targeting Google API: For this map app, you need to create an AVD targeting Google API. In this case, please choose API level 10 for 2.3.3.
  • 5. 3. Android Manifest: Add Google Maps Library <application …> <uses-library android:name="com.google.android.maps" /> <activity…> ... </application> 4. Android Manifest: Add Internet Permission <manifest …> <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.INTERNET"/> ... ... </manifest>
  • 6. AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.kosalab" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.INTERNET"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <uses-library android:name="com.google.android.maps" /> <activity android:label="@string/app_name" android:name=".GoogleMapActivity" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
  • 7. 5. main.xml: replace with this codes <?xml version="1.0" encoding="utf-8"?> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mymap" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="Enter Your API Key" />
  • 8. 6. Getting API Key: 6.1. Go to a website, http://code.google.com/android/add- ons/google-apis 6.2. Click on Maps API Key Signup
  • 9. 6.3. Enter your MD5 fingerprint. (Scroll down a bit)
  • 10. 6.4. To get MD5 fingerprint 6.4.1. In Eclipse, go to Window -> Preferences -> Android -> Build -> Default debug keystore -> Copy the path
  • 11. 6.4.2. In Windows Explorer, go to Java installed folder, e.g. c:Program Files (x86)Java -> jre6 -> bin -> keystore.exe
  • 12. • 6.4.3. After you found out keystore.exe, open cmd, and then go to folder where keystore located.
  • 13. • 6.4.4. Type a command line keytool -list -alias androiddebugkey -keystore "C:Userskosal.androiddebug.keystore" -storepass android -keypass android -> Copy the PrivateKey
  • 14. • 6.4.5. Paste the PrivateKey into MD5 Fingerprint in the website -> Click "Generate API Key"
  • 15. 6.4.6. Finally, you will get your API key:
  • 16. 7. Enter the API key into main.xml. <?xml version="1.0" encoding="utf-8"?> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mymap" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="eNtEr_y0uR_Ap1_kEy_HeRe" />
  • 17. 8. In Java, you must extends MapActivity instead of Activity: package com.kosalab; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; public class GoogleMapActivity extends MapActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MapView mapView = (MapView) findViewById(R.id.mymap); mapView.setBuiltInZoomControls(true); } @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } }
  • 18. • Run the App with the AVD targeting Google API
  • 19. You know what, you have reached the end of this course! Thank You Very Much Good Luck! From Prof. Oum Saokosal On Feb 1, 2012