Im trying to create a very simple application that I will use to present a product that my team and I are creating. In my app, I would like to allow an option where if a specific textview is clicked, it will open up a map to that specific location. Of all the tutorials of the google maps that I have seen, it seems that the only way to use the maps is to have your class extend the mapactivity class. Is there any way to use this simple app other than to make my app a map based app? Also which version of the google maps would be the best to use in my situation. Thanks for everyone's help.
1 Answers
What do you mean by a "map based app"? if you want to embed Google Maps in your application, today you would use Google Map API V2 as V1 is deprecated. in that case you don't have to extend your Activity
from MapActivity
and you can use a simple Activity
if you targeting API > V11
. if you target lower API's you would extend you Activity
from FragmentActivity
to allow backward compatibility for Fragments.
Here is a blog post I wrote with all the details on how to embed Map capabilities in your application:
If on the other hand you would like to avoid embedding Google Maps in your application, you could just fire an intent to turn on the native Google Maps application.
UPDATE:
Take a look at this page for intents you can fire for native Google applications (including Maps):
http://developer.android.com/guide/appendix/g-app-intents.html
and look at this questions:
Launching Google Maps Directions via an intent on Android
Using the pre-installed Google Maps instead of an own activity by using Intents?
-
I looked at your tutorial, and i think its really amazing. Unfortunately i have a very limited amount of time... For the future i will definitely use it to learn about using maps and such... At the moment i just don't have that time. I think firing an intent to use the native google maps app is probably the best way to do this. If you have any useful information on that, it would be appreciated, but if not I will start researching how to do this. Thank you! – Jeremy Rowler May 03 '13 at 20:21