Create push notification in android

前端 未结 2 1651
轻奢々
轻奢々 2020-12-17 07:15

how to create push notification in Android using GCM or either C2DM i have tried and check some sites and didn\'t get exact answer.i need to know how it works.Can any one pr

相关标签:
2条回答
  • 2020-12-17 07:40

    Its Depend on your requirement what you have to do.

    here is sample of C2DM: in this sample android device is registered wtih server after that server send massage to all device. so there is one way communication(server to Android device)

    enter image description here

    So all things are done at server side. just download this tutorial. Both Server side(PHP) and Android code are available.

    Edited:

    you got application key from Google services which you have to put at server side.

    SENDER_ID – Google project id which you have to send when you want to register your device with server.

    0 讨论(0)
  • 2020-12-17 07:44

    You can use GCM demo app supported by Google. One needs to install GCM libs using SDK manager and then create API keys in Google APIs console. Follow instructions from the link and you can create an app that receives push notifications from GCM server. I did try this and it worked even on my Android emulators. You need to use Emulator that targets Google APIs though.

    0 讨论(0)
提交回复
热议问题