I have a mobile application installed, say mail
I have a web service/web application being hosted for intimating the mobile app whenever he gets a mail.
Assume internet connection is ON in mobile.
I just want to know if the mobile app would be monitoring the server web service frequently for the mail or the server web service would take care and send/trigger the pop up to mobile once gets the mail (without the need for mobile to monitor).
Please assist and guide me to resolve this. Thanks in advance.
I would look into Android Cloud to Device Messaging.
Your application will receive an intent when a message arrives.
Link: http://code.google.com/android/c2dm/
In the specific case of mail, nearly every mail client is designed to poll (monitor) the remote server for mail.
In a more general sense, it depends what the app does. If there is an established protocol, it will dictate the mechanism for communication. If there is no guiding protocol, you need to disclose more about the situation for us to give advice on.
According to this
http://code.google.com/android/c2dm/
Android cloud to device is official deprecated , Try Google cloud Messegin (GCM)
http://developer.android.com/google/gcm/gs.html
Related
I'm making a NodeJS server and an Android app that goes with it. I need to send alerts to my mobile app users that's coming from the web server. Something like a a chat app on the server and the android users getting the messages also (Facebook messenger?).
I have the server ready and Android app communicating to its database (for user login/getting user info/etc) using REST. I just need to figure out how to send info to the Android app WITH THE SERVER INITIATING COMMUNICATION. Any advice on where to start?
Start by looking at Google Cloud Messaging.
It's a free service that accepts messages from your server-based program and queues it to be sent to phones with your app when the phones are online.
Here is the overview on Android Developers.
YES!
Working with NodeJS, you have probably already heard of Socket.IO.
I'd say: Start there!
For your app to communicate with the server, there's also the java lib. These are great tools to start making any good real time service.
After you get along with this, you should also check GCM as #krisLarson suggested. And talkign about GCM, you have Node-GCM to make your work even easier.
Good luck!
I would like to develop a small application which can send notifications or communicate from one phone to another over the internet.
Could any please suggest me how can I start with this project?
Look for Google Cloud Messaging: http://developer.android.com/google/gcm/index.html
There's considerable setup. You need to activate GCM for your app in the developer panel, get yourself an API key, and depending on use case, maybe you'll need an XMPP server as well.
I was developing an android app and a server that serve this apps. The server was coded in cakePHP. I want the app to have a notification from the server when there is an update on whatever things. Is this notification function a Server to client connection ? For example the facebook , whatapps and other social app in smart phone that could receive notification when someone send you a message, tagged you etc.
What is the proper way of doing this? I just need an idea to start. I see someone suggesting to open a long establish connection from client to check whether there is an update, but this would drain the phone battery.
If it's a Server to client connection, how would the server know where to find the client?
Google cloud messaging would seem to be the best option here; https://developer.android.com/google/gcm/index.html
As it says on the tin; "Google Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device, and also to receive messages from devices on the same connection"
xtify seems to also support what you are asking but I've no experience with it.
Although depending on your particular requirements there are other options available.
If the client only needs to get notifications when active you could have it check the server every X number of seconds for updates when it is not asleep or even when the user does a particular action. Of course this all depends on what you want to happen.
edit: Heres a good article/tutorial with code samples https://blog.serverdensity.com/android-push-notifications-tutorial/
I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?
I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one?
And how would this work?
Some example code would be really helpful..
Tnx!
The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.
...or it could be a message containing up to 4kb of payload data (so
apps like instant messaging can consume the message directly).
So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)
So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
Just my two cents:
I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an 'online list' to all the apps.
GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate 'XXXX wants to chat'. They can then launch your app and automatically connects to a chat session.
Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with 'no server'. Code is for javascript but they also have java. Chat app using jquerymobile web app framework
You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.
I would like to know how the android market initiates the remote download through their website. I'm guessing there is some sort of push notification system. I want to know if it's possible to do the same thing using a different web interface.
The only possibility I see is to use the C2D (Cloud to Device) messaging API provided by Google. In that way you could send an install intent to the device. However that would always open the market locally on the device from which the user can then install the app.
Obviously Google can bypass these "limitations" :)
They use Android Cloud to Device Messaging (C2DM). They allow anyone with a server of their own to implement this service.
From the site:
Android Cloud to Device Messaging (C2DM) is a service that helps developers send data from servers to their applications on Android devices. 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 C2DM service handles all aspects of queueing of messages and delivery to the target application running on the target device.