Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?!

like image 795
Mostafa El-Abady Avatar asked Dec 09 '22 16:12

Mostafa El-Abady


1 Answers

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.

like image 53
Emil Adz Avatar answered Feb 15 '23 09:02

Emil Adz