如何使用 GCM 从 Java 服务器向 Android 应用程序发送通知? [英] How to send notification to Android app from Java server using GCM?

查看:25
本文介绍了如何使用 GCM 从 Java 服务器向 Android 应用程序发送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 REST Web 服务的简单 Android 应用程序.现在我想使用 GCM 将通知从我的 REST Web 服务发送到 Android 应用程序.

I have my simple Android application which uses REST web service. Now I want to sent notification from my REST web service to Android application using GCM.

这是怎么做的?是否有针对此要求的简单教程?我搜索并找到了 Google API,但我不明白.

How do this? Is there any simple tutorial for this requirement? I searched and found Google API, but I don't understand that.

推荐答案

我为 GCMUtils 项目创建了一个基于 Java 的测试服务器,作为 maven 插件实现:https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server

I have created a Java-based test server, implemented as a maven plugin, for the GCMUtils project: https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server

这里是源代码:https://github.com/jarlehansen/gcmutils/tree/master/gcm-test-server

maven 插件的来源:https://github.com/jarlehansen/gcmutils/tree/master/gcmutils-maven-plugin

Source for the maven plugin: https://github.com/jarlehansen/gcmutils/tree/master/gcmutils-maven-plugin

也许这可以帮助您入门?

Maybe this can help you get started?

这篇关于如何使用 GCM 从 Java 服务器向 Android 应用程序发送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