Convert Android App that uses maps API V1 to Maps Android API V2

泪湿孤枕 提交于 2019-12-29 05:35:08

问题


I have an android app that uses the old Maps API, it's now deprecated!

What steps I should take to make my app works with the new API.

I'm using also Distance Matrix API and Google Directions API.

my code will work with it ?!


回答1:


You can take a look at this blog post I wrote on how to create a Map application using:

Google Map API V2 guide

Basically the changes you would have to make are

1. Replace the MapView object with a MapFragment or SupportMapFragment object (depending on the target SDK of your application)

2. In additin you will have to repalce the MapActivity with a normal Activity (if you use the MapFragment object) or the FragmentActivity (if you use the SupportMapFragment object).

3. You will have to change the permissions in the manifest file to new ones, that are described in the guide.



来源:https://stackoverflow.com/questions/16079093/convert-android-app-that-uses-maps-api-v1-to-maps-android-api-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!