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

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.

Related

How server can ping Android application

In my Android application there is a requirement to ping Android application from Server, is it really possible? Or only possible way is to ping Server from Android app.
Please share your ideas on how server can ping Android application. Also share code snippets if you have
Thanks
Use Google Cloud Messaging for Android: Google Cloud Messaging
Here is a good post for beginners. Find Here
You can implement GCM Client and Server to ping your application instead of showing a notification. GCM allow to send data upto 4kb of payload.
Please go through How to implement GCM server and GCM Client on the link.

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.

implementing GCM communication

I want to implement GCM communication in order to create push notifications, from my application server to all the devices that my app is installed via GOOGLE's servers.
I have found a library that helps me do this the Parse library and using the dashboard given I've sent a push notification from server to device and vice-versa.
The thing is that I want to be able to use the push notification (server side) from my website and not having to log in in Parse's. I'm pretty clueless about this, So I'd appreciate any direction and suggestion given
You may start with these tutorial
Using asp.net
Redth/PushSharp - A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!
Push Messages to GCM server using visual c#.net application (server side).
And using PHP and MySQL
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
And using Parse API
if you want to send pushnotification from parse API (not dashboard) then see
Push Notification Guide
There are docs in Parse for sending push notification from Ios,Android,.net,Javascript,php and REST services, use one them which is appropriate for you.
https://parse.com/docs/push_guide#top/JavaScript

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

Android, push message when app runs?

im developing a app in android. I want to send a push message when the client app is currently running. how can i achieve this with Google cloud messaging. or any other methods? but i want to send the push message at app running stage as well as the app closed. thanks in advance. hope someone will help me...
delay_while_idle attribute in gcm message will make GCM Server send message when device is not idling.
Read about cloud messaging it will help to fully understand how this service works. http://developer.android.com/guide/google/gcm/index.html
You cannot push message on the client side.
You can send REST HTTP data to a server.
On server side - use gcm-server library for pushing gcm messages.

Categories

Resources