I want to make application such that,when user opens application,it will show a google-map with current location.I was trying some tutorials but it's hard to understand or some what be complicated to understand.So please give me the sample code for this or suggest right way to do this.
Asked
Active
Viewed 1,211 times
-1
-
refer this link, http://android-er.blogspot.in/2009/11/display-marker-on-mapview-using.html – rajeshwaran Aug 07 '12 at 12:12
-
[Try this one](http://www.vogella.com/articles/AndroidLocationAPI/article.html#locationapi) – Praveenkumar Aug 07 '12 at 12:19
-
you mean "please write my code for me because I don't know how"? – Marcelo Aug 08 '12 at 14:06
-
@Marcelo: No Man u get wrong meaning,I wrote "sample code" means which give me basic idea about the way of doing app.And I also mention "Right way" not a "Code".ok...? – Rupesh Nerkar Aug 09 '12 at 06:38
-
try this http://findgpslocation.blogspot.in/ .. it ll show you how to get gps location with co-ordinates & shows map too. try it. try this link too.. in this you ll get how to capture the screen shot of an google map of location that you searched.. http://stackoverflow.com/questions/9905250/android-how-to-capture-a-image-of-gps-location – Rahul Baradia Aug 20 '12 at 05:42
1 Answers
0
You can use MyLocationOverlay. Code will look something like this:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Find the map view
mMapView = findViewById(R.id.map);
// Create an overlay and add to map view
mMyLocationOverlay = new MyLocationOverlay(this, mMapView);
mMapView.getOverlays().add(mMyLocationOverlay);
}
@Override
protected void onResume() {
super.onResume();
mMyLocationOverlay.enableMyLocation();
}
@Override
protected void onStop() {
mMyLocationOverlay.disableMyLocation();
super.onStop();
}

Frohnzie
- 3,559
- 1
- 21
- 24