转换使用的地图API V1到地图Android的API V2 Android应用程序地图、应用程序、API、Android

2023-09-04 23:28:23 作者:我没啥特长就特长

我有一个Android应用程序,使用旧的地图API,它现在去precated!

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

哪些步骤我应该采取使我的应用程序可与新的API。

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

我使用的也是距离矩阵API和谷歌路线API。

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

我的code将工作呢?!

my code will work with it ?!

推荐答案

您可以看看这篇博客我写了关于如何创建使用地图应用程序:

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

谷歌地图API V2指南

基本上你将不得不作出的改变是

Basically the changes you would have to make are

1 与 MapFragment 或 SupportMapFragment 对象(根据目标SDK 应用程序)

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

2 在additin你将不得不repalce的 MapActivity 与正常活动(如果你使用 MapFragment 对象)或 FragmentActivity (如果你使用 SupportMapFragment )对象。

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。您将不得不更改清单文件,以新的,这是在指南中所述的权限。

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

 
精彩推荐
图片推荐