[Free Extension] Keep screen on


#1

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.

Capture2

Capture

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.


#2

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,


#3

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


#4

you could have found this feature in the KitchenSink component…

keep up the good work!
Taifun


#5

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:


#6

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:


#7

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:


#8

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.

sffffre


#9

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


#10

what is the purpose of the Result property?
Taifun


#11

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,


#12

Hi,

“upload Error” with AI2.

Is the Extention only working with Thunkable?


#13

I don’t know…
but the tools extension also offers a KeepScreenOn method, you could try…
https://puravidaapps.com/tools.php
Taifun


#14

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