[Free Extension] Keep screen on

Created a simple keep screen on Extension.
I am currently learning AIX Extension building for the past 2-3 months.
So created this one because i primarily use AppyBuilder gold. And there is no option for keep screen awake.

I know there are other extension screen tools which bundle this feature, But wanted to do my own simple version :slight_smile:

Update: Changed code to be more logical boolean Blocks, With return values. And Designer property Check box, Default = False. Check to Enable Keep screen on,
Useful for set and forget or Programmatically control with True/False value on the blocks editor.



Extension is for use on Other AI2 Builders without this preset in the Editors. Such as AppyBuilder
Some builders like Thunkable have this feature built in and not required, But can be used still
Just may conflict with the default builder values,

Extension here: com.AppyKeepScreenOn.aix (6.1 KB)

Source Code here: AppyKeepScreenOn.txt (2.8 KB)

Feel free to Edit/Modify, Add to your Extensions.

> Uses modified source from the App inventor sources.


We need extensions like this, why! For permissions sometimes we need only a procedure and some extensions have a number of functions also need more permission to access,


Maybe you can also publish the java code for others to learn from just like you.


you could have found this feature in the KitchenSink component…

keep up the good work!


Hi, This one doesn’t require any specific permission, this.activity.getWindow().addFlags(128);

Just Adds the activity when called. Run once on Screen initialize,
Ive used a few Screen extensions in the past that had alot of things i didnt use, But would
sometimes still have a permission when not used.

This is just a solution for something i ran into when using AppyBuilder. And was tinkering with
Extensions so tried it :slight_smile:

Yup, will share the code if it will help anyone. Its a bit messy the code so will clean it up and post it here later on :slight_smile:

1 Like

Ah yes. indeed. I was using another one from the list “Screen tools” or something like that but the links were down, and i deleted the project so thought i was stuck lol…

I posted another Extension i was working on for a while now. I think its stable enough to test.
Slowly getting the hang of making these :slight_smile:

Added new block to clear the Keep screen on flags.
You can now programmatically switch it off again so screen reacts with normal system timeout.


1 Like

Blocks Updated using modified AI2 Sources,

boolean Blocks now used to set True/False value to keep screen on enabled / Disabled.

Properties screen editor checkbox Added for Set and forget, Default = False. Checked =True and will
Set the App to keep screen on. Unless Blocks are used to disable.

Source text file included on first post.

Basically the old blocks needed to be changed to Boolean properties so the designer screen can
return a result wen running, Blocks need to know the screen properties to work,

Wanted to learn how to Add properties designer screen so Updated this to achieve that :slight_smile:
Also how to Add return values when a Boolean changes state! The text source would be a great
example of how this is done, Not much code to look at, Simple implementation :slight_smile:

Capture2 Capture

what is the purpose of the Result property?

It was supposed to return state Keep screen on! , Not really necessary Lol, Will remove next update. Like you could connect it to a notifier or something to report state when switched,


“upload Error” with AI2.

Is the Extention only working with Thunkable?

I don’t know…
but the tools extension also offers a KeepScreenOn method, you could try…

I will have to test. It should work. Ive tried with thunkable and appy builder. Seems ok with both…

I tried your extension but my radio app online while my screen is turned on the radio works, but as soon as I press the button to turn off the screen the radio stops after 3mm.
and I would not want it to stop even the screen off.
how to do???
I specify that the player’s box is not checked on “play only in foreground”
thank you

what is the check box in thunkable and kodular of Screen1 “keep screen on” ???