I am working on an Android App. There will be two types of Users - Admin and the client. I just want to make Admin post some notices in Plain text and then those will be notified to Clients. The question is, What should I use to make transfer of notices from Admin to Client. I read somewhere that it is possible with the help of Google App Engine and Google Cloud Messaging (GCM), but it is very complex to work with Google App Engine. Is there any better option that I can use?
5 Answers
Google app engine is perfect for your requirement as GCM push notifications need some sort of server. For an alternative you can try to explore Parse SDK also.

- 2,129
- 4
- 21
- 20
You can use Amazon S3
service. Go here for more information: http://aws.amazon.com/s3/

- 2,368
- 1
- 17
- 32
-
I don't know where to begin. I haven't done any server side programming yet, would you please guide me where to start. – Adesh Atole Apr 16 '14 at 07:46
Google App Engine is very simple if you read the step-by-step guide.
You must install maven
: fallow this HOW TO and then read the google's guide and, with some cut and paste in the pom.xml
, and 3 classes you'll be able to write some REST web service in 4 hours!
I've done this a few week ago, and the complex thing was generate the O-AUTH id for automatic user authentication! In the end you'll be able also to generate e thin Android client to use your service!
If you know java, all this will be simple!
This is a simple web service with app engine:
@Api(
name = "helloworld",
version = "v1",
scopes = {Constants.EMAIL_SCOPE},
clientIds = {Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID, Constants.API_EXPLORER_CLIENT_ID},
audiences = {Constants.ANDROID_AUDIENCE}
)
public class Greetings {
public static ArrayList<HelloGreeting> greetings = new ArrayList<HelloGreeting>();
static {
greetings.add(new HelloGreeting("ciao world!"));
greetings.add(new HelloGreeting("addio world!"));
}
public HelloGreeting getGreeting(@Named("id") Integer id) {
return greetings.get(id);
}
}

- 11,003
- 5
- 50
- 73
-
-
You are using java for the app right? So use it everywhere :D Althoug you can write your backend in python or php (but i haven't tested) – Manuel Spigolon Apr 16 '14 at 08:05
-
But i haven't worked with Servlets or any sort of server side programming.. Where should i begin?? – Adesh Atole Apr 16 '14 at 08:07
-
1I've edit my post with show you an example. Read the guide: is all write for dummy and also if you haven't experience in server site is quite simple to understand: try it. – Manuel Spigolon Apr 16 '14 at 08:10
I think the best choice you have is indeed Google Cloud Messages
. Keep in mind that anything that you implement, will have to be very alike to it, so why reinvent the wheel?
If you don't want to use this, there's a couple of other possibilities that come to my mind (though, as I said, finally they emulate GCM
's behavior):
Implementing a
Socket
listening in the client side. This way, you first would need to make sure that each client that connects would need to send you somehow (for instance, aHTTP POST
request) some signal and theIP
address, because you'll need to know where to connect. This way, you'd need to connect to each of the devices each time you want to send a notice, send the message through thatSocket
and handle timeouts (for instance, if I try to deliver a message and the connection gets refused for X times, I could considerate it as the client has disconnected).Implementing a centralized 'board'. By this approach, clients would connect to a centralized notice board (a
HTTP
site, for instance), say polling every 30 seconds, and showing just the new messages. This way you'd need to keep control of the already shown messages and show just the new ones. The disadvantage of this approach is that initially it would need to be accessible to anyone (even if they're not using your app), but you can implement some additional security measures to avoid it (for instance, allow just the clients that have registered sending aHTTP POST
to the remote server), otherwise redirect them to an error page or return a430 Forbidden
error.
If you finally want to give a try to GCM
(which is easier than you might imagine), I wrote an answer a time ago that summarizes to a step-by-step guide what to do to implement it.
If only, your concern is you don't want to indulge yourself to server side programming and still want to receive some string in your application as push notification, you can try and explore this:

- 2,940
- 1
- 25
- 38