How update user's current location in google map - android

Hi Friends
I want to display user's current location in Google map and add marker of his location in the map and how can i Update their location in google map after every second ..???

myLocationOverlay = new MyLocationOverlay(this, mapView);
mapView.getOverlays().add(myLocationOverlay);
myLocationOverlay.enableMyLocation();
myLocationOverlay.runOnFirstFix(addfirststandort);

java file
public class MYGIRNE extends FragmentActivity {
GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mygirne);
SupportMapFragment fm = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
// Getting Map for the SupportMapFragment
map = fm.getMap();
if(map!=null){
// Enable MyLocation Button in the Map
map.setMyLocationEnabled(true);
LocationManager manager=(LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria=new Criteria();
String provider =manager.getBestProvider(criteria, true);
Location cloc=manager.getLastKnownLocation(provider);
double lat=0;
double lng =0;
lat =cloc.getLatitude();
lng= cloc.getLongitude();
LatLng latlng = new LatLng (lat,lng);
map.moveCamera(CameraUpdateFactory.newLatLng(latlng));
map.animateCamera(CameraUpdateFactory.zoomTo(15));
map.addMarker(new MarkerOptions()
.title("Your Current Location")
.position(latlng));
.icon(BitmapDescriptorFactory.defaultMarker(
BitmapDescriptorFactory.HUE_AZURE)));
}
}
xml file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.firsttry.cyptour.MYGIRNE" >
<fragment
android:id="#+id/map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
also include the following in your manifest file
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="enter your APIKEY" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
this code should be an element of application
then include this under the uses permission of your manifest file
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
i hope this helps

Related

The meta-data tag does not have right value in googlemap v2

i am trying to use Google Maps in my application using google play services. getting errors
"java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4323000 but found 5077000. You must have the following declaration within the element: "
but i was added it and no solution , what's wrong
MainActivity
public class MainActivity extends FragmentActivity implements OnClickListener,
android.location.LocationListener{
GoogleMap map;
Button bmap, bsatelite, bhybrid;
TextView header;
LatLng my_Position = new LatLng(0, 0);
LatLng my_prev_Position = new LatLng(0, 0);
double my_Latitude = 0;
double my_Longitude = 0;
LocationManager locationManager;
int location_findcounter = 0;
String provider = "";
Boolean Start;
static boolean placeshow = false;
HashMap<String, String> mMarkerPlaceLink = new HashMap<String, String>();
CheckBox chckboxanimatetomylocation;
Marker mark;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bmap = (Button) findViewById(R.id.btnMap);
// header = (TextView) findViewById(R.id.header);
bsatelite = (Button) findViewById(R.id.btnsatelite);
bhybrid = (Button) findViewById(R.id.btnhibrid);
chckboxanimatetomylocation=(CheckBox)findViewById(R.id.checkBoxanimatetomylocation);
bmap.setOnClickListener(this);
bsatelite.setOnClickListener(this);
bhybrid.setOnClickListener(this);
int status = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(getBaseContext());
if (status != ConnectionResult.SUCCESS) { // Google Play Services are
// not available
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this,
requestCode);
dialog.show();
} else {
//SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager()
// .findFragmentById(R.id.map);
// Getting Google Map
// map = fragment.getMap();
map.setOnMyLocationButtonClickListener(new OnMyLocationButtonClickListener() {
#Override
public boolean onMyLocationButtonClick() {
// TODO Auto-generated method stub
map.moveCamera(CameraUpdateFactory.newLatLng(my_Position));
map.animateCamera(CameraUpdateFactory.zoomTo(17));
return false;
}
});
}
if (map != null) {
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
bsatelite.setEnabled(true);
bsatelite.setTextColor(Color.BLACK);
bhybrid.setEnabled(true);
bhybrid.setTextColor(Color.BLACK);
map.setMyLocationEnabled(true);
Start = true;
// Getting LocationManager object from System Service
// LOCATION_SERVICE
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
// Creating a criteria object to retrieve provider
Criteria criteria = new Criteria();
// Getting the name of the best provider
provider = locationManager.getBestProvider(criteria, true);
// Getting Current Location From GPS
Location location = locationManager.getLastKnownLocation(provider);
if (location != null) {
onLocationChanged(location);
} else {
Toast.makeText(getApplicationContext(),
"Please make The GPS ON", Toast.LENGTH_LONG).show();
}
}
}
the main layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
tools:context="com.Dawarly.Main_activity" >
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/checkBoxanimatetomylocation"/>
</RelativeLayout>
the mainifist file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Walkwithme.View"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<permission
android:name="com.Walkwithme.View.MAPS_RECIEVE"
android:protectionLevel="signature" >
</permission>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCBv2SIJN6_sIqI_68iu8yYFnsRBDQVie4" />
<activity
android:name="MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="About"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:value="com.Walkwithme.View.MainActivity" >
<!-- Parent activity meta-data to support API level 7+ -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.Walkwithme.View.MainActivity" />
</activity>
</application>

