I want to implement the new Google Play location services api in my app, but my app must run on older phones as well, even the ones with limited space and without the play services installed. How can I set up a fallback if the GPLS is not installed? I tried moving the location listener over to another class, but that wouldn't work. I hope some of you can help me.
Thanks,
You could always use a support library that supports backward compatibility. And if that fails, you can always fall back on the framework APIs. In your case, that would be Location APIs
HTH
Related
I was trying to debloat my system from all Google Apps, including Play Services...but I noticed something wrong about position.
Almost all gps/navigation apps use the location provided by play services, and without it, they aren't locking the position (of course).
Is there any workaround about this? And why apps do not use the so cool location Manager? It's kinda frustrating.
The reason is how Google manages Android. They do make the manual pages so they can say whatever in them to throw you to their fishing net. For example see the huge note in top of Location and Maps manual.
Note: This is a guide to the Android framework location APIs in the
package android.location. The Google Location Services API, part of
Google Play Services, provides a more powerful, high-level framework
that automates tasks such as location provider choice and power
management. Location Services also provides new features such as
activity detection that aren't available in the framework API.
Developers who are using the framework API, as well as developers who
are just now adding location-awareness to their apps, should strongly
consider using the Location Services API.
To learn more about the Location Services API, see Google Location
Services for Android.
As you can see, the developers are directed to NOT use Android framework APIs. But why you think Google does not develop Android instead? Because using Google APIs will tie you to Google so you can't live without it. It is a way of creating addiction.
In addition, this also helps Google to collect location information every time your app requests location. So basically Google feeds on your apps location data like a leech.
Google really balanced Android in a way that other companies can use the OS. But the OS will be useless unless you install Google services. It is somewhat evil perhaps (but who will notice that right?), but a win/win scenario, for Google that is.
To answer your question, no the app's which were coded to use Google API services can not function without it.
I'm building a simple android app that uses Google maps api to display map and navigation. As you may know Google maps need Play services Library to run on client android phone. i want my app to run in much older android OS's(14,15,..)
Problems:
1- Clients need to install or activate Play services app.
2- then Clients have to update play services app to the latest version to use my app with google maps.
3- how to make app to run in older androids? just by specifying min sdk ?
so in order to solve first and third problem i've no idea but for the second one :
building project with older Play service dependencies may help but i dont know how to do this or even it helps or not.
it'll appreciate if guys offer any solutions !
Thank you all.
What are the recommended practices for maintaining the widest backwards compatibility of an Android app while depending on Google Play Services?
Here are the pointers I was able to aggregate concerning backwards compatibility, including those that use Google Play Services.
The Google Maps Android API uses OpenGL ES version 2 to render the map. The least Android API version that has support for this is API 8 or Android 2.2 .
Compile against the oldest version of Google Play Services that contains the APIs that you need. As further discussed in this thread, refrain from using wildcards like 5.+ because that updates to the latest play services. Instead use a widely used version like com.google.android.gms:play-services:5.0.89.
Use the V4 support library to verify and request permissions.
com.android.support:support-v4:23.0.1
You might also check some additional insight from this SO thread.
I have the legacy application which actively use "com.google.android.gms.location.LocationClient" but in the new GooglePlayServices version there is no such class!! https://developer.android.com/google/play-services/index.html "...If you were previously using LocationClient, call the APIs in the com.google.android.gms.location package instead..." said there.
As I understand there is no option to force an old version of Google Play Services with custom application on the device, am I wrong?
Does it mean that I should rewrite some portion of application?
Is there any method to run app with old version of Google Play Services library on the device?
All Google Play Services are backward compatible - as long as you compile with Google Play Services 6.1 or below, you can continue to use LocationClient.
However, that does mean you will not get any of the new APIs, performance improvements, or other features available only in the newer versions of Google Play services so you should definitely consider moving over to the new API as soon as possible.
The latest update to the Google Play Services Library of the Android SDK removed the LocationClient class from it. How can i downgrade to the previous version so i won't have to rewrite the code to retrieve a client's location?
I do intend to change the code to use the new LocationApi later, but for now, i need a quick fix.
Go to settings>apps>all and find Google Play Services. Tap it, then tap 'disable' or whatever it is. Then tap on the 'uninstall updates'. After you've installed your version of the services, remember to tap the button 'Take to use' or whatever is displayed.
I found this site here which has links to mirrors of Android SDK Extras by Google. I downloaded google play services SDK r21 from there and am currently using it.
http://venomvendor.blogspot.com/2012/03/android-sdk-extras-by-google-inc.html
Hope this helps someone.
I want to use a google map to display a persons information only if he wishes to. Otherwise he will be on another screen doing something else but the map updates automatically even when he is not looking at the map?
And also i want the application to run on all versions of android rather than only a phone which has specific google api's . If i create an application using the third party google add-on, will it also run on a normal device with say like android 2.2 or 2.3.3 version?
The first thing sounds, like you want to update the map in the background, while your user is not on the MapActivity. To do so, you can use a Service.
When using the Google APIs, they have to be installed on the targeted device. From the documentation:
The <uses-library> reference is required, because it enables the
build tools to link your application against the Maps external
library. It also ensures that the Android system will not install
your application on a device unless the required library is
available.