Is deprecated gcm reliable to use now and when probably will be down?I mean gcm which has no depency on google play service(gcm.jar-GCMRegistar version). I tested latest gcm version and found out that the bulit apk is more than 2.0 mb size ,which is very bigger than old gcm.jar. Furthermore the old gcm does not need google play service and some older devices has not installed google play service,so the old gcm can run on more devices. Here is the gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.mygcm"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:8.4.0'
}
Although the old
GCMRegistrar
API will still be supported, you should definitely change to the new GCM API. The newInstanceId
API has many advantages and improvements comparing to the old one and works very well (I tested it in production for months).https://developers.google.com/instance-id/#key_features
And here is the very interesting part from the server side:
https://developers.google.com/instance-id/reference/server#get_information_about_app_instances
About the library size and as @Arthur pointed out you should just use what you need from the Play Services library. Here you have the list of individual libraries you can refer from gradle instead the whole bundle.
When using the new gcm library you should include the individual dependency not the entire play-services library.
use:
instead of:
Same for other Play Services libraries eg: play-services-drive