[android-developers] MapOverlay and displaying location as an address

2012-05-09 Thread chelsjo
I am beginning to learn how to develop Android applications and I have
created an app that currently brings up the user's current location on
Google Maps. However I would like to extend the app in two ways:

-I would like to add a MapOverlay, where it pin-points the location on
the Map, I understand I need to follow the Google Map View tutorial to
the Developer website to do this. However I am unsure what I need to
include to make the Overlay item point to the current location? What
do I need to include in the Activity?
-I would like the app to instead of bringing up the latitude and
longitude, to bring up the address of where the user currently is.

Many thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] MapOverlay and displaying location as an address

2012-05-09 Thread TreKing
On Wed, May 9, 2012 at 1:35 AM, chelsjo chelsea.jon...@gmail.com wrote:

 However I am unsure what I need to
 include to make the Overlay item point to the current location? What
 do I need to include in the Activity?


Look at MyLocationOverlay. This is exactly what it's for.


  -I would like the app to instead of bringing up the latitude and
 longitude, to bring up the address of where the user currently is.


Look at GeoCoder.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] MapOverlay and displaying location as an address

2012-05-09 Thread pedro242

For the Geocoder, here's a bunch of code you can use..

LocationManager locMgr = 
 (LocationManager)getSystemService(Context.LOCATION_SERVICE); 

Location lastLoc = locMgr
 .getLastKnownLocation(LocationManager.GPS_PROVIDER);

 ListAddress addressList;
 Geocoder geo = new Geocoder(getApplicationContext(), Locale.getDefault());
  try {
  addressList= geo.getFromLocation(lastLoc.getLatitude(), 
 lastLoc.getLongitude(), 
 1/*only one answer*/);
  if (null!=addressList) {
Address MyAddress = addressList.get(0);
   // do something with MyAddress
  }
  } 

 catch (IOException e) {  

 }


 
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en