Android App Google Play Services Battery Drain - android

When using Google Play services API for location and In App Billing request, does the associated Battery/CPU/Wifi/Network usage show up under battery stats under Google Play Services or under the App's Name ?
To my experience OS always shows usage under the associated app's name.
However I have a user claiming that my app causes Google Play Services battery drain with 8-10% on his Nexus 6P when my app does not even show up on his battery stats at all.
Is this somehow possible ?

Related

Getting App won't run without google play service which are not supported by your device only for china region

I am using location API to get the user location access in my application. It is working as expected in all the countries, but in china region it is giving following error:
"AppName won't run without google play service which are not supported by your device" only for china region
I have checked for the solution of above error and I got to know that this happens if google play services are not supported then this message comes, The problem is in china google play services itself is not supported in all the devices(No google play store, no google play service)
Is their any way to run google API to get location in china? If yes please help, if no then what is alternate solution to get the user location access in china.
You need to create a new emulator that supports Google Play Store.

Can't connect to google play service

I had an android application working fine in all average smartphones, but only one client is using a custom phone from Huawei, he received this error Can't connect to google play service, and also Google Maps not working, so my question there's any way programmatically to send a request to download the missed google play service ?
You can't install Google Play Services like a normal application, since it isn't a normal application. It's actually at least 3.
It needs to be a system app (ie in /system/priv-app/) to work, and relies on certain other frameworks that can't simply be installed.
If this user is rooted, tell them to flash Google Play Services from something like OpenGApps or MicroG. Otherwise, if you need people without Google Services to use your app, you need to find another maps API that isn't from Google.

limitation on FusedLocationProviderApi Android

My app is using android.location.LocationManager to get network and gps locaitions. Due to high battery consumption. I decided to switch to FusedLocationProviderApi. I'm worried about the impact on current users. Since this api requires google play service. is there any statistics on what percentage of android devices have google play service installed? is there any other things to consider that might cause current users unable to use the app after switch?
If the user is able to access play store , the google play services are installed.
below is the play services description from play store
'Google Play services is used to update Google apps and apps from Google Play. This component provides core functionality like authentication to your Google services, synchronized contacts, access to all the latest user privacy settings, and higher quality, lower-powered location based services. Google Play services also enhances your app experience. It speeds up offline searches, provides more immersive maps, and improves gaming experiences. Apps may not work if you uninstall Google Play services.'
https://android.stackexchange.com/questions/97145/get-rid-of-google-play-services
https://android.stackexchange.com/questions/104842/is-it-safe-to-uninstall-google-play-services-app

Geofence is not triggering without wifi

With the help of link1 and link2, I've successfully created poc for geofencing. Everything was fine with/without wifi(GPS is always enabled on app launch) untill one day I found "unfortunately google play services has stopped".
So I tried to force stop, clear cache and also now clear data of Google Play Services. Then after geofence is not triggering without wifi. I've also tried increasing radius up to 1000m, but no success. Location is the very same building of my office and yes I've also tried with going out in open sky.
And now twist is that a very same implementation is working on other devices. So I'm very sure that it has to do with force stop of google play services. Solution I want is to restart the google play services or is there any other reason behind this.
Device : Samsung Galaxy Grand Quattro(GT-I8552)
Andriod Version : 4.1.2
Google Play Services : 7.5.74(1997312-034)
Google Play Store : 5.6.8
You shouldn't have cleared the data of Google Play Services as registered geofences are kept in the com.google.process.location process owned by the com.google.android.gms package. Now your app must re-register geofences. Please remember that the system restores geofences even if the Google Play Services is killed+restarted/upgraded but not if you clear its data. The same is also mentioned in the link1 that you referenced under the section "Re-register geofences only when required"

Google Play Services availability and Google Play

We developed an application that uses the Google Play Services extension.
I assume that people without Google Play Services installed on their device side will not be able to use these services.
However if people does not have Google Play Services installed on their device, they probably cannot download it in the first place, because they dont have Google Play App itself.
So is it safe to assume that most people who install the app have Google Play Service installed and make a more general verification in our app for other rare cases?
For example, check if Google Play Services availability and if not installed, simply write a message and exit the app.
What is your opinion on that ?
Thanks
One of the things that can happen is that Google Play Services is present on the device, but not up to date. Or the user could have disabled Google Play Services. In both these cases connection to Google Play Services will fail, so you really have to check for it, no excuses :)
The answer can be found on Android's developers website
Important: Because it is hard to anticipate the state of each device, you must always check for a compatible Google Play services APK before you access Google Play services features. For many apps, the best time to check is during the onResume() method of the main activity.

Categories

Resources