I created a Bluetooth oriented app. I got everything working as expected. However, if I open another app, and leave the phone focused on that app for say 20 minutes. My Kodular BT app stops working, which was in the background. The BT device shows it is disconnected. I re-open my app, it refreshes, and I’m asked to repair my bluetooth device again.
What could be causing this? It is such a bummer after all this long work. I have enabled battery optimizations for the app and checks to make sure all my clock components are “timer always fires.”
I did not receive any replies to that topic. I did implement a method for re-connection. In addition, to a ping pong much like how IRC server check clients. So onto the next problem was my idea.
By background, I mean open, just not in focus. It does run as I said, for the 20 or so minutes before it “refreshes.”
The more and more I look into this. I believe you’re right. Unfortunately, this is still happening with no solution unless the phone is rooted. Which I nearly bricked this Moto x4 last time I tried.
Please let me know if you know the solution to that problem with Android 9? I’m currently testing using the max process limit found in the developer, options which is 4 processes.
Currently it is not possible to run Kodular apps in background. May be in future, so there is no solution for this problem right now.
If you want to run your app non stop then stay within the app or don’t let it run in background or you can engage your users in your app to keep working your app non stop.
You can also inform your users, if they minimize or closes your app then it stops working.
Thank you for that extension suggestion. I have disabled anything of the sort from affecting the phone. I believe it is being killed due to memory management software. Yet, the phone has 1GB free. Still kills it every 5 minutes or so.
For kicks, I wrote an app to open my kodular app every 5 minutes Works, but not nearly a preferable solution. Currently, I’m either rooting the phone to have more control with resource management. Trying to find professional help there. If that fails, I guess I’ll have to recode the app.
I came to my solution. Rooting the phone and using RAM manager for Android, to allocate more RAM for multi tasking, has prevented the system from “refreshing” my kodular app when not in focus.
I requested assistance from someone on Fiverr to root the phone. Worked out. I will take note of this for future Kodular apps. Thanks everyone for your advice on the matter.