How to read/intercept USSD message coming on Android phone

六眼飞鱼酱① 提交于 2019-12-30 06:37:39

问题


So unil this point all I can figure over was that until Android 4.2.2 there were two ways available to us :

  1. Use the logcat and extract information from it Runtime.getRuntime().exec( "logcat -v time -b main PhoneUtils:D"); I used this code to read the logcat and find out the displayMMIComplete message here

  2. Use the provided intent named com.android.ussd.IExtendedNetworkService and listen for this intent and do you task.

So what I've acknoweldge until now is, Since 4.0 onwards this intent has been removed and since 4.2.2 onwards printing of USSD message info in the logcat has been removed?

Am I right until here? And secondly what's the hack or solution now to read the USSD message, there must be some way we can get through it?


回答1:


There is no Android-framework provided API yet which can be used to "read/intercept" USSD Messages in a Portable way.

The 2 approaches that you mentioned is what was available till now, but as you mentioned, support for it is dropped from Android open source project.

There is a request/discussion going on, which clearly shows that many developers are requesting this feature, but so far there is no update/communication from Google's side to explain future roadmap about adding support to "read/intercept" USSD Messages in a Portable way.



来源:https://stackoverflow.com/questions/28083067/how-to-read-intercept-ussd-message-coming-on-android-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!