Error inflating class fragment while trying to use Google Maps

I'm trying to run simple demo app of Google Maps. I've referred standard article.
But I'm getting Error inflating class fragment exception.
I've updated mt manifest properly. Registered for Map API key. Install google-play-services and linked it to my current project. Extended my activity from FragmentActivity, still it doesn't work.
Am I doing anything wrong?
I also referred Error inflating class fragment but to no avail.
Any help appreciated.
My code is as follows:
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
</RelativeLayout>
MainActivity.java
package com.android.googlemapsdemo;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
public class MainActivity extends FragmentActivity {
static final LatLng HAMBURG = new LatLng(53.558, 9.927);
static final LatLng KIEL = new LatLng(53.551, 9.993);
private GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
if (map != null) {
Marker hamburg = map.addMarker(new MarkerOptions()
.position(HAMBURG).title("Hamburg"));
Marker kiel = map.addMarker(new MarkerOptions()
.position(KIEL)
.title("Kiel")
.snippet("Kiel is cool")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.ic_launcher)));
// Move the camera instantly to hamburg with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));
// Zoom in, animating the camera.
map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
} else {
map = ((MapFragment) getFragmentManager()
.findFragmentById(R.id.map)).getMap();
if (map == null) {
Toast.makeText(MainActivity.this, "Unable to generate map",
Toast.LENGTH_SHORT).show();
}
}
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.googlemapsdemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<permission
android:name="com.android.googlemapsdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="com.android.googlemapsdemo.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.android.googlemapsdemo.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAT9_V5YI-7CMf_Yta0Y_zeDfPZeH5XFL0" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
Change this
<uses-sdk
android:minSdkVersion="11"
to
<uses-sdk
android:minSdkVersion="12"
If you have 11 you will be using SupportMapFragment. Consider this
https://developer.android.com/about/dashboards/index.html?utm_source=ausdroid.net
Looking at the link it is better to change to 12
Change this
public class MainActivity extends FragmentActivity
to
public class MainActivity extends Activity
Also getMap() can return null. Better check the availability of google map services.
You are also missing
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
in manifest file
https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
You can also remove
<permission
android:name="com.android.googlemapsdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
and this
<uses-permission android:name="com.android.googlemapsdemo.permission.MAPS_RECEIVE" />
I think you should change this
class="com.google.android.gms.maps.MapFragment"
to
class="com.google.android.gms.maps.SupportMapFragment"
Because your minsdk="11"
also change this
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
to
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();

Google Map is not rendering

I am using google map V2 to display marker for static latitude and longitude
but it gives me error
Caused by: java.lang.ClassNotFoundException:
com.example.gpstracker.GpsMapActivity in loader dalvik.system.PathClassLoader
GpsMapActivity class
public class GpsMapActivity extends FragmentActivity{
static final LatLng HAMBURG = new LatLng(53.558, 9.927);
static final LatLng KIEL = new LatLng(53.551, 9.993);
private GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gps_map);
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
/*if (map!=null){
Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
.title("Hamburg"));
Marker kiel = map.addMarker(new MarkerOptions()
.position(KIEL)
.title("Kiel")
.snippet("Kiel is cool")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.ic_launcher)));
}*/
map.setMyLocationEnabled(false);
map.moveCamera(CameraUpdateFactory.newLatLng(HAMBURG));
map.animateCamera(CameraUpdateFactory.zoomTo(15));
}
}
activity_gps_map
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".GpsMapActivity" >
<TextView
android:id="#+id/tv_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/tv_location"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gpstracker"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.gpstracker.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gpstracker.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.gpstracker.GpsMapActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Goolge API Key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA9hiBWVBm6U5VuKBAKyyz_niMTrj42wco" />
</application>
</manifest>

google map given error unfortunatley googlemap has stopped

I am design a Google map in android , I have add Google map service lib,layout
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"
/>
Main Activity is
public class MainActivity extends Activity {
private GoogleMap mMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
final LatLng CIU = new LatLng(35.21843892856462, 33.41662287712097);
Marker ciu = mMap.addMarker(new MarkerOptions().position(CIU).title("My Office"));
}
}
Manifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<permission
android:name="maping.amit.com.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="maping.amit.com.permission.MAPS_RECEIVE"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my keys are there ....."/>
Providing the link follow where you can get the map
and for marking your location you this code
// 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);

Highlight area in Google Maps v2

How can I highlight an area/region on Google Maps v2 Android? I also have a list of geopoints of that particular region. It needs to highlight that region when you scroll to that region. It needs to fill color for nearby region to differentiate from each other so each region should have a different color.
You need to draw a polygon by selecting some points on map. Here is the code.
MainActivity.java
public class MainActivity extends FragmentActivity implements
OnMapClickListener,
OnMapLongClickListener,
OnMarkerClickListener {
private GoogleMap myMap;
Location myLocation;
boolean markerClicked;
PolygonOptions polygonOptions;
Polygon polygon;
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentManager manager = getSupportFragmentManager();
SupportMapFragment mapFragment = (SupportMapFragment) manager
.findFragmentById(R.id.map);
myMap = mapFragment.getMap();
myMap.setMyLocationEnabled(true);
myMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
myMap.setOnMapClickListener(this);
myMap.setOnMapLongClickListener(this);
myMap.setOnMarkerClickListener(this);
markerClicked = false;
}
#Override
public void onMapLongClick(LatLng point)
{
myMap.addMarker(new MarkerOptions()
.position(point).title(point.toString()));
markerClicked = false;
}
#Override
public boolean onMarkerClick(Marker marker)
{
if(markerClicked)
{
if(polygon != null)
{
polygon.remove();
polygon = null;
}
polygonOptions.add(marker.getPosition());
polygonOptions.strokeColor(Color.BLACK);
polygonOptions.strokeWidth(5);
polygonOptions.fillColor(0x884d4d4d);
polygon = myMap.addPolygon(polygonOptions);
marker.remove();
}
else
{
if(polygon != null)
{
polygon.remove();
polygon = null;
}
polygonOptions = new PolygonOptions().add(marker.getPosition());
markerClicked = true;
marker.remove();
}
return true;
}
#Override
public void onMapClick(LatLng point)
{
Toast.makeText(getApplicationContext(),
"Long Press to select locations", Toast.LENGTH_LONG).show();
}
}
activity_main
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
manfiest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.polygononmap"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.example.googlemapwithsession.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="google.map.ver2.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.polygononmap.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your api key" />
</application>
</manifest>
now use long press to select points on map and click on marker will draw polygon accordingly.. I thing this will help.
http://www.youtube.com/watch?v=YEM90r9r9vI
for details https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polygon
You just draw a Polygon on your map and fill it with the color you need.

Categories

Resources