Map Marker Example In Android

Map Marker Example in Android

This example show you how to draw movable marker on to map. You can darg and drop the marker to change its position. Can be used in any application where u want to take input from user for map location.


1.) Create a new project by File-> New -> Android Project name it MapMarkerExample.
2.) You will see some default code into your main.xml and android manifest file.
3.) Add internet permission to your manifest file or write following in android.manifest file:




4.) Write following into main.xml file:




5.) CreateYour own map API key and replace it in above main.xml.
6.) Add any marker image or push pin image in drawable folder.
7.) Run for output.


1.) Create a project named MapMarkerExample and set the information as stated in the image.

Build Target: Android 2.1 (Google API)
Application Name: MapMarkerExample
Package Name: com.example.mapmarker
Activity Name: MapMarkerActivity
Min SDK Version: 7

2.) Open file and write following code there:




3.) Compile and build the project.
4.) Move the marker shown on the map with the help of mouse for results shown below.


Comments 8

Leave a Reply

Your email address will not be published. Required fields are marked *