I need to 'simulate' dial pad keystrokes to request info from phone.

51 views
Skip to first unread message

Leo Rokon

unread,
May 11, 2019, 5:20:04 PM5/11/19
to MIT App Inventor Forum
My phone allows me to enter a series of keystrokes to request "what network am I using?".

This is done manually by entering the 'phone' app and typing these keystrokes.  But not making a 'call' request.  After entering the keystrokes, the phone pops up a display with the answer to my request.

I'd like to create an app (using Appinventor 2) to do this with a single touch of the app icon.  The app would simply replicate my manual keystrokes:  enter the 'phone' mode, and 'press' the keys.

If I enter the keystrokes into a 'favorite' and attempt to 'call' it, like making a call, the phone does not do what I want here.

Thanks


Peter Mathijssen

unread,
May 12, 2019, 3:13:56 AM5/12/19
to MIT App Inventor Forum
Can you provide more information on how this works? Maybe an example. In App Inventor you can use an Activity Starter, maybe you can use something like that to make it work.  


Ferran SIMON

unread,
May 12, 2019, 5:42:03 AM5/12/19
to MIT App Inventor Forum

Hello Peter,

 

The mistake is in the editor of the Blocks.

For example in this picture you can see I’am connectad as Spanisch user but the app messages are written with German.

But not all, only ones. See you the attached picture.

 

2.jpg

 

Here is very luck. The app options are written in spanisch, german and English¡¡¡.

ONLY it happens in the Blocks Editor AI2.

 

1.png

 

Please, keep attention. It happens only in theAI2 Blocks editor. And only from the last version (a few days).

I’am using Activity Starter but they are running well. And it is an internal app mistake with options messages transllations. The mistake is in the AI2 EDITOR translation messages and warnings. I think it is an internal AI2 app mistake.

 

If you need more info, please no hesitate to ask me.

Thanks

Peter Mathijssen

unread,
May 12, 2019, 1:57:04 PM5/12/19
to MIT App Inventor Forum
I think you responded in the wrong topic. ;-)

Leo Rokon

unread,
May 12, 2019, 4:25:36 PM5/12/19
to MIT App Inventor Forum
Peter, thanks for the suggestion.  I guess the Activity that I need to start is the 'phone' app (the little icon showing a phone), and the somehow enter the keystrokes representing the 'code'.

I'll dig into this idea.

The manual operation opens a little window with some text in it.  I guess that this is what is 'returned' from the activity?

There must be a way to 'simulate' keystrokes in a app, as well? 

As to how it works, I just proceed as if I am making a call.  When the 'keypad' appears, instead of entering a normal phone number, I enter  *#123456#*  (this is not the exact 'code', but should serve as a description).  After I enter this sequence, the popup appears on the screen.  I never initiate a call.

TimAI2

unread,
May 12, 2019, 5:07:57 PM5/12/19
to MIT App Inventor Forum

Leo Rokon

unread,
May 13, 2019, 6:08:02 PM5/13/19
to MIT App Inventor Forum
I appreciate everyone's help.  But I'm still lost.

What I want to do boils down to pressing a sequence of 'keys'  or 'icons' in a certain order.  Just as a user would do on he phone.

I was hoping that there is a trick to "simulate the touching of icons/keys".   Like a little macro to do a multi-step task with one 'button' push.

In this case, the user would tap the "REQUEST INFO" icon on the phone or tablet.  REQUEST INFO would be my new app.

The "REQUEST INTO" app would then, like magic, 'tap' the icons and keys as follows:

Phone,  Dialpad,  # , 1, 2, 3, 4, #

And, just as if the user had tapped this sequence, the phone would respond with a popup info window.

Then, to clear/remove the popup. the user would press the < icon at the bottom of the screen.

Sort of a crude way to do a multi-key action with one 'key' (icon).


ABG

unread,
May 13, 2019, 10:54:44 PM5/13/19
to MIT App Inventor Forum
Do you know in advance what the popup should say?

If so, you are describing a fake phone simulator,
the equivalent of how a player piano moves its keys.

That can be done with a Clock Timer and list of 
button components, using the Clock Timer to
cycle through the buttons and change their background colors
in order, one at a time.

That would make it look like the buttons were being pressed.

ABG

Leo Rokon

unread,
May 15, 2019, 4:55:03 PM5/15/19
to MIT App Inventor Forum
No, I don't know what the reply will say.  It is an actual request to the phone (what carrier am I connected to?).  Something in the phones operation system does the popup.

So I need to 'really' press the buttons (or icons).   This is intended to be a shortcut macro, so that the complex 'code' of key presses does not have to be remembered or looked up.  This 'macro' method, if it exists, could be useful for other things as well.

The clock timer driving a 'button pusher' is a good idea, but I don't know how to do that.  Can it be done to press 'real' buttons?

I've studied some android app test features, thinking I would 'test' the phone app with the data request?   Still looking into that.


Thanks

Any other ideas?
Reply all
Reply to author
Forward
0 new messages