Extension For Any Event

This extension allows you to intercept all the event calls in the screen.
See here.


component_method

You have to call this block to initialize the extension.

procedures_defnoreturn

Once you have initialized it, you can create a procedure block like the above where you will receive the updates when an event is raised.

For this to work, necessarily you dont have to drag any event.


Example

Download:xyz.kumaraswamy.ai2tools.aix (10.2 KB)

15 Likes

Hi Kumaraswamy

We could do with a description that actually tells what the extension is for and why we would need it. I'm not getting an understanding from the video. Also there is a typo in the Ai2Tools block.

This can be helpful while debugging the app, what the extension does is it intercepts all the event calls in the screen, (for example when any button is clicked, you would be notified).

Incase you need to keep track of all the events, it will be useful.

Incase any component has the Initialize method, AppInventor would try to call that automatically and to prevent that I've done this.

1 Like

Great work @Kumaraswamy
Waiting for its offliciall release

That's just the miss spelling on the Block?

No it isnt, if I change that to "Initialize" it will break things.

1 Like

only make a procedure named event, and no need to call it? then it will monitor all events?

Yes, create a procedure block shown in the topic and call "InitializeI" block and you'll receive updates to the procedure.

intresting.
you may name the initialize block as 'Init', rather than a miss spelling word.

1 Like

These are the components i used.

image

3 Likes

Hmm I havent tested it in companion yet, can you try with compiled app?

Compiled it works. Looking at the responses from the button it says click when it should be touchup when i let go of the button.

1 Like

Little test

1 Like

TouchUp is raised before the Click event, so it'll be changed immediately.

Fix 1.1

  • Extension now works on companion

xyz.kumaraswamy.ai2tools.aix (10.3 KB)

I had removed some code unknowingly :sweat_smile:

3 Likes

Maybe make the block name InitializeExtension or InitializeAi2Tools

1 Like

The Completed event is triggered about 80ms later than with the Player component.

1 Like

Hmm that is because the extension needs to find the procedure and do some internal changes. I will do some changes if possible.

3 Likes

1 Like

Good Work @Kumaraswamy !
Will love to see the source code to know how it works internally if you make it open-source :grin: :heart:

1 Like