短信网关如何Android应用程序 [英] SMS gateway how to program android app

查看:183
本文介绍了短信网关如何Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个短信网关的应用程序,该民意调查我的网站,检查是否有消息队列发送,如果有,应用程序将其发送到目的地号码。

I want to make a SMS gateway app, that polls my website and checks if there are messages to send in the queue, and if there is, the app will send it to the destination number.

有也应该是一个回调函数,在这里我将发布有关消息的信息,什么机器人确实做到了它。

There should also be a callback function, where I will post information about the message, what android did exactly with it.

我认为首先要创建一个服务,做民调检查通过WiFi来的网站,但指的是网站http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-是 - 不是/这是不可能的创建,将永远运行服务。

I thought first to create a service and do the poll check over wifi to the website, but refering to website "http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/" it is not possible to create a service that will run forever.

我应该考虑通过这个应用程式可能。还有很多花样,像wakelocks,startforeground等,但仍是服务不会永远运行。

What should I take in mind by make this app possible. There a lot of tricks, like wakelocks, startforeground etc, but still the service will not run forever.

感谢。

沙夫卡特

推荐答案

有关发送SMS消息:的 http://developer.android.com/reference/android/telephony/SmsManager.html

For sending sms messages: http://developer.android.com/reference/android/telephony/SmsManager.html

有关检查新邮件,可能是最好的方法是使用WAP短信/轮询。自2.2这个可以用云计算来完成对设备的消息:的http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html http://blog.boxedice.com/2010/10 / 07 / Android的推通知教程/

For checking/polling for new messages, probably the best way is using push messages. Since 2.2 this can be done with Cloud To Device Messaging: http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html and http://blog.boxedice.com/2010/10/07/android-push-notifications-tutorial/

这应该在后台工作,以同样的方式,Gmail的检查他的电子邮件(例如)

That should work in the background, in the same way that gmail checks his mail (for example)

这篇关于短信网关如何Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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