GCM4Public DEMO open source

GCM4Public DEMO open source

Vilius Kraujutis
2016年02月05日
  • 166.1 KB

    文件大小

  • Android 2.2+

    Android OS

关于GCM4Public DEMO open source

您可以随时随地在自己的各种设备上畅享数百万最新的 Android 应用、游戏、音乐、电影、电视节目、图书、杂志等精彩内容。

GCM4Public open-source GCM service

The event

During the +GDG Vilnius event Hackathon: Google Cloud Messaging for Android, this open source project was created:

https://github.com/gdgvilnius/GCM4Public-GAE-Server

The server

The Demo Android application using this GCM4Public service is open here:

https://github.com/gdgvilnius/GCM4Public-Android-Client

This is the Java class which sends GCM message:

https://github.com/gdgvilnius/GCM4Public-GAE-Server/blob/master/src/lt/andro/gcm4public/SendGCM2Clients.java

The client

To use Google Cloud Messaging for Android you need to register at Google's API console:

https://code.google.com/apis/console

This is the Java class responsible for handling GCM messages and registers on GCM4Public server:

https://github.com/gdgvilnius/GCM4Public-Android-Client/blob/master/src/lt/andro/gcm4public/GCMIntentService.java

Here you can see how device initiates registration on the GCM:

https://github.com/gdgvilnius/GCM4Public-Android-Client/blob/master/src/lt/andro/gcm4public/MainActivity.java

Sending messages

You'll get the project number (aka senderId) and API Key. These two are used in this service to send GCM notifications. And you need to provide it in this form: https://gcm4public.appspot.com/

The service is secure, because only senderId and phones registrationId are stored. The API key is not saved on server and you need to provide it every time you want to send a message to the server.

The senderId is used to filter app's users, so one application would not disturb other's users.

Multiple applications can use this single server: https://gcm4public.appspot.com/

Google App Engine

It's running on Google App Engine so it has some limitations, but I think, it might be running ok for few hundred small apps. If you have tens of thousands users, please fork the project on github and put on your separate Google App Engine account with separate daily limits.

Other resources

Blog post: http://www.andro.lt/2012/11/google-cloud-messaging-for-android.html

Google Cloud Messaging for Android by Francesco Nerieri:

https://developers.google.com/events/io/sessions/gooio2012/100/

and get the slides here:

http://commondatastorage.googleapis.com/io2012/presentations/live%20to%20website/100.pdf

If you want to read more, here is the link on developer.android.com about GCM for Android:

http://developer.android.com/guide/google/gcm/gs.html

更多

最新版本1.0的更新日志

Last updated on 2016年02月05日
Initial version.
更多

视频和屏幕截图

  • GCM4Public DEMO open source 海报
  • GCM4Public DEMO open source 截图 1

GCM4Public DEMO open source APK信息

最新版本
1.0
类别
教育
Android OS
Android 2.2+
文件大小
166.1 KB
在APKPure安全快速地下载APK
APKPure 使用签名验证功能,确保为您提供无病毒的 GCM4Public DEMO open source APK 下载。

GCM4Public DEMO open source历史版本

GCM4Public DEMO open source 1.0

166.1 KB2016年02月05日
下载
APKPure 图标

在APKPure上极速安全下载应用

一键安装安卓XAPK/APK文件!

下载 APKPure
thank icon
We use cookies and other technologies on this website to enhance your user experience.
By clicking any link on this page you are giving your consent to our Privacy Policy and Cookies Policy.
Learn More about Policies