I have been developing an app that plays calming music and also pulls random audio tracks from a database list to stream one after another. When this list is over, it repopulates and continues playing in a random order.
The issue Iām having as I test the app, is that when my phone screen turns off after a few minutes, the background music loop continues unhindered, but these shuffled audio tracks stop after about 1 or 2 minutes. Usually they do not even start up again when I unlock my screen, unless I move away from that Media screen and come back, restarting that screen.
This is a problem, because the point of the app is to help people sleepā¦ so the app really needs to continue playing, even if the phone screen turns off!
I apologise again if my beginner questions are silly, but I am a little confused.
I would like the app to run on the users phone, a downloadable app from the play store.
Can I still do this if I make it run as a web app?
Is it easy to make it run as a web app? Do I need to change anything about the app, as itās pretty much all ready to go at this point?
Android 11 will allow normal apps to continue working in the background.
The web app is different and you can only add a shortcut to the device Home screen.
In theory, you should not need to change anything but running an app on the web is of course different that running it as a normal phone app. You might also face issues about adjusting the display to fit the web. Another point to look into that not every component is supported as a web app but that is only if you actually use such components.
Hello @muneer ā¦ My phone just got updated to Android 11ā¦ Thunkable made app is a ānormalā app, so will run now in background ? That will be a huge step forward for me
Asking this because all crashing reports from Google PlayStore in my admin`s console are because users put app in background, and app crashes.
Later edit after testingā¦ it seems that a thunkable made app is not a ānormalā oneā¦ still crashes when put in background
Android 11 is supposed to supply the system resources to apps (certain criteria, I guess)even when in background. I just tested my Audio Sample project using Thunkable Live App on my sonās phone and the music continued while in background.
I did not test the APK. Just ran the project from the Thunkable Live App.
Hmm, my app doesnāt crash or turn off when the screen turns off and the background music keeps running locally. It is just that the audio files being pulled from the internet stop coming in.
Iām not sure if converting this to a web app will cause a whole new slew of issues to resolve , I donāt know how to make a web app or if I need to host this somewhere - itās all brand new to me and time is running out for this project. As far as I can see, this is my only issue before launch.
Is there a SIMPLE solution to make the media screen stay switched on, if the user has not actively switched it off? (Like how youtube app will keep streaming a video if you put your phone down and do not interact for long periods of time?) I just want to resolve this issue asap - the media needs to keep playing for them, and I donāt want them to need to keep touching the screen to keep it engaged or change their phone settings if they have it automatically turn off after a few minutes.
Does that make sense?
Open to any other suggestions!
Many thanks for your help! Canāt wait to get this one over the line after 2 YEARS!
To answer your questionā¦ ideally they could let the screen switch off and the app would continue working, but it sounds like that isnāt an option unless I change the app to a web app and do a bunch of other inevitable fixes.
So, Iām brainstorming - what will help this situation? What will be more helpful for the user? As it stands, my own phone turns off automatically after 2 or 3 mins of no use, which is way too fast for my app to stop workingā¦ so then I need to keep opening the app up, no way I could fall asleep in that time. So maybe if I stop the phone from automatically turning off, they will at least have the option to turn their phone over with the app still playing? Otherwise, they potentially get a very short time and then the app stops.
Iām open to any other suggestions and ideas on simple solutions to work around this scenario!
Is there some way to get the app to keep running the audio tracks when the screen is switched off besides converting to a web app and likely causing myself a lot more work?
I think this might be a good fix for now actually. It works great! Thank you for your help. Of course, if there comes a simple solution to keep the app going when the screen turns off, by all means, please do share it on this thread.