GCM example in android with ASP .net service - android

I need example GCM in android with ASP .Net service. Can You share example about it?

Check Push notification on Androïd
Server can use GCM registration ID sent by device to communicate with Google Cloud Server.

See here:
Google Cloud Messaging Server Side Code in C#
It's a simple HTTP POST where you need to pass in the correct set of parameters (JSON data and your APK and a registration key from what I remember). By using the libraries in the above link, or simply writing your own, you should be able to post messages to GCM and then have your Android client react to the messages that are posted by your service.

Related

How to build a server for GCM

I know how to implement GCM in my App but I don't know how to build a server able to send notification to ALL the users.
I need something quite simple (just sending notification), could you advise me any services and tutorial in order to set up the server?
I wish something not to complex, because everything that I will need from my app is receiving whether simply notifications to display or to tell the app that some new data is available for downloading.
Thank you!!
Prerequisite for GCM Application
Google API Server Key
GCM RegId of the Android Device to communicate via GCM
If you get clear concept about GCM, please visit here
If you want to use java for server side then visit my answer.
Related Links:
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
Android Warriors
If you're using PHP, you could use this approach to send GCM message to your client refer this
You could setup your own local server on PHP using AMPP. refer this
Probably, the simplest way is to add a cloud endpoint module refer this. Then, write a simple service refer this that sends the messages. Finally, let Android Studio deploy it.

How to send notification through GCM to Java EE web app?

Recently I had to port my Android app to Java EE enviroment . But I'm struggling with the notification process . For now I use Google Cloud Messaging to send notification from "Server A" to Android devices and can't find any clear method to send the same notification to the Java EE web app .
Here's a diagram to clarify what I want to do :
Any body came through this before ? Please share your thoughts .
Choosing Google Cloud Messaging to send notification is a googd decision. You may implement the XMPP Connection Server protocol. It can receive upstream messages from user's device to cloud. When GCM receives an upstream messaging call from client app, it generates the necessary XMPP stanza for sending the upstream message.
I did some research and found out a java-based server: https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server
Here's the link for starting GCM with explanation of code: https://developers.google.com/cloud-messaging/
You can't implement push notification for you web app itself.
However you can implement them for different client(browsers).
It's easy to implement gcm push notification on Chrome, you can check Google's Doc on that.
But I don't think Firefox/Safari support gcm.

The difference between GCM and PARSE push messages

I am buiding an android app which will be receiving notifications from my server. This means all my users which is above 1 million, will receive notifications from my server. I know parse and google cloud messaging(GCM) can do the push messages but please I want to know the best out of this two (parse and GCM) so I can implement it. Thanks in advance.
If you look at https://parse.com/tutorials/android-push-notifications you can see:
The Parse library provides push notifications by using Google Cloud Messaging (GCM).
So you have to register your app to GCM console to send push notification in anyway.
When to NOT use parse.com?
If you already have a backend service, you can easily implement push notification since there are plenty of third part libraries for different platforms such as node.js, php etc.
When to use parse.com?
If you don't have backend-service and you just want to send push notifications also if you don't want to spend your time by setting up server stuff then you can go with parse.com
NOTE: Facebook shuts down parse by January 2017 so please consider it.(http://blog.parse.com/announcements/moving-on/)
Android push notification is a service used to send messages directly to the Android Mobile Devices.
There are several ways we can implement Android push notification.
Google Cloud Messaging(GCM)
Parse Notification(Parse.com)
You are asking which one is the best way to implement :
The standard way is using GCM (Google Cloud Messaging) but there are some alternatives like Parse Notification,Which is easier to use.
If you need to handle Json Push messages,Refer this link
Steps involved in send Push notifications:
Developing the application involves two parts:
GCM Server Application – Create Web application using Php to send message to User via GCM Cloud server
GCM Client Application – Create Android application which receive message sent from GCM Server Web App
For More Informations regarding to GCM server and Client Application
Parse uses GCM and uses own service for Kindle
Please Go with google cloud messaging(GCM) .It is very easy to integrate in android app. the problem with parse in some case device token or registration id is not register at their database so User of parse does not get push notification.In case of GCM we can sure for device token
So my recommendation is GCM
Hope this will help you.

Is PHP necessary to implement GCM

I am trying to implement android push notification by using GCM. But, in all the tutorials that I have referred so far, I get one or more PHP files. Is it not possible without PHP, because I don't know PHP. Any help will be appreciated.
I f you want to implement GCM you'll need a mediator file php/.net etc which acts as communicator between your server and the GCM server.This file pass the message to be delivered along with the projectid(registered with google console)to GCM server.So that GCM server can send push messages to all mobile devices regisytered under the corrosponding projectid.You can use this based on your purpose.
You don't have to have PHP for GCM, you can use any server side language i.e. Java (J2EE), Python, etc. But what you must have is a server.
See what android is saying about GCM here
A full GCM implementation requires both a client implementation and a
server implementation. For more information about implementing the
server side, see Implementing GCM Server.
Some similar questions:
GCM java server example
How to send notification to Android app from Java server using GCM?

Communicate between Android phones using GoogleCloudMessaging

I'm new in android development. I'm trying to develop an app in which a user can send a request to another device running the same app and it should return a response/notification to the sending device.
I googled it and found that GoogleCloudMessaging can be used for that. But all the tutorials say that it can be used to send messages from server to apps. I need to know how the reverse can be done, ie send messages from app to server..
Please provide some tutorial.
Any help is appreciated.
Thanks..
If you want to send data to your server, you can use rest communication.
Here a tutorial
Step 1: Call a server side script*(REST api/ Webserices)* from your android application using HttpPost/HttpGet,
Step 2: Wait for response coming from server and use it.
Note: don't forget send all needful data for your request from your app to server by httppost.
Go through these link this will help you.
Get started with push notifications in Mobile Services.
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
.
Google android doc on GCM,
Google Cloud Messaging GCM for Android and Push Notifications

Categories

Resources