foreground

Cannot able run Bluetooth Scanning in Foreground service more than 10 - 15 secs even though Notification is provided

喜欢而已 提交于 2021-02-11 06:26:49
问题 I have used Service to keep my scan for android mobiles even when the app is closed. I used Broadcast receiver to restart my service when killed. It restarts the scanning and it works only for some 15 seconds and then stops When i click button1 in {MainActivity} I started the service and have called startdiscovery() in startCommand method in {ExampleService} Please Help me in running the app in background MainActivity.java import android.Manifest; import android.app.ActivityManager; import

Cannot able run Bluetooth Scanning in Foreground service more than 10 - 15 secs even though Notification is provided

£可爱£侵袭症+ 提交于 2021-02-11 06:25:39
问题 I have used Service to keep my scan for android mobiles even when the app is closed. I used Broadcast receiver to restart my service when killed. It restarts the scanning and it works only for some 15 seconds and then stops When i click button1 in {MainActivity} I started the service and have called startdiscovery() in startCommand method in {ExampleService} Please Help me in running the app in background MainActivity.java import android.Manifest; import android.app.ActivityManager; import

Bringing a window to foreground from a background process

只愿长相守 提交于 2021-02-08 10:37:17
问题 My situation: A browser displays a webpage served by a locally running webserver. When the user clicks a button on the page, I would like to jump to another, possibly already running, application. Working on Windows, I thought about processing the button-click in my locally running webserver and just look for the respective HWND to call SetForegroundWindow on it. However, as it stands, the locally running webserver is not sufficiently privileged to SetForegroundWindow. Those restrictions make

Releasing memory from activity of foreground service

佐手、 提交于 2021-01-28 00:11:25
问题 I have an app with a foreground service and one activity. The service can either start on its own on boot, or be started from within the activity. I have noticed when the service starts itself on boot, the memory usage is ~3mB. Once I open the activity, memory usage jumps up to about ~9mB. Once the activity has been opened (and then closed either by back or home button), the memory never drops back down to 3mB, even after many hours and other apps opening. My question is, should the memory