I am working on an android project where client needed to send just a single sms/text (yes, sms only) to GCM like server and GCM service will handle delivery of message to thousand of target Android devices. I am in doubt whether it is possible or not. I searched a lot but not found a reliable answer anywhere.
It is definitely possible to accomplish this with GCM. This is exactly what GCM was made for. Follow the instructions from Google and you'll be good to go.
https://developer.android.com/google/gcm/index.html
Alternatively, if you only want to send an sms, why don't you just send an sms...
Related
I've ran across a topic that discusses how you could create an app that allows you to send an sms to the application and receive them from it. My question is simply the following:
Can someone send an sms to that app regardless of where they live or are there any limitations in terms of service provider etc?
Chances are you are going to have to use Google Cloud Messaging to accomplish this, seen here
It sounds like you might be after push notifications rather than an SMS. Amazon's Simple Notification Service (SNS) allows you to send push notifications as wells as SMSs though and has an Android SDK.
In either scenario you'd be able to send SMSs or push notifications to any device regardless of its location.
I want to implement Google Cloud Messaging (GCM) for the sole and singular purpose of sending messages to Topics. I am building an android app. I do have an app-engine endpoint server, fyi. I am wondering: what parts of the Set up a Client App on Android process do I not need to implement?
Here is what I already included
google-services.json
compile "com.google.android.gms:play-services:8.1.0"
the manifest edit portion (copy and pasted block pretty much)
But do I need to, for instance, obtain a InstanceID? What else do I need or not need? Ideally if someone has an example that exclusively uses "Topic Messaging" that would be great. But short of that, I can carry on with some pointers.
Do I need GcmListenerService, InstanceIDListenerService, and RegistrationIntentService?
Sending topic messages with GCM is very similar to sending regular messages with GCM. The only differences are that the client must subscribe to the topic, and the sender must send to the topic.
To you questions about do you need GcmListenerService, InstanceIdListenerService and RegistrationIntentService... Yes.
Please have a look at this quickstart which demonstrates GCM using topic and non-topic messages.
Also note that you should not be using:
com.google.android.gms:play-services:8.1.0
please use:
com.google.android.gms:play-services-gcm:8.1.0
I want to implement an instant messagign service analogously to whatsapp.
The messages are delivered, even thoug sender and receiver do not need to be online at the same time.
Is there a framework existing to do so (btw I use a linux server). Is the Google Clouse Service suitable for this? Thank you
Google Cloud Messaging (GCM) is a service that manages small messages to / from android. It does require users to be using google play.
What makes it so cool is they will manage the connections for you. They will queue stuff up for a period of up to four weeks, and after that will send a message telling you that its been more than weeks, and you will need to process a new request to obtain the original messages again.
Its a free service. There are some rate limits, but they seem pretty reasonable. i.e. You can't use it for sending frequent game moves, but its totally fine for normal text messages. As I understand it, GCM is only a server interface. You will have to roll your own XMPP server to store and manage messages. Note: there is a payload limit on GCM messages, I think its 4k or so... not big enough for images. You'd have to manage those via http, and send image names via GCM.
They will also broadcast messages to users (1000 at a time). Did I mention this is a free service?
Something like this link will get you started. The API keys thing and registration #'s is sorta confusing. Once you figure that out, it all works. You can test to your emulator via curl messages to the google server, etc..
Oh, and GCM also keeps track of all your user analytics as well..
You can try openfire. It has offline message and everything. Server can be hosted in linux as well.
There is Layer (Android and iOS support for the moment)
Hey Checkout this easy way to implement chat
Quickblox Api
I have one single Gmail account signed up for C2DM.
What I would like is that my app, thanks to this account (after having requested registration IDs and auth tokens for each device), could be able to provide messages to all the devices in which the app is installed.
I want to know if is it possible to use the C2DM in this way..
Thanks a lot
(for any details, just ask me.. )
ps I made the c2dm work on the emulator, but of course I cannot try what written before because I would need several phones..
Going off your question and comments, it sounds like you're just wondering if you can send c2dm notifications to an indeterminate number of devices using only one sender id.
That is exactly the way c2dm is supposed to work. You create one sender id to use on your backend servers, and that sender id is used in your app to register for c2dm notifications. Your backend then gathers all registrations ids and uses your one sender id to push notifications interested parties.
If I understood your issue correctly, the answer is: you can't.
You will have to send one http request, to google servers, for each device you want to reach.
There's no way to broadcast a message to all the users who have registered to your service.
It' frustrating because in my case I send a newsletter for all my users, so opening a connection to millions of users is expensive.
To solve the scalability issue I have created a simple appengine map-reduce task that loops through all the user registrations and create the http connection to the google services, it's the fastest you can go because it dynamically instantiate new servers for your delivery needs.
C2DM has been deprecated. GCM has replaced it, and it allows you to send messages to 1000 devices with one HTTP POST.
C2DM->GCM Migration Guide:
http://developer.android.com/guide/google/gcm/c2dm.html
I am looking for an optimal solution to implement chat server for android clients on GAE.
At the moment I use C2DM to notify particular users about new messages and pull data from server after such notification. But sometimes C2DM servers delay notification message and it stops to be realtime.
I also had a look on XMPP and it seems that it is mandatory to have an external XMPP server like google talk, so it is not what I am looking for too.
Is there another way to implement chat on GAE? Any advices are warmly appriceted!
The Reason why you are experiencing Delay with C2DM is because it is not real time. Google actually says this: It isnt the most reliable way. It suggest having a third party server such as XMPP
You can implement chat on App Engine using the Channel API, but the only supported clients for that are browsers. If you're prepared to make your Android app browser-based, that would be a solution - otherwise, you will have to look into third-party services, like Urban Airship.