3

I am working on an android application that should alert the user with any new post in a defined facebook page using a notification, I asked for a mechanism to do this, but some answered with try using Google Cloud Messaging but I don't know what should I have to use it

Mahmoud
  • 353
  • 1
  • 3
  • 14
  • What you have done till now to achieve this ? – dinesh sharma Jan 07 '14 at 05:53
  • Have a look in architecture of [GCM](http://developer.android.com/google/gcm/gcm.html#arch) it is well explained – Glenn Jan 07 '14 at 05:55
  • I am using a background service that send http requests to check any data change if so a broadcast will repond for it, but I am looking for a way which reduces the internet consumption, but I don't have already a server – Mahmoud Jan 07 '14 at 05:58

3 Answers3

1

Well you will need to have your sever (3 party server) that ave database and where you can also have some code you run to push notifications to the Google cloud server.

In your databse you will store the user device tokens, so that when it's time to send out the alert you can retrieve them and submit an array of android tokens

Here is an image from google that illustrate my answer:

enter image description here

meda
  • 45,103
  • 14
  • 92
  • 122
0

One way is you need a xampp and gcm acts as interlink between android and server to pass information.It has browser key where you will use in server.

Take a look of this.

http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

Shadow
  • 6,864
  • 6
  • 44
  • 93
0

Check APIDEMOS in your sdk there you can find out about android GCM, all you need is SENDER_ID(For Client) and APP_ID(For your(third party)server use), this you can get from Google Console page, there you will have to register you application package and then you will have to turn on the GCM feature for same and you will get SENDER_ID and APP_ID once this is done you have server demo in apidemos simple host that in your system change the URL in client and try it you will have IDEA how it works, if you have 4.0 and above device then thats great or else you need to login your gmail in you android device.

Amit
  • 391
  • 3
  • 15
  • You mean that I don't have to host an online database ? I need to communicate with every user who have installed my app it is like a news application. Can you explain more please – Mahmoud Jan 07 '14 at 06:31
  • your third party server would be online only there you will have your data base i.e. online data-base, and are you using any kind of login and registration, you will maintain records in server so you don't need to host any data base in your device, please try GCM Demo from apidemos you will get all your doubts cleared :) – Amit Jan 07 '14 at 07:49