foreground-service

Constant background running process - even when app is not in use

柔情痞子 提交于 2020-06-17 04:19:06
问题 I am working with other contributors on an open-source project in which we have made an Android App. Whenever the app is opened we get a notification that the app is running in the background and even when the app session is terminated, the notification doesn't go away. Here is the link for the project The app has a lot of classes which could be the reason but we are not able to narrow it down. Though we do think that it could be the BluetoothService activity which uses Bluetooth signals. The

Xamarin service - run according to a time schedule

主宰稳场 提交于 2020-05-17 07:42:24
问题 I am developing an app built on this example: https://github.com/xamarin/mobile-samples/tree/master/BackgroundLocationDemo The example works and the location updates are coming in as expected. However, Android keeps showing an notification that the service is running and draining battery. Now, all my users have a defined working schedule (list of Start to End DateTime per day e.g 8am-1pm, 4pm-8pm), and I want that the service is only running between those working times. This means that I need

Foreground service notification always shown for at least 5 seconds

跟風遠走 提交于 2020-05-15 08:52:27
问题 I noticed some very strange behavior when testing foreground notifications on Android 9. Situation : I have some foreground services where I don't know how long they'll need to run for, be it 1 second or a whole minute. Finally, when the service is done, it will call stopForeground(true) . This used to work fine on all Android 8, 9 and 10 devices, where stopForeground(true) , even if called immediately, always reliably removed the notification. Problem : Testing on a Fairphone 3 (and I hope

Is there any way to run a foreground service in react native?

丶灬走出姿态 提交于 2020-05-13 07:31:07
问题 I've been doing a few searches on google trying to find a way to run foreground services in react native but I haven't found much about it. Is anyone aware of how to accomplish this? This is what I mean by foreground service: https://developer.android.com/guide/components/services.html#Foreground 回答1: I have an example React Native Foreground Service app here. In this example, I'm doing a Bluetooth scan every 10 seconds and attempting to run a Foreground Service so that the scans will

Is there any way to run a foreground service in react native?

情到浓时终转凉″ 提交于 2020-05-13 07:31:02
问题 I've been doing a few searches on google trying to find a way to run foreground services in react native but I haven't found much about it. Is anyone aware of how to accomplish this? This is what I mean by foreground service: https://developer.android.com/guide/components/services.html#Foreground 回答1: I have an example React Native Foreground Service app here. In this example, I'm doing a Bluetooth scan every 10 seconds and attempting to run a Foreground Service so that the scans will

Is there any way to run a foreground service in react native?

拜拜、爱过 提交于 2020-05-13 07:29:25
问题 I've been doing a few searches on google trying to find a way to run foreground services in react native but I haven't found much about it. Is anyone aware of how to accomplish this? This is what I mean by foreground service: https://developer.android.com/guide/components/services.html#Foreground 回答1: I have an example React Native Foreground Service app here. In this example, I'm doing a Bluetooth scan every 10 seconds and attempting to run a Foreground Service so that the scans will

Check if Foreground service is running in Android OREO

有些话、适合烂在心里 提交于 2020-05-12 04:56:39
问题 I want to check whether my service is running in or not, I was using below code which was working fine till nougat but not working in OREO private boolean isMyServiceRunning(Class<?> serviceClass, Context context) { ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { Log.d(TAG, "isMyServiceRunning: " + service.service.getClassName()); if (serviceClass

Check if Foreground service is running in Android OREO

牧云@^-^@ 提交于 2020-05-12 04:55:47
问题 I want to check whether my service is running in or not, I was using below code which was working fine till nougat but not working in OREO private boolean isMyServiceRunning(Class<?> serviceClass, Context context) { ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { Log.d(TAG, "isMyServiceRunning: " + service.service.getClassName()); if (serviceClass

Is notification mandatory while app is running(visible) for the foreground service in API>25

廉价感情. 提交于 2020-03-05 03:02:52
问题 From the stackoverflow and many blogs, i surely understand that foreground service never run without notification in API>25. But still i confuse that Is notification mandory while app is running on screen or visible. For eg. no need of notification when user stand within app. So is this possible to remove notification while app running ? In service class @Override public int onStartCommand(Intent intent, int flags, int startId) { ...... if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

Large number of RemoteServiceExceptions in Google's cast MediaNotificationService

徘徊边缘 提交于 2020-02-26 09:51:30
问题 In the last ~24 hours, we've seen a few thousand crashes within Google's MediaNotificationService : Fatal Exception: android.app.RemoteServiceException Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{f9a4deb u0 <our package name>/com.google.android.gms.cast.framework.media.MediaNotificationService} android.app.ActivityThread$H.handleMessage (ActivityThread.java:1855) android.os.Handler.dispatchMessage (Handler.java:106) android.os.Looper.loop