0

我试图创建一个非常简单的应用程序,我将用它来展示我和我的团队正在创建的产品。在我的应用程序中,我想允许一个选项,如果单击特定的文本视图,它将打开到该特定位置的地图。在我看过的所有谷歌地图教程中,似乎使用地图的唯一方法是让你的类扩展 mapactivity 类。除了使我的应用程序成为基于地图的应用程序之外,还有什么方法可以使用这个简单的应用程序?在我的情况下,哪个版本的谷歌地图最适合使用。感谢大家的帮助。

4

1 回答 1

1

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:

Google Maps API V2

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?

于 2013-05-03T20:06:35.333 回答