什么是在Android设备上接收实时警报的最佳方法 [英] Whats the best way to receive real-time alarms on an Android device

查看:115
本文介绍了什么是在Android设备上接收实时警报的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个应用程序,该应用程序将从同一WiFi网络上的服务器接收Android移动设备上的实时警报.

是编写TC/IP服务器服务以侦听来自邮件服务器的消息的最佳方法,还是有更好的方法来实现此目的?
我想避免使用SMS,以便此pp可以在仅WiFi平板电脑和电话上使用.

如果TCP/IP服务器服务是最好的方法,我应该如何开始呢?编写具有各种活动的应用程序并使TCP/IP服务器服务成为主要例程吗?
我如何确定该服务在Android设备运行时将始终运行?

在此先感谢

Levster

I need to write an app that will receive real-time alarms on Android mobile devices from a server on the same WiFi network.

Is the best way to write a TC/IP server service to listen for messages from my messaging server, or is there a better way to implement this?
I want to avoid using SMS so that this pp will work on WiFi only tablets as well as phones.

If a TCP/IP server service is the best way, how should I start this? write an app with various activities and make the TCP/IP server service the main routine?
How can I be sure this service will always be running when the Android device is running?

thanks in advance

Levster

推荐答案

您应该签出C2DM,云到设备消息传递.我已经在多个应用程序中使用过它来推送通知,当您掌握它时,它很棒.

此处查看它 [
You should check out C2DM, Cloud to Device Messaging. I''ve been using it for several apps to push notifications, and it''s great when you get the hang of it.

Check it out here[^].


It doesn''t require your activity/service to be running. If it''s not, it will be started for you. Then you can chose to do something in the background, or pop open a UI or whatever. It requires a few extra permissions in your manifest file, and a bit of server-side code to push the notifications.


这篇关于什么是在Android设备上接收实时警报的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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