推送通知在android系统 [英] push notification in android

查看:163
本文介绍了推送通知在android系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请指导我如何实现机器人的推送通知。根据我的应用程序时,服务器在任何时间打任何信息,我想显示当时这些信息。我需要在我的Andr​​oid平板来实现这一点。

please guide me how to implement the push notification in android. according to my application when server hits any information at any time i want to display that info at that time. what i need to implement this in my android plateform.

推荐答案

由于Alopix mentionned,自动方式做到这一点是通过Android云端,由于Android 2.2。结果
现在,如果你之前2.2想要的话,这里是我选择这样做,以使其能够在我的应用程序:结果
首先,把开关在应用程序中,测试你正在运行的手机的Andr​​oid系统的版本(带的 Build.VERSION 然后现场SDK_INT)。这你知道,如果你在等于或高于2.2或以下的方式。结果
然后,如果你是下面,你需要创建一个小的PHP页面,用例如一个定时器,一个将定期通过你的服务器来执行,你这样做页面上简单的HTTP请求,以检查是否有可用的新闻为您应用程序。结果
这是否帮助?

As Alopix mentionned, the automatic way to do that is through Android Cloud, since Android 2.2.
Now If you want it before 2.2, here is what I choose to do to enable it in my application :
First, put a switch in your application, testing for the version of the Android system of the phone you are running on (with Build.VERSION and then the field SDK_INT).this way you know if you are in equal or above 2.2 or below.
Then, if you are below, you need to create a small php page, with for instance a timer, that will be executed regularly by your server, and you do a simple http request on this page to check if there are news available for your application.
Does that help?

这篇关于推送通知在android系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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