Opening a map with a certain point
I use the following code:
uri = "geo:"+lat+"开发者_如何转开发,"+lon;
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(intent);
My questions are: 1. I understand I need internet connection to use this? Is there a way to show offline Maps? 2. It opens the map with location, but without showing the point on the map. Anyway to add this with code?
The android documentation is good here: MapView
You will need an internet connection. The map data is massive and couldn't possibly be entirely cached on your phone. Don't forget to add the line in the manifest that says your application uses internet. Maybe there is a way to cache a small area if you know you will always be working with the same area, but I don't know of a way.
To show a point on the map look into "overlays" in the link I added.
Hope this helps.
精彩评论