laviniut Active Member Licensed User Longtime User Jul 18, 2018 #1 Please help me to make a working Battery notification app. I made one that working in android 7 and less with B4A less than v8. The app use a widget service in foreground and for that a notification appear at boot, but starting the application, notification gone. Here is the link with old version app: https://play.google.com/store/apps/details?id=ombun.batterymonitor.com Now i need to make the app for sdk 26 and with B4A 8+ but i have problems. I test a lot of variants but i cannot get a service to start at boot and working in background to monitor battery level. I attached the app to which I work now. Please help me. Attachments battery notification5.zip battery notification5.zip 90.8 KB · Views: 397
Please help me to make a working Battery notification app. I made one that working in android 7 and less with B4A less than v8. The app use a widget service in foreground and for that a notification appear at boot, but starting the application, notification gone. Here is the link with old version app: https://play.google.com/store/apps/details?id=ombun.batterymonitor.com Now i need to make the app for sdk 26 and with B4A 8+ but i have problems. I test a lot of variants but i cannot get a service to start at boot and working in background to monitor battery level. I attached the app to which I work now. Please help me.
Erel B4X founder Staff member Licensed User Longtime User Jul 19, 2018 #2 laviniut said: I test a lot of variants but i cannot get a service to start at boot and working in background Click to expand... Just add this line to your service in Service_Create: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS Make sure NOT to use the starter service for this. Upvote 0
laviniut said: I test a lot of variants but i cannot get a service to start at boot and working in background Click to expand... Just add this line to your service in Service_Create: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS Make sure NOT to use the starter service for this.
laviniut Active Member Licensed User Longtime User Jul 24, 2018 #3 If i use this: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS or Code: Copy #StartCommandReturnValue: android.app.Service.START_STICKY then service is running and start at boot, but allways i have a notification in notification bar. Can i skip this notification? Upvote 0
If i use this: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS or Code: Copy #StartCommandReturnValue: android.app.Service.START_STICKY then service is running and start at boot, but allways i have a notification in notification bar. Can i skip this notification?
DonManfred Expert Licensed User Longtime User Jul 24, 2018 #4 laviniut said: Can i skip this notification? Click to expand... no Upvote 0
laviniut Active Member Licensed User Longtime User Jul 24, 2018 #5 So, the solution for me is to use toast messages, not notification. Upvote 0