To do what you need to do to make your app run in the background, build your app with a professional compiler that can create a Service app that means use something other than App Inventor like the professional Android Studio and B4A compilers.
Īlso look here and here for more tutorials. How to do a lot of basic things with App Inventor are described here. There is a free programming course here and the aia files for the projects in the book are here: The book ‘teaches’ users how to program with AI2 blocks. A very good way to learn App Inventor is to read the free Inventor’s Manual here in the AI2 free online eBook … the links are at the bottom of the Web page. Here are some resources to help you learn to use the AI2 tools that might help you figure out a solution. When, if you find a solution to ‘Why? the dont’ accept parameters’, please share it with the community. You possibly can experiment using the Android Alarm information using an intent to control it. Remember, App Inventor is not running as a Service (in the background). I expect the Android deskclock widget can not be modified and or if it can, it cannot be used to revive a ‘sleeping’ App Inventor app, especially if the device is manually LOCKED. Google imposes constraints as to what developers can do to modify certain Android behavior. Here is what App Inventor 2 can do with intents: So the problems is my phone,whom phisical key to lockscreen acts different if in charge or not… The discriminating is whenever the phone is or not connected to usb recharger,regarding apk or usb emulation(actually works not for the emulated but for the usb connection!!) No idea why different behavior from phone connected to pc and phone no connected…maybe there is something to do with battery save option but i cant figure how. I suppose the phisical lock ovveride everything,so having my screen on is pointless I also tryed to manage battery use from my phone,in settings/battery i can manual manage app to work in background…(i use this optionfor same gps app that seem to loose gps after a while,ie Wikiloc)… I tryed right now both method you suggested.īoth work fine when my smartphone is connected via usb to the pc…they prevent the screen to autofade and to go into Lockscreen…and even if i lock the phone with the the phisical key,wait a while and then unlock it, the timer works fine.īUT when compiled to apk and installed on my phone, same prob as always…of course screen doesnt fade to lock BUT if i lock with phisical key,wait a while and then unlock it, have wrong values as always. i figured the package is but i have no idea how to pass the information(my starting MM and SS after myapp math) to the Timer and start itĪny idea and suggestions and examples with blocks? ie: MM=10 SS=21 set Timerstarting value MM:SS,start timer. The Problem: the clock sensor component i use for the countdown to decrement the inizitial variables MM and SS STOPS WHEN I LOCK THE SCREEN (even without closing the app),making my app totally useless.ġ)confirm no way forappinventor2 to work in background, as reported in tons of forum etc?Ģ)if 1)is confirmed,i tought bout a workaround using ActivityStarter and the internal clock/alarm/timer of my smartphone. Then i set a timer accordingly and start it.It beeps ie 10seconds before i have to badgein.Easy! Making syncronisation between my smartphone internal clock and badgmachineclock,i can do some math and find exactly how long my break is. So,depending on which SSeconds a badge,i can have from 10MM:01SS to 10MM:59SS to break. Since the badgemachine collect only the minutes between in and out,i want to maxime my breakĮxample:i badge out at 10:00:whateverseconds, so i have to badge in < 10:10:59
The badge machine shows HHours:MMinutes but no SSeconds Details(if interested,or skip to The Problem):at work i have 10 minutes break.i have to badge out and badge in.