jacho981
jacho981

Reputation: 87

android messaging system approach

it's not an actual programming problem solution what I'm looking for, but some advice on how to approach a project.

I have to make an app that does the following:

There is a cleaning firm that needs a system where the customer is able to post about an incident on the firm's website. Every employee has an android phone, so the administrator will send the posted incident to an employee of his choice.

I only have to do the Adroid app which employees will have on their phones.

The other programmer said that he could send the message by XML or using a DB. But I dont see how he is going to choose the specific device who will receive the message, or how the device will detect that there is a new message to download and show.

I'm thinking about using Google Cloud Messaging, even though I've never used it before. I'm not an expert at all, on the contrary I'm quite a newbie. This is probably the most complicated app I had to do by now...

I also thought about creating a data base, with a user table with user IDs, so another table with the messages will include the user ID that should receive the message. In this case, the Android app should check for new messages given to that user ID... I suppose I would have to do this checking via a service, but don't really know...

Theses are the options i figured out.

We are quite lost at the momment and any piece of advice would be appreciated.

Upvotes: 2

Views: 242

Answers (1)

Dmitry Zaytsev
Dmitry Zaytsev

Reputation: 23962

First of all - quite nice idea. You're on the right way.

This is how it's usually done:

  1. Each device has to register itself on server and receive some unique id from it. So, at this point server knows which user has which id.
  2. When it comes to sending a message, just send it to a particular registered id.

Also, I would suggest to not just use a plain GCM to transfer a data, but instead do a periodical fetch of "requests" from server at reasonable intervals and perform a force-fetch on GCM message. Using this approach you will protect yourself from possible failures of GCM.

Upvotes: 2

Related Questions