Screen Timeout Extension

Introduction

Extension Name: ScreenTimeout
With this extension you can change user device screen timeout according to your need and set it back as the user set it before.

Version: 1

Realse On: 3 July, 2020

Methods/Function

component_method


component_method(1)

How to use extension

  • Set Timeout

  • Put The Time In Milli Sec to change screen timeout.
    component_method

  • Default Timeout

  • Set Screen Timeout time back as the user set it before.
    component_method(1)

    Note: Ask the user to allow Write System Setting by using the block provided by kodular. component_method(2)
    Otherwise the extension will not work rather it will show error.

    Note: To set Screen Time to never set milli sec to -1

    Download ScreenTimeout.aix (6.3 KB)

    Thanks You
    @avmcreators02 for helping me in making this extension.

    19 Likes

    thank you for your contribution.
    you might want to fix the small spelling error… millisec is written with double l
    Unbenannt

    Taifun

    7 Likes

    Fantastic work!

    2 Likes

    Nice extension

    1 Like

    Welcome @Taifun

    Thank you @Taifun for pointing out mistake its fixed now.

    Nice extension!

    1 Like

    Please explain exactly what is the difference and / or advantage to the KeepScreenOn method.
    (Of course, asking the user to grant WRITE_SETTINGS is not an advantage.)

    I don’t know much but I think with this extension you can decide the time for which the user devices’ screen will remain ‘ON’ and bright, whereas with built-in Keep Screen On property, it is not possible to assign the time
    @bodymindpower

    Exactly

    Also Note this therefore it also works as built-in Keep Screen On.

    Yes, but you can also set it to false: grafik at any time you want.
    So where is the difference?
    And you don’t need any permission with the KeepScreenOn method.

    @bodymindpower
    Consider here the Auto Screen-off feature/setting which every device have in the devices’ setting menu. In this we are able to select the screen ‘ON’ period by selecting the desired time (15 sec, 30 sec, 1 min, etc).
    Now if a user wants to perform similar task then he/she would just have to pass the time in the form of millisec parameter with this extension if he/she is using one.

    Now to perform same thing without this extension(with Keep Screen On property) will require an extra clock component I guess along with other related blocks.

    So this extension may save some blocks.
    No-doubt that the mentioned task can be performed without extension but its just that this extension makes the process somewhat easier. This is what I understood, but the developer can clarify more on this.

    1 Like

    I will say @Vaibhav explained everything but to make things more easier I will explain more In simple words.

    Suppose user has set its device screen timeout to 15 sec. Now if you set the built-in Keep Screen On to True than the screen timeout of that user will be Never/Always but if you set built-in Keep Screen On to False the screen timeout will again get back to 15 sec but with this extension you can set the screen timeout to your desired time let, say to 1 min, 30 min, 15 min, etc. But you will have to pass the time in Milli Sec and with this extension you can also set screen time out to never/always.

    Also after editing/modifying the user screen timeout time if you want to set it back as before you can also do that.

    Hope you have understood @bodymindpower

    1 Like

    I had understood that before. Mostly grafik should be called at any desired point in a procedure. For that no clock is required.

    But my main point is:
    Basically, I always try to request as few (dangerous) permissions as possible because the users are “not amused”.

    Yes I agree but everyone has different choice. My duty was to mention it, now its’s totally depends on the user whether he want use extension or not.

    2 Likes

    good work, keep it up :wink:

    thank you for share

    If extensions could begin providing parameters named “seconds” instead of “milliseconds” that’d be easier for the developer… It’s simple.

    seconds*1000 in your code.