Posts

Showing posts with the label c2dm

Third Party Applcation Server

Image
The Third Party Server is *your* server and can actually be any process written in any language (for example, it can be a batch process or a cron script). The role of the 3rd party "server" is to send the message to the device. The Server will store (or update) the registrationID received into its local database. So, eventually the server will have registrationIDs from the devices. Your server needs to get a ClientLogin Auth token in order to talk to the C2DM servers. When it wants to push a message to the device. For ClientLogin Auth_Token:  Click Here To send a message to a particular device, the Server needs to POST to the C2DM Service the following 4 things:  The accountName which will be arxxus.pushapp@gmail.com . An authentication Token. The registrationID of the device it wants to send the message.  The message itself (Message limit 1024 Bytes) Code: // Create a new HttpClient and Post Header  HttpClient httpclient = new DefaultHttpClient()...

ClientLogin for Installed Applications for C2DM - Tutorial

Image
Before you can write client applications that use the C2DM feature, you must have an HTTPS application server that meets the following criteria:Able to communicate with your client. Able to fire off HTTP requests to the C2DM serve r. Able to handle requests and queue data as needed. For example, it should be able to perform   exponential back off.  Able to store the ClientLogin Auth token and client registration IDs. The ClientLogin Auth token is included in the header of POST requests that send messages. For more discussion of this topic, see  ClientLogin for Installed Applications . The server should store the token and have a policy to refresh it periodically. The ClientLogin authorization process: Authorization with ClientLogin involves a sequence of interactions between three entities: the installed application, Google services, and the user. This diagram illustrates the sequence: When the third-party application needs to access a user's Googl...

Android Cloud to Device Messaging(C2DM) Tutorial

This tutorial is for getting started with Android Cloud to Device Messaging (C2DM) on Android. In the iOS world it is knows as “push notifications”. This feature will definitely help developers and their apps to streamline and optimize the data transfers. This would mean that apps now do not have to poll their servers at regular intervals to check for updates. The servers will be able to send updates (like Push Notifications) to the devices and makes it easier for mobile applications to sync data with servers. There are many different ways of accomplishing the same thing(polling,constant server connections,SMS messages). C2DM Alternatives: Polling: The application itself would periodically poll your servers to check for new messages. You would need to implement everything from queuing messages to writing the polling code. Alerts are no good if they’re delayed due to a low polling period but the more frequently you poll, the more the battery is going to die. SMS: Android can...