安卓使呼叫活动检查prepaid手机余额 [英] Android make call activity to check prepaid phone balance

查看:125
本文介绍了安卓使呼叫活动检查prepaid手机余额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想作一个活动,我可以调用一定NUMER来检查我的prepaid电话平衡。 在我的供应商的,例如* 555#,然后我会得到这样的例子回应:你剩下的手机信用卡是5美元。我想用这个数据(5美元),保存在数据库中。

I would like to make an activity where i can call a certain numer to check my prepaid phone balance. In my provider its for example *555# then i will get a response like for example "Your remaining phone credit is 5 USD". I would like to use this data (5 USD) to save in the database.

我只是一个初学者,没有人知道如何处理?

I am just a beginner, does someone know how to proceed?

推荐答案

<打击>您可以发出一个呼叫意图(这需要一个许可),并使用广播接收器听的SMS响应(再次,要求的权限)。

You could issue a CALL intent (which requires a permission) and use a broadcast receiver to listen for the SMS response (again, permission required).

不过,这并不是一个非常强大的解决方案,你必须检查手机短信发件人ID和消息文本,whcih可能在未来改变。

However, this isn't a very robust solution as you have to check the SMS sender id and the message text, whcih may change in the future.

修改

正如在评论中,你将需要使用USSD协议这一点。它肯定会出现可能的,因为有一个应用程序,做到了这一点:的 https://play.google.com/store/apps/details?id=com.iba.ussdchecker&hl=en

As pointed out in comments, you will need to use the USSD protocol for this. It definitely appears possible, as there is an app that does just that: https://play.google.com/store/apps/details?id=com.iba.ussdchecker&hl=en.

这些线程可能会有所帮助:

These threads may be helpful:

  • <一个href="http://stackoverflow.com/questions/4193343/call-and-get-the-response-for-a-ussd-$c$c-in-the-background">Call (并获得响应)一个USSD code,在后台?
  • 如何运行USSD在Android命令?
  • <一个href="http://stackoverflow.com/questions/5477597/how-is-it-possible-to-do-ussd-requests-on-android">How是有可能这样做在Android USSD请求?
  • Call (and get the response for) a USSD Code, in the background?
  • How to run USSD commands on android?
  • How is it possible to do USSD requests on Android?

这篇关于安卓使呼叫活动检查prepaid手机余额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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