foreground-service

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

Android is killing my foreground service after Force stop my package

夙愿已清 提交于 2020-12-29 04:35:27
问题 I've been struggling with this for 2 weeks now. I'm developing an app that controls call duration. I receive a braodcast where I start a foreground service to hang up the call. but after five minutes or more android force stop my package then kills my process which cause the service to crash -I think - (don't know why) with no crash message or any kind of error. it just disappear. And it Schedules restart but it never start the service again. here is the logcat 12-29 00:28:52.857 619-619/? I

Getting GPS location updates while app in the background

点点圈 提交于 2020-12-15 06:22:39
问题 I have an android application that tracks customer location and send it's location each 10 seconds, however, in android O, location updates will be gotten few times each hour, as said in the documentation about limitation of gps location update in android O. anyway, to overcome this problem, I used a foreground service with notification, so that the gps location update keep updating in fusedLocation. After that, I faced another problem that speed and direction in fusedLocation are zero,

Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE TYPE_MEDIA_PROJECTION in Android Pie and Q

こ雲淡風輕ζ 提交于 2020-11-28 08:30:04
问题 any body knows why this error occur, Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION on getMediaProjection() even i call getMediaProjection() method after calling startforeground() method..! Stack Trace is : Process: com.al1.screenrecorder, PID: 24641 java.lang.RuntimeException: Unable to start service com.al1.screenrecorder.service.DisplayRecorderService@9ef2101 with Intent { cmp=com.al1.screenrecorder/.service

Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE TYPE_MEDIA_PROJECTION in Android Pie and Q

社会主义新天地 提交于 2020-11-28 08:29:04
问题 any body knows why this error occur, Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION on getMediaProjection() even i call getMediaProjection() method after calling startforeground() method..! Stack Trace is : Process: com.al1.screenrecorder, PID: 24641 java.lang.RuntimeException: Unable to start service com.al1.screenrecorder.service.DisplayRecorderService@9ef2101 with Intent { cmp=com.al1.screenrecorder/.service

How to create a never ending background service in Xamarin.Forms?

你离开我真会死。 提交于 2020-07-19 06:58:25
问题 I am monitoring the user's location every 15 minutes and I just want the application to continue sending the location even if the user closes the application in the taskbar. I tried this sample but it's in Xamarin.Android https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/services/foreground-services i have to create a dependencyservice but i don't know how. 回答1: i have to create a dependencyservice but i don't know how. First, create an Interface in the Xamarin.forms project:

How to play YouTube in Background with Android Webview?

泪湿孤枕 提交于 2020-07-19 06:22:32
问题 I want to "minimize" the application, leaving it in background doing exactly the same that when the ghostbutton mode is pressed when the user clicks a button (but don't finish it) How can I do that? So far I'm able to create a Activity . I've initialize my members and load the WebView with "https://www.youtube.com". I'm also able to create a Service that lets me minimize the Activity , but what I want is to minimize the Activity that I've my WebView loaded. Problem When the Activity paused,