Extension to request IGNORE BATTERY OPTIMIZATIONS. Remember: this will not help to run your app in the background!

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.

Taifun, if you have the extension and it could work, I don’t mind buying you a cup of coffee for it. :grin:

you can download the extension and an example project here
batopt.aia (7.2 KB)
batopt.apk (2.9 MB)
com.puravidaapps.TaifunBatteryOptimization.aix (6.7 KB)

there is only one method
which opens the following dialog for the user
Note: you have to build the app else this will not work!

Warning: Google Play might reject your app if you are using this extension!
see also Extension to request IGNORE BATTERY OPTIMIZATIONS. Remember: this will not help to run your app in the background!

Remember: Kodular apps are not really able to run in the background! Also not with this extension!

If you want to donate something, you can do it here: https://paypal.me/puravidaapps
thank you



Thank you so much Taifun!! I will definitely donate if it works!!

Well, it literally asked whether to “let app always run in background”. The extension works! But the phone must either be lying (because my app still gets RESET to its original state [All dynamic card views GONE!], after several hours of screen off) Or App running in background can still get RESET now and then. Because I have verified with my other device, that if the app screen is up front, it won’t get RESET.

1 Like

The extension does not “work.” Kodular apps do not run in the background as said in many topics including this one.

Yes. I guess, I still need to give it a try and Taifun still deserves his coffee regardless :+1:
If the phone allows the app to run in background, then it must be kodular that refuses to allow that. Ignoring the allowing of apps to run in background, so to speak.

EDIT: Before this, it was my understanding that Kodular Apps are not suggested to run in background because it drains battery. But it would like to give that as an option. And there’s no way for kodular apps to run in background, even if it wanted to. Now, I realize, it actually doesn’t want to have its apps run in the background or it doesn’t have ability to utilize the “run in background” feature by Android.


it was my wish for 2018 to support in kodular but no update so far

1 Like

Has been like this from the very beginning. App inventor tried to give the run in background feature some years ago using services (http://services.appinventor.mit.edu). But the website now says that it is shutting it down. Bummer…


Bummer. But what can we say. I don’t think it is ever going to happen, unfortunately.

Correct, that will not happen in the near future or as you said


Luckily, we have hundreds of options outside Kodular/App Inventor. You see, it’s the same as if I want to make a very complex game (I like working with canvas, sprites, animation, etc.) Kodular can handle most of the things you need for a fairly decent game, but don’t expect to make a first person shooter in it! If you reach to that point, then it’s time to migrate to a new platform like Unity, Unreal, etc.

Same with your need for background services. You know it exists right?, Then all you need to do is go and learn the platform that allows that.


Totally understand your point. But currently, App Inventor is what I have the time to tinker with. It is relatively easy, tries to make things easy for non-professional or even hobbyist coders and doesn’t take much time learning its “language”.


That’s exactly why you don’t have some of the very professional features in it, like background services. Because in order to make it easy for non professionals, its architecture had to be made in a way some things got “sacrificed” to make the more important and used ones possible.
I also wish some day it will happen, but I made peace with the fact that it’s just another thing (of the many) I can’t do with Kodular/App Inventor.


I know I said this before, but I may try to make App Inventor over again using newer technologies and I’ll work on it as a hobby.


Now, that’s something I truly am looking forward to!

I do understand that. But it’s a bummer, nevertheless, for one who is not much of a coder like myself.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.