Since the Google I/O 2013 we can read in several places of the documentation of Google Maps Android API v2 that
This method / interface is deprecated.
use com.google.android.gms.location.LocationClient instead. LocationClient provides improved location finding and power usage and is used by the "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder for example example code, or the Location Developer Guide.
While it is great the new API appeared, I can't think of any good reason to put @Deprecated
on these methods.
They are indeed a very convenient way of accessing location pointed to by the blue dot.
A single line
Location location = map.getMyLocation();
to retrieve my location vs the amount of setup code we need to write using the new Location API to achieve the same result speaks against having them deprecated.
From the 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 suggests that these hardcoded values are the same as in the map, but this may change in an undesirable way in future.
So after all the pros and cons are here, what could be the reason behind desision to deprecate these APIs?.