Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read/intercept USSD message coming on Android phone

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?

like image 509
user3189761 Avatar asked Jan 22 '15 07:01

user3189761


1 Answers

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.

like image 125
AADProgramming Avatar answered Sep 20 '22 10:09

AADProgramming