Keep Screen Extension


#1

Hi, this is a very small but necessary (at least necessary for me :))
It has only one property:
KeepScreenProp
If you app window is visible to the user, keep the device’s screen turned on and bright
ScKeepScreen.aix (5.1 KB)
KeepScreenTest.aia (6.9 KB) Created by MIT App Inventor

P.S. I could not make my icon :frowning:


How to use Keep Screen On
#2

Always nice to see more people making extensions.

FYI: AB Kitchen Sink Component has this functionality.


#3

Thank you, did not know. It would be nice to have a database of extensions, including their functions.


#4

There is a directory here:
http://puravidaapps.com/extensions.php

But KitchenSink is a Component of AB so it’s not listed.


#5

Icon needs to be 16x16.
What paths did you try?


#6

Pura Vida I looked, but by the name of the extension is not always clear.
I use this method. Icons do the same as the original. But they are not compiled.
I am writing a Java Class in Android Studio. Immediately check the grammar. It turns out more convenient than a text editor.


#7

I normally use iconName = "aiwebres/icon.png"
I create a sub folder called aiwebres and place my 16x16 icon.png in that folder.

Most use url but I prefer this method.


#8

It does not work for me. :frowning:
It’s strange that if I copy a regular icon and give it a different name, it doesn’t work either.


#9

@ScorpioNormal and fyi also the tools extension offers a KeepScreenOn method… also there is a method to cancel the KeepScreenOn again…

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.


#10

iconName = “https://someDomain.com/yourIconInSize16x16.png

Taifun


#11

In my version KeepScreenOn=false to cancel keep screen.
I use container.$form().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); metod.


#12

In this case, the icon will be loaded during app installation?


#13

It will be visible in the builder not in the app:
20181218_174501


#14

I meant that the icon is downloaded from the website each time the extension is loaded into the editor, or it compiles once?


#15

I believe it’s loaded from the url each time the builder is opened.
That is the main reason i like to use aiwebres folder method.