B4A Question Service in Foreground with Partial Lock - bocker77 (first post)    Feb 6, 2021   (1 reaction) Thanks roumei, it looks like I solved the sleep lock issue by changing where I start the service. I give a warning about battery usage in the app so I cover that. My thoughts that if someone is on a long ride in a car with this app running that a solution would be to plug it into the car's... B4A Tutorial Automatic Foreground Mode - Erel    Jun 12, 2018   (18 reactions)   tags: Mode, service foreground, Automatic Foreground Mode, Automatic, Foreground, Services any visible activity or any service in foreground state (Service.StartForeground). Common cases where we expect services to start even if the app is not in the foreground: - Push notifications... in the foreground is with a new API that ensures that the service will start and immediately switch to foreground mode. This is now handled automatically in the B4A framework. When needed services... foreground mode when the service completed its task. This can be done in two ways: 1. Call Service... B4A Question [Solved] Foreground service for all versions ? - lemonisdead    Sep 28, 2018   (1 reaction) a service has to run always and to be sure it runs on all Android versions, I have to : - start the service as it is with the new AutomaticForegroundMode - in Service_Start : 1) StopAutomaticForeground 2) Prepare a notification using NB6 3) put the service in foreground mode again using : Service.StartForeground 4) acquire a PartialLock If the app is swipped, as we don't have Sticky services anymore, I have to restart the service from Starter / Service_TaskRemoved. Please... B4A Question Android 12-13 in sleep mode smartphone, disables microphone recording. - Erel (first post)    Dec 2, 2022 Foreground service + partial wake lock + whitelist the app on devices that provide such feature Background location tracking... B4A Question Remove notification during service start - mtselection    Feb 5, 2021 Hi, I try to remove notification during service create, but not have success. Service.AutomaticForegroundNotification = Null Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS lock.PartialLock How to set up Service.AutomaticForegroundMode. Thanks Maurizio... B4A Question Show notoficacion programmed to several hours - Erel (first post)    Oct 27, 2019 The second StartServiceAt call is not required. You should keep the process running with a foreground service + partial lock and use a timer or call to Sleep to show a notification after two minutes.... B4A Question Staying alive - or trying to - Erel (first post)    Mar 16, 2023 The OS doesn't like apps that run forever. With a foreground service and a partial lock your app should theoretically run forever but practically it will be killed at some point.... B4A Question Staying Alive : where to code PartialLock - 3fazeac    Jan 18, 2023 the phoneWakeState.PartialLock be coded? In the Main or in the foreground service? Or both? My... UserClosed is true. Putting the PartialLock in *only* the foreground service doesn't always keep the service running while the phone is sleeping. Should I *also* code in the PartialLock in... I've used phoneWakeState.PartialLock and also startServiceAt along with Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER followed by Service.StartForeground(nid... B4A Question Receive JSON from www server in service - in the foreground - petr4ppc    Jan 27, 2022 Dear friends, I am succesfully receiving JSON from web. I have service for this functionality. I am trying to do that task in the foreground. I am trying to set for service this atributes: Sub Service_Create Service.AutomaticForegroundModeService.AUTOMATIC_FOREGROUND_NEVER lock.ReleasePartialLock End sub Sub Service_Start (StartingIntent As Intent) Service.StartForeground(nid...:foregroundServiceType, "dataSync") I think here is not choice for my function (for manifest)... : . EDIT... B4A Question Keeping web radio app's sound active during phone sleep mode with ExoPlayer - Erel (first post)    Mar 7, 2024 1. Switch to B4XPages. 2. Start a foreground service. 3. Acquire a partial wake lock (PhoneWakeState)... Page: 1   2   3   4   5   6   7   |