My app work good on android 4.x But android 2.2 I tried all solution from GCM SERVICE_NOT_AVAILABLE on Android 2.2 but still get "SERVICE_NOT_AVAILABLE" Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) }
protected Void doInBackground(Void... params) {
final long timeSleep = 1000;
int count = 0;
while (count < 2) {
try {
count++;
GoogleCloudMessaging gcm = GoogleCloudMessaging
.getInstance(Context);
regid = gcm.register(Constant.SENDER_ID);
return null;
} catch (IOException e) {
e.printStackTrace();
}
try {
Log.w(TAG, "Registration failed. Retrying in " + timeSleep + " ms.");
Thread.sleep(timeSleep);
} catch (InterruptedException e) {
}
}
return null;
}
Does anyone have idea about this?