Is it necessary include Google Play Servicies in apk? - android

I am afraid with that. Is it necessary to include Google Play Services with our apk? If it were an external library the response is YES. But in this case, Android forces us to download latest Google Play Services version, so the code must be in the device...
The problem that I see is that every app with this library will use the same code that can have the device, thus saving space.
Practical case: I had an application with admob which is 800KB. Now, using Google Play Services is 2.8MB.
Could someone explain me that?
Thank you!

Firstly you don't need to include it in your apk - you can pretty much assume it's on the phone and up to date. The increase in size means that you are including it in your apk. To exclude it from the apk delete it from your libs folder.
If you get errors then you need to add it as a library to your app. You can do that by going into your project's properties then clicking on Android on the left and then in the bottom section add Google Play Services from your workspace as a library (that is on Eclipse).

Because most users have the latest version installed on their devices, you do not need to include the entire Play Services lib in your build. If they don't have it installed, or if they do not have the latest version then your code might not work correctly.
If the user has Google Play then they will get a dialog letting them know that their Google Play Services is out of date and needs updating. If they don't have Google Play then you can choose what to do, for example you can alert the user that the app will have a limited functionality. If your app can't run without Google Play Services and the user doesn't want to install/update Google Play Services then your app will not work properly. Using an outdated libs in your project might work however you would be using them at your own risk as they won't be updated.

Related

Google play, publishing app update, issue with 'Native platforms'

I've a hybrid app to which I've published updates in past. In current update, I've added native facebook login, which required adding facebook jar package under 'libs' folder.
Now, when I add my APK in PlayStore, everything is fine except that Native platforms is being shown striked out (as shown in image). When I compare it with previous version, it shows the same but not striked out. I'm afraid publishing the update would not result in it being available on any devices. Any insights?
See snapshot here
I use native code in my application. And for it Google Play detects supported architectures by checking lib\armeabi, lib\armeabi-v7a, lib\x86 and so on. Can you check is that folders created into your APK?

How can i use older version of google play services?

I'm using Google Cloud messaging through google play services. The things is it only works on the devices with last version of play services installed, in remaining devices i need to show a dialog to send user to google play to install new version witch i really don't want to do!
So how can i avoid this?! I'm trying to use an older version of play services (lets say from 2 years ago) to insure majority of my users don't need to update but it seems impossible with grade and android sdk since it already deleted older versions! So what should i do? Is there any way to use older versions?! and if do find a way to use an older version are newer versions compatible with older one?
I don't want to force my users to update because
GCM it's not essential to my app although i like to have it!
It's over 30 MB witch is a lot in third world countries were my users are.
Google play blocks some of my users from accessing google play due to international lows! and i have to do update manually my self!
There is a solution for android studio:
1.Close your project
2.Browse to the folder where your projects has been saved
3.Go to folder 'app' and open the file 'build.gradle'
find this line :
compile 'com.google.android.gms:play-services:7.3.0'
and change the version (here 7.3.0) to an older one (like 6.5.87).
You can find out available versions by looking at sdk/extras/google/m2repository/com/google/android/gms/play-services
5.open the project again
Unfortunately Google Cloud Messaging was only added to the Play Services API in version 7.5, which was released end of May 2015 (see this Android Developers Blog post).
So, if you manage to find a copy of the v7.5 API (see my question regarding that here) or if the suggestion above by #Babak is safe (still investigating that one... and you can only go down to 7.5.0 before you lose GCM support), you might be able to gain a few months, but it will likely not make a huge difference...
Actually, I just noticed that your question was also posted end of May... So you probably won't be able to gain anything. But you may reduce support of you move to a new API version later!

apk size bloats when switched from admob standalone SDK to google play services SDK

With Admob SDK my apk size is 230Kb.
When replaced Admob SDK with google play services SDK it is 1.5MB(More than 6 times bloat).
I guess full 'google play services client SDK' becomes part of my app and hence the bloat.
How to only include 'Ads' component alone from 'google play services client SDK'?
Thanks
I didn't wanted to change the standalone Admob SDK for the Google Play Services for the same reason. My apk almost tripled it size with the new library. But with Admob deprecating the old SDK, it's time to start using it.
As CommosnWare mentioned, the number of resources that comes with the library is a problem. I decompiled my apk, and found out that there were a lot of images for G+ related things. As in this particular app I only use the Admob capabilities, I decided to override those images, and doing that the apk reduced its size 292Kb.
To override those resources, I created empty images and put them on my app's drawable folders with the same exact names. Android studio use those resources instead of the library ones.
If you want you can download the resources I used from here: http://goo.gl/loIf2l
I haven't use this on production yet, and I don't know if this could be against Google Play Services TOS. But it's the only way I've found to reduce the size of the app after adding Google Play Services. I hope they provide a better solution soon.
I had the same problem like you. I imported its jar file instead of libproject and used proguard to filter only classes from com.google.android.gms.ads.** and it turned out fine. The apk file was 100KB more than using standalone Admob SDK. But I don't know if it worked on any cases.
The ads client is now compartmentalized into play-services-ads. Even better, you can now use dependency com.google.android.gms:play-services-ads-lite, which is a smaller library. It added 'only' about 4k method references to my optimized APK. https://admob.googleblog.com/2016/07/keep-your-android-apps-nimble-with.html

Android app deployment on over 100 devices

We have a fleet tracking Android app which is isntalled on around 100 mobiles.
Problem is to update each mobile whenever there is a patch release. And unfotunately we have not set auto-update.
Now we need to call each driver and follow the process of update from google play.
This is becoming very tedious as they have to go to google play, search the application and install/update it.
And the mobiles are located all over the country.
Before it was easy as Goolge play was giving an option to know the apps installed on each mobile.
Need your advice on how do we manage/automate this update issue.
Build an in-app push notification that there's a new version and have an easy link to Google Play from it. However, this does have a bootstrapping problem, and you will have to make everyone install the new version manually (as in you call them and ask them to do it) at least once. Still, this is your only viable option, as Google Play developer agreement prohibits pushing app updates through other channels.
If you have email or IM contact with the drivers, you can also send them a message there's a new version with the direct link to the Google Play. They will have to open it on their device, of course.
The link format should be market://details?id=com.mycompany.myapp, https://play.google.com/store/apps/details?id=com.mycompany.myapp, or http://market.android.com/details?id=id=com.mycompany.myapp. Either of these three in general should work, though some OEMs have messed up their devices configuration and prevent Google Play app from intercepting the http/https form properly.
You could check a text file located on a server or something like that and then lookup if the current instaleld version is the same as the server version. If not you could download the new apk and open it. As far as I know this is not allowed by Google Play so you must remove the app from google play

Pushing Latest Android Build to Devices

Is there a way or an app that allows me to push my latest android build to all devices that have it installed? My app is not in the Google Play market yet but would like my testers to not have to manually install every build I push.
Why don't you just use dropbox?
Install it where your developing the application then share the folder of available apks (releases) to the testers that also install dropbox on their phones. When an update occures (you move a file to the folder) they'll get an update notification, then they can go and install it right from dropbox.
I wrote an update library a while back, which you can find here. It allows you to update your app by maintaining the latest apk on a server, along with a text file with the latest version code.
The library is open source, so feel free to adapt it to your needs.
Here are some solutions you might find a few of these have forced updating and auto-updating.
Android Google Play Market - Beta Section
Appaloosa
App47
HockeyApp
You would have to build your own update mechanism into your application. It would need to periodically poll a server and ask if there was an update available. If so, it would need to download the update and trigger the installation of the update.
Maybe this is too much effort for this case.
For this need, I would definitely recommend TestFlight. It's free, iOS/Android compatible, and does everything expected when dealing with beta app deployment.

Categories

Resources