Capture pop up message
Moderator: Martin
Capture pop up message
I would like to capture the text of the pop up message from the telecom operator when issued by any ussd. For example after dialling *123# , the telecom operator sends back the balance of that connection as a pop up message. How do I capture that message text ?
Re: Capture pop up message
You can usually capture it with trigger UI Event to detect the popup (Event: Window opened, package could be com.android.phone but probably depends on ROM). Variable source_class_name could be helpful to distinguish the result from other events. On a Nexus 5X the source_class_name is android.app.AlertDialog.
The text of the dialog is probably stored in variable text. You could also use action Control UI with script text = getTextInActiveWindow(); to extract the whole text in the dialog if it's not already stored in variable text. Script function matches can also be used to check if the text matches a certain regular expression and to extract some portion of the text.
Regards,
Martin
The text of the dialog is probably stored in variable text. You could also use action Control UI with script text = getTextInActiveWindow(); to extract the whole text in the dialog if it's not already stored in variable text. Script function matches can also be used to check if the text matches a certain regular expression and to extract some portion of the text.
Regards,
Martin
Re: Capture pop up message
Thanks a lot Martin. I only had to change source_class_name to get my result.
Re: Capture pop up message
used the suggestions to automatically check "use MTP" in the Alert dialog that appears when USB cable is inserted in the phone (Marshmallow).
In my case the Alert Dialog was generated by Settings apk and i discovered it using the app "Current Activity" (shows which app/activity is currently showing).
May I suggest you to add a similar function in order to make easier to discover the current showed activity? Automagic already uses the accessibility service so it should be just a matter of making it visible to the user (something like the useful "show overlay control" feature available in Control UI action).
In my case the Alert Dialog was generated by Settings apk and i discovered it using the app "Current Activity" (shows which app/activity is currently showing).
May I suggest you to add a similar function in order to make easier to discover the current showed activity? Automagic already uses the accessibility service so it should be just a matter of making it visible to the user (something like the useful "show overlay control" feature available in Control UI action).
Re: Capture pop up message
For this purpose I'm often using a flow with trigger Activity Started: */* and either check the log or use Notification on Screen: {package_name}/{class_name}.
I agree that an easier way to get this information makes sense. I add it to the todo-list.
Regards,
Martin
I agree that an easier way to get this information makes sense. I add it to the todo-list.
Regards,
Martin
Re: Capture pop up message
Thanks for your kindness and attention. Regards to you