Google Android API API v2 - The APIs associated with my location are deprecated. What for?

Starting with Google I / O 2013, we can read in several places the Google Maps Android v2 API documentation , which

This method / interface is deprecated.

use com.google.android.gms.location.LocationClient instead. LocationClient provides improved location and energy usage and is used by the blue dot “My Location”. See MyLocationDemoActivity in the folder with sample applications, for example sample code, or the Site Developer's Guide .

While it’s great that a new API has appeared, I cannot come up with any good reason to put @Deprecated on these methods.

They are indeed a very convenient way to access the location indicated by the blue dot.

One line

 Location location = map.getMyLocation(); 

in order to get my location and the size of the installation code that we need to write using the new Location API to achieve the same result, it says that they are not outdated.

From MyLocationDemoActivity (under ANDROID_SDK/extras/google/google_play_services/samples/maps/src/com/example/mapdemo/MyLocationDemoActivity.java ):

 // These settings are the same as the settings for the map. They will in fact give you updates at // the maximal rates currently possible. private static final LocationRequest REQUEST = LocationRequest.create() .setInterval(5000) // 5 seconds .setFastestInterval(16) // 16ms = 60fps .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); 

The comment states that these hard-coded values ​​are the same as on the map, but this may not be changed in the future.

So, after all the pros and cons are here , what could be the reason for refusing to depreciate these APIs? .

+3
android google-maps google-maps-android-api-2
source share
1 answer

Another point. If GoogleMap uses a LocationClient, but we don’t have access to its results, and we need to use a different LocationClient and a bunch of listeners, these are two LocationClients for the same task. A waste of resources.

+1
source share

All Articles