Questions tagged [android-c2dm]

Google Cloud Messaging for Android (GCM) - service for sending messages from third-party server to device.

The service provides a simple, lightweight mechanism that servers can use to tell mobile applications to contact the server directly, to fetch updated application or user data. The GCM service handles all aspects of queueing of messages and delivery to the target application running on the target device.

Characteristics

  • It allows third-party application servers to send lightweight messages to their Android applications. The messaging service is not designed for sending a lot of user content via the messages. Rather, it should be used to tell the application that there is new data on the server, so that the application can fetch it.
  • GCM makes no guarantees about delivery or the order of messages. So, for example, while you might use this feature to tell an instant messaging application that the user has new messages, you probably would not use it to pass the actual messages.
  • An application on an Android device doesn’t need to be running to receive messages. The system will wake up the application via Intent broadcast when the message arrives, as long as the application is set up with the proper broadcast receiver and permissions.
  • It does not provide any built-in user interface or other handling for message data. GCM simply passes raw message data received straight to the application, which has full control of how to handle it. For example, the application might post a notification, display a custom user interface, or silently sync data.
  • It requires devices running Android 2.2 or higher that also have the Market application installed. However, you are not limited to deploying your applications through Market.
  • It uses an existing connection for Google services. This requires users to set up their Google account on their mobile devices.

Google provides official documentation for this.

699 questions
10
votes
5 answers

Registration confusion Android GCM

I am trying to migrate to GCM in Android, C2DM now being deprecated. The registration process described here is different from registration described here. Are both registration same? Can we see code for GCMRegistrar to know for sure?
Gaurav Agarwal
  • 18,754
  • 29
  • 105
  • 166
10
votes
4 answers

Not allowed to start service Intent X without permission Y

04-25 14:16:30.931: E/AndroidRuntime(6638): FATAL EXCEPTION: main 04-25 14:16:30.931: E/AndroidRuntime(6638): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity…
Li3ro
  • 1,837
  • 2
  • 27
  • 35
9
votes
1 answer

Some Queries on C2DM in Android

I am currently working on one android application which has C2DM implementation and I successfully implemented it. But Now I have problem in sending message to multiple devices. As per my understanding following will be process for it: Save reg id…
Sandip Jadhav
  • 7,377
  • 8
  • 44
  • 76
9
votes
5 answers

Android C2DM : Duplicate message to the same device and App

I'm wondering if anyone has faced this issue with Google C2DM? This is the scenario I am faced with: User installs the app and registers with C2DM server for a registration key. User uninstalls the app. User reinstalls the app (and registers with…
Anh Nguyen
  • 413
  • 4
  • 15
9
votes
1 answer

How can i get my registration ID device

What do I need to send a push notification for android (like iOS I need a device udid to send a simple push)? And if I need to get the registration id of my device how can i get it? Thank you.
abdel
  • 91
  • 1
  • 1
  • 5
8
votes
2 answers

starting an asynctask from a broadcast receiver

I want to know if starting up a asynctask from a broadcast receiver considered a bad practice? I basically registered with the C2DM server of google and then when I intercept the onregistered, broadcast receiver, I want to send it to my server.…
Hades
  • 3,916
  • 3
  • 34
  • 74
8
votes
2 answers

c2dm 401 error when sending messages after receiving id and auth token

I have seen many similiar questions but no good answer despite some of them being accepted. I have registered for C2DM. I received confirmation email. Then I wrote some simple app to register for C2DM. I get the id (tried on emulator and on real…
DixieFlatline
  • 7,895
  • 24
  • 95
  • 147
8
votes
2 answers

Android - Sending message to a handler on a dead thread, Toast error

I am using C2DM services and when I get message, I get also error of "Sending message to a handler on a dead thread" while displaying Toast message, where I want to see message, which arrived. Using code: @Override protected void onMessage(Context…
Waypoint
  • 17,283
  • 39
  • 116
  • 170
8
votes
2 answers

Best practices implementing C2DM registration

I'm developing an application that uses C2DM to receive push notifications. I've implemented the whole C2DM circuit (both client and server) and it's working fine. Currently my applicacion has a button to bootstrap the C2DM registration, when…
aromero
  • 25,681
  • 6
  • 57
  • 79
8
votes
2 answers

Google restricts FCM service based on IP Address, Is there any other free Android push notification provider?

I start to write down a simple push notification App using FCM For Android. But I got this message in my Android studio Log. signInWithCustomToken com.google.firebase.FirebaseException: An internal error has occurred. [ This service is not…
8
votes
1 answer

Android c2dm registration id format

I suspect I am going to feel really stupid after posting this but here goes. I have two main questions: 1) What is an appropriate regex to use for the registration id? Currently I have the following but I have not been able to find any docs to…
malonso
  • 2,247
  • 1
  • 21
  • 33
7
votes
2 answers

Unable to Deploy Android App Engine Project on Google App Engine

I am create one smile application in Android + Google App Engine in eclipse. i am trying to deploy that app on Google app Engine but it show the error message Log Cat : Unable to update: com.google.appengine.tools.admin.HttpIoException: Error…
Prashant Kadam
  • 1,207
  • 4
  • 18
  • 30
7
votes
2 answers

Sending push to multiple android devices with a single POST

I've implemented push notifications in my Android app and am trying to build out the server-side to make it more scalable. Looking at the documentation on how to construct the POST to send a push, it seems I need to send a POST for every single…
Sam Dozor
  • 40,335
  • 6
  • 42
  • 42
7
votes
3 answers

Why do I get multiple active Tokens for my Device with Googles Cloud To Device Messaging Service?

I just added C2DM capability to my Android App. At the moment the following happens if C2DM is started in my App. My App sends the registration Intent The answer broadcast is received by my app The device token is retrieved from the intent and…
Janusz
  • 187,060
  • 113
  • 301
  • 369
7
votes
1 answer

"C2D_message is not unique" while trying to make sign apk

I'm trying to release an APK and while I'm trying to Generate sign APK I get this error Error:Error: Permission name C2D_MESSAGE is not unique (appears in both com.company.myApp.permission.C2D_MESSAGE and com.company.myApp2.permission.C2D_MESSAGE)…
Amir Ebrahimi
  • 547
  • 1
  • 7
  • 22
1 2
3
46 47