Hi guys,
I don’t know how relevant the above thread still is. I heard that it cannot run on OS above Oreo. I am using Oreo. NEWBIE ALERT: How do I implement the above request into kodular?
And what should I type in with activitystarter.action?
Is it:
“set activitystarter.action to android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS”
or
"set activitystarter.action to ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS"
(Like the link to the document given in the post)
And for the package name:
Thunkable’s format is " com.thunkable.android.yourName.appName" according to poster.
But kodular is “io.kodular.yourName.appName”?
And if the above is no longer relevant to solve the run in background issue. Can someone point me to a way to have my timer resume (After app stops running in background) with the CORRECT duration by using the system clock as a reference? I just can’t get it to work. And how do I get my timer to run at the same rate as the system clock? It seems to lag by 1 second, every 2 to 3 seconds of system clock.
I think, it is supposed to make your device think that the app does not need battery optimizations. So, your device will run in the background without getting killed even after your screen is off.
Correct me if I am wrong, but if IGNORE_BATTERY_OPTIMIZATIONS is the cause of apps shutting down in the background, then if the app ignores the optimization requests, it won’t get shut down, right?
The App can run but if closed from recent tabs thn the app will be stopped. Basically if you want to do anything in the background it should be done via a Service which is like an app but without the UI Part. Google can give better and clear answers about it
I can offer a small extension to set this, however, and this is why I did not publish it: Google will reject apps, which are trying to use that feature
Taifun, may I have the extension please? I am using it for a personal app. And the app really depends on running in the background. I don’t have the knowledge, time or skills to use android studio either.
I really need my dynamic card views to not be reset when I minimize the app and the timer to keep running in the background. If you have it, I would truly appreciate you offering it.
Also, I read that there is the “ask for the user’s permission” method too. Maybe you have an extension for that, so I can know immediately, if it can work with my phone, when the app asks me for permission to enable it?
Note: most applications should not use this; there are many facilities provided by the platform for applications to operate correctly in the various power saving modes. This is only for unusual applications that need to deeply control their own execution, at the potential expense of the user’s battery life. Note that these applications greatly run the risk of showing to the user as high power consumers on their device.
I really don’t mind the battery drain, if the ignoring of battery optimizations can work. For the dynamic cards to not be reset (if the ignoring of battery optimizations don’t work), I am trying to store values of the dynamic cards to TinyDB, then load them using on app resume but it works strangely. Using local variables vs global variables have their own strange behavior. I will post it in a new topic.
But, if you have the extensions for ignoring battery optimizations, I would like to try it on my phone. I am using using oreo 8.0.0, which is supposed to work. Unless, I am misunderstanding the thunkable post.
By the way, I did read that link, but I understand none of it. I am not a programmer professionally, I only started with app inventor.
Global variables will reset when you relaunch the application too. Instead of storing the components in TinyDB, just save the content, and when user relaunches the app just create them again with a loop.
I am using global variables just for storing stuff to TinyDB. TinyDB is supposed to be permanent right? But it is behaving strangely. Please view my new post. Thank you.