Android : Is it necessary to include Google Play services to use GCM? - android

I have a library android project with size 200kb. Now I want to use GCM in it. To use GCM I have to include Google Play Services, which increases my project size by 1 MB making it to 1.2 MB which is kind of bad. Any work around for this?
Thanks in advance!

From the Google Play services version 6.5, you can selectively compile Google Play service APIs into your app.
To include GCM part only, use:
com.google.android.gms:play-services-gcm:7.8.0

I would recommend you to use google play service library either if it increase the size of your apk.
Please visit this link
Google Cloud Messaging for Android library vs. Google Play Services

Check the device to make sure it has the Google Play Services APK. If it doesn't, display a dialog that allows users to download the APK from the Google Play Store or enable it in the device's system settings.
It will save you memory in project.

Related

Difference between Google API intel x86 atom and Google Play intel x86 atom sytem image

While downloading Android 8.0 sdk platform using Android Studio, I see these two system images.
Google API intel x86 atom system image
Google Play intel x86 atom sytem image
What is the difference between these two?.
The play image has the Google Play store already installed and you can install apps, but there is no root access as it is a production build and not a debug build.
The main difference between Google API system image and Google Play system image basically lays on the capabilities of each one to access the Google Play Store directly or not.
Here is for more explanation regarding that matter.
Hope, could be a helped for the other.
"Google APIs" images include the Play services that many apps rely on but no Play Store app
"Google Play" images include both the Play Store app and the Play services
For Google's description, see Create and manage virtual devices | Android Developers
What all answers are missing: If you use the billing library from Google, you need the "Google Play image" for testing. This has nothing to do with installing apps, but you need the Play Store installed to test your "in-app" purchases and subscription products.
Otherwise you will get this error from BillingClient:
Billing service unavailable on device
Based on Documentation:
A system image labeled with Google APIs includes access to Google Play services. A system image labeled with the Google Play logo in the Play Store column includes the Google Play Store app and access to Google Play services, including a Google Play tab in the Extended controls dialog that provides a convenient button for updating Google Play services on the device.
To ensure app security and a consistent experience with physical devices, system images with the Google Play Store included are signed with a release key, which means that you cannot get elevated privileges (root) with these images. If you require elevated privileges (root) to aid with your app troubleshooting, you can use the Android Open Source Project (AOSP) system images that do not include Google apps or services.
I hope helped you.

Google play services and relation with android version

I will be developing an app that uses Google Vision API in order to scan barcode. I am successfully able to write and test the app. However, I found out that the API has to be supported for Android's ICS i.e. version 4 and above. I am using Google Play Services 8.4 version. Will I be able to use this app? I have just created a prototype of app only.
In short is there any relationship between google play services and android version? If yes where can I find it. Thanks.
you may refer to this link in order to know more regarding google play services and android versions. https://developers.google.com/android/guides/setup
Here is what I was looking for. I wanted to check if version 8.4 of google play services is available for android 2.3 or not.

How to implement google maps with best possible backward compatibility in an android?

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.

Update Google Play services for an old app

I have an old app which uses Google play services 5.08. Since the app uses kiosk mode, we never updated google play services on the device. Now I have to update the google play services to 8.4. I also want the already existing users to use the app without getting crashes. So how do I support both of 5.08 and 8.4 APIs to support in the app? I see Google doesn't expose the APIs of 5.08 when I use 8.4 in Gradle file.
Create a newer version of the app that will use the latest google play service(8.4). Retain the older version of the app for the current google play service(5.08).
The version of the Google Play Service will depend on the APIs your application implements. Supporting both google play service in an app will affect your application performance in a negative way or it is not applicable. Every update of Google Play service adds new APIs connected and older APIs improved. Consider the APIs your application will implement, then decide which version of google play services should your user update to have a smooth running application.
The Google Play services client
library
The client library contains the interfaces to the individual Google
services and allows you to obtain authorization from users to gain
access to these services with their credentials. It also contains APIs
that allow you to resolve any issues at runtime, such as a missing,
disabled, or out-of-date Google Play services APK. The client library
has a light footprint if you use
ProGuard as
part of your build process, so it won't have an adverse impact on your
app's file size.
If you want to access added features or products, you can upgrade to a
new version of the client library as they are released. However,
upgrading is not necessary if you don't care about new features or bug
fixes. We anticipate more Google services to be continuously added, so
be on the lookout for these updates.

Google api version v1 vs v2

I'm about to put my Android app, which uses google api v1 onto the market. I now see that v1 has been depreciated and that I am urged to use v2 instead. I see that v2 appears an order of magnitude more complex and that google play services are needed.
Since google play services are needed does that mean that my app will only be able to be distributed on google play and not, say, be distributed from my own web site?
thanks, Gary
Since google play services are needed does that mean that my app will
only be able to be distributed on google play
No, you can still distribute through any channel you want. It is a requirement for the device, not the distribution. The device your app installs on needs to have Google Play Services installed, which a number do. It is very similar to the v1 maps which required the phones have Google Maps installed, reflected in the manifest via
<uses-library android:name="com.google.android.maps">
Google likes to keep everybody using their own system as per usual. But it should still be possible to distribute via your website. You would need to save it as a .apk file.
Heres how to save as .apk file
and Heres a tutorial on how users can download and install.

Categories

Resources