Www.seriousandroiddeveloper.in. Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

Outline 1/3 PHA Client 1.Overall Architecture 2.Client PHA Setup 1.Open ADT 2.Edit Android Properties Android API 17 3.Setup Android Virtual Device.
Cross Platform Push with Azure
Staying in Sync with Cloud 2 Device Messaging. About Me Chris Risner Twitter: chrisrisner.
1 Working with the Bluetooth radio Nilanjan Banerjee Mobile Systems Programming University of Arkansas Fayetteville, AR
Creating an Amazon Simple Service Account. 1- Sign Up for an Amazon Account 2- Verify Sending Account or Domain 3- Send Test Message 4- Request.
Follow these instructions to pay your dues. Get into your web browser Like Internet Explorer Now you need type in this address in the Address bar. Example.
Web Proxy Server. Proxy Server Introduction Returns status and error messages. Handles http CGI requests. –For more information about CGI please refer.
Name Title Microsoft Corporation Push Notification Introduction and Platform Interaction.
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Developing Push Notifications (C2DM) for Android Vijai Co-Founder Adhish Technologies, Sweet’N’Spicy apps.
JavaScript & jQuery the missing manual Chapter 11
System Architecture.  Windows Phone 7  Mobile Phone Application  User – End Perspective  Google App Engine  Administration Console  Handles authentication,
FTP (File Transfer Protocol) & Telnet
Mobile Computing Lecture#08 IntentFilters & BroadcastReceivers.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Broadcast intents.
BETaaS APIs Webinar Adaptation, Service and Extended Service Programming Interfaces 1 H OW TO I NTERACT T HROUGH BET AA S API S.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Cosc 5/4730 Broadcast Receiver. Broadcast receiver A broadcast receiver (short receiver) – is an Android component which allows you to register for system.
Android ICC Part II Inter-component communication.
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
1 Mobile Software Development Framework: Android 2/28/2011 Y. Richard Yang.
Windows News app uses Notification Hubs Platform Notification Service App back-end Client app.
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
WEB PUSH Johannes Brodwall. Outline The low down Is it time? Implementation notes Firefox Chrome Safari Implementation bits.
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
DATA NOTIFICATIONS AUTH SERVER LOGIC LOGGING DIAGNOSTICS PLATFORMS: SCHEDULER SCALE.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
 Architectural overview  Main APIs. getGames.php getGroupsLocations.php getGroupsScores.php getMessage.php getStreet.php getTime.php login.php sendMessage.php.
FCM Workflow using GCM.
The Internet The Cloud Gmail in the Cloud.
ICM – API Server & Forms Gary Ratcliffe.
Esri UC 2014 | Demo Theater | Using ArcGIS Online App Logins in Node.js James Tedrick.
Poster Print Size: This poster template is 50” high by 30” wide and is printed at 120% for a 60” high by 36” wide poster. It can be used to print any poster.
Web Technologies Lecture 11 Implementing RESTful services.
Cosc 5/4735 YouTube API. YouTube The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications.
TAU – Google Technologies for Web Development Architectural Overview Amir Barkai Hila Barzilai Ran Goldberg Tammy Dagan.
Helping teachers connect instantly with students and parents.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Chapter 6 Google Play Services GOALS & OBJECTIVES Google Play Services give you features to attract users using Google features such as Google Maps, Google+,
Developing for Chromecast Cast Companion Library & Custom Receiver Application.
Capstone Design Camera for Security App - Final Report Kim Sang Min Jeon Byeong Yong.
Fix: Windows 10 Error Code 0x in Mail App u/6/b/ /alexwaston14/reimage-system-repair/ /pages/Reimage-Repair-Tool/
Redmond Protocols Plugfest 2016 Tarun Chopra Accessing APIs through Add-Ins Sr. Escalation Engineer.
Randy Dalrymple HillyRoad, LLC
Tracking device movements
 Gmail is a free webmail service, developed by Google.  Gmail also supports advertising.  Users can access Gmail on the desktop, laptop or through.
Jkelany Chat Project.
Tracking and Booking Taxi
Social Networks Integration in Android
Reactive Android Development
Firebase Cloud messaging A primer
You’re using Top Hat this term!
Google 2 Step Verification Backup Codes Google 2 Steps Verification Backup Codes is very important to get access Gmail account. Backup codes is usually.
Testing REST IPA using POSTMAN
WorkingLife Balance An example ISV scenario 11/14/2018 6:51 AM
eNanny: Child Tracking App
Zicheng Wan and Yuan Gao CPSC 6820, Clemson University
SharePoint Online Authentication Patterns
Lecture 17: Web Service and post
Android Developer Fundamentals V2 Lesson 5
Google Cloud Messaging (sort of)
CSc 337 Lecture 1: post.
MyLion Registration Website | Mobile device
CSc 337 Lecture 18: post.
Push-Based SET Token Delivery Using HTTP
Mobile Programming Broadcast Receivers.
Presentation transcript:

Google Cloud Messaging for Android (GCM) is a free service that helps developers send data from servers to their Android applications on Android devices. Message containing up to 4kb of payload data. The GCM service handles all aspects of queuing of messages and delivery to the target Android application running on the target device. It doesn’t necessary that your application in running state 24X7.

1.Application Server. 2.Google Account. 3.Android Phone/ emulator(Google API).

1.Registration ID- An ID issued by the GCM servers to the Android application that allows it to receive messages. Once the Android application has the registration ID, it sends it to the 3rd-party application server, which uses it to identify each device that has registered to receive messages for a given Android application. In other words, a registration ID is tied to a particular Android application running on a particular device. 2.Sender Auth Token- An API key that is saved on the 3rd-party application server that gives the application server authorized access to Google services. The API key is included in the header of POST requests that send messages. 3.Sender ID- A project ID you acquire from the API console The sender ID is used in the registration process to identify an Android application that is permitted to send messages to the device. 4.Pay Load – your data.

1.Client will send activation request, via our application 2.Client will receive response with unique Registration ID. 3.Client need to send this Registration ID, to our app server. This registration ID is used to send data to the phone. 4.When ever server have any message for a particular device, it send the request to the GCM server using Registration ID. 5. GCM server push the data with GCM technology

You need to create a Google API project open the following link and activate GCM API service to your project Note down: 1. Project Number(SENDER ID) 2. API key(Sender Auth Token)

Permission:

Registration : Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER"); registrationIntent.putExtra("app", PendingIntent.getBroadcast(v.getContext(), 0, new Intent(), 0)); registrationIntent.putExtra("sender", SenderID); startService(registrationIntent); Deactivation: Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER"); unregIntent.putExtra("app", PendingIntent.getBroadcast(v.getContext(), 0, new Intent(), 0)); startService(unregIntent);

Create a Broadcaster Receiver class: SeriousBroadcastReceiver public class SeriousBroadcastReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { try { String action = intent.getAction(); if (action.equals("com.google.android.c2dm.intent.REGISTRATION")) { String registrationId = intent.getStringExtra("registration_id"); String error = intent.getStringExtra("error"); String unregistered = intent.getStringExtra("unregistered"); } else if (action.equals("com.google.android.c2dm.intent.RECEIVE")) { String data1 = intent.getStringExtra(“data1"); String data2 = intent.getStringExtra(“data2"); } } finally { }}}

Processing (action.equals("com.google.android.c2dm.intent.REGISTRATION")) String error = intent.getStringExtra("error") If (error.equals.(“~~~~~~~~~”)) SERVICE_NOT_AVAILABLE The device can't read the response, or there was a 500/503 from the server that can be retried later. The Android application should use exponential back-off and retry. ACCOUNT_MISSING-There is no Google account on the phone. The Android application should ask the user to open the account manager and add a Google account. Fix on the device side. AUTHENTICATION_FAILED-Bad Google Account password. The Android application should ask the user to enter his/her Google Account password, and let the user retry manually later. Fix on the device side. INVALID_SENDER-The sender account is not recognized. This must be fixed on the Android application side. The developer must fix the application to provide the right sender extra in thecom.google.android.c2dm.intent.REGISTER intent. PHONE_REGISTRATION_ERROR-Incorrect phone registration with Google. This phone doesn't currently support GCM.INVALID_PARAMETERS-The request sent by the phone does not contain the expected parameters. This phone doesn't currently support GCM.

Server implementation is via HTTP request : To send a message, the application server issues a POST request to A message request is made of 2 parts: HTTP header and HTTP body. The HTTP header 1.Authorization: key=YOUR_API_KEY 2. Content-Type: application/json for JSON; application/x-www-form- urlencoded;charset=UTF-8 for plain text. HTTP Body: 1. registration_id 2. data.