android-service

Kivy service stops when app is closed

99封情书 提交于 2019-12-02 05:38:59
I'm starting a service from my Kivy app: service = autoclass('net.saband.myapp.ServiceMyservice') mActivity = autoclass('org.kivy.android.PythonActivity').mActivity service.start(mActivity, '') It works. And if I close my app using the back button my service still works. But if I close my app by swiping it out from the recent apps list the service dies. I've found this issue and tried to use startForeground guided by this article . It works but the notification is not removable so this solution doesn't suit me. I've read this question and it looks like I could be helped using START_STICKY...

Hotword detection disabled with accessibly service

馋奶兔 提交于 2019-12-02 05:26:48
I've created a accessibly service for saving every toast message, but now hotword detection in Google Now will be disabled, if I activate my service. Logcat shows: W/HotwordState﹕ suspended: 11001001000000 And on Google Now you can see it with a different mic-icon. What could cause this behavior? Edit: The source code is on github now: https://github.com/mars3142/toaster To prevent false positives, hotword detection is disabled when a spoken feedback service is enabled. You have defined your service as providing all possible types of feedback, which includes spoken. android

how to make sure service is not killed

妖精的绣舞 提交于 2019-12-02 05:23:12
I am trying to write a music player in Android, and was trying to use service to play music in infinite loop in background. And I need the service to interact with the activity for volume control and so on. The question is, if I use service binder then the service will likely to be terminated with the activity when the activity is in the background. How to make sure the service can keep running without the activity and in activity some of the service's method can still be called? Is using foreground service with binder a solution? The service will not be killed in this way? Thanks in advance!

Sticky service not restarting when created in custom object

江枫思渺然 提交于 2019-12-02 05:21:55
问题 I had a Singleton object that had a bound service. I wanted it to restart, and when I start my application from launcher, singleton object will initialize and bind to this existing instance of service. Here is the code for creating and binding service in singleton: public class MyState { private static MyState sState; private MyService mService; private Context mContext; private boolean mBound = false; private ServiceConnection mConnection = new ServiceConnection() { @Override public void

Why does the background service stops while running?

送分小仙女□ 提交于 2019-12-02 05:10:20
I have a background service in my android application.In which a thread listening recent tasks running frequently.My service overrides both onCreate() and onStartCommand() methods. When i tried to open some applications like Gallery , Camera etc..., the service will be stopped.It calls the onCreate() method only and not onDestroy() or onStartCommand() .I tried to override onLowMemory() in this service but it logs nothing.The application saved internally by specifying android:installLocation="internalOnly" in the manifest file. Note: This issue noticed on Micromax A54 2.3.5 . Why does the

How to set the priority of android service?

心不动则不痛 提交于 2019-12-02 04:56:22
问题 Is there any way to set the priority of android service? I want to run the service in background after destroying App's main actvity. So i am returning "START_REDELIVERY_INTENT" from my service. But restarting of service is taking some time (around 1-3 minutes). I want to restart the service instantly. Is there any way to set the priority of android service. FYI, I am creating service using startService and passing an object through intent.putExtra(). Below snapshot is taken from setting/apps

Service pauses on screen lock

限于喜欢 提交于 2019-12-02 04:28:59
For testing purposes i have made a service that beeps every 1 minute. (No client-server interface yet). It beeps okay when the screen in on, but when it goes to sleep the beeping stops. I am making an application that has to periodically poll the a server for something. For this, I am trying to create a service that'll constantly be running in the background, poll the server every 1 min and then based on the reply from server it shall generate a task bar notification. I have a test activity with two buttons, 1 to start and the other to stop the service. And one service class named S_PS

Keeping a background service alive on Android

♀尐吖头ヾ 提交于 2019-12-02 03:22:17
问题 In reference to Accelerometer seems to only work for a few seconds? I'm using the BOOT_COMPLETED broadcast event to call the following: public class OnBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent service = new Intent(context, ShakeEventService.class); context.startService(service); } } Which in turn calls this: public class ShakeEventService extends Service { @Override public int onStartCommand(Intent intent, int flags, int

Update android Textview continuously

烈酒焚心 提交于 2019-12-02 03:17:19
问题 I am working on an Android Application which have an one activity class and service class. In service , Continuous bulk data (1090 bytes) will be received every 10 milliseconds. I need to update the text view continuously with these bulk data. What is recommended way to update Text view from a continuous background service? Service Class public class RecepService extends Service { public static Handler mHandler; StringBuilder hexstring; @Override public IBinder onBind(Intent intent) { return

Android: Which Background Service to use?

我是研究僧i 提交于 2019-12-02 03:14:35
I have an app where a user can perform a backup (offline) and restore (offline) on a button click. However, i don't know which background service is appropriate to use. Can someone advise me whether to use WorkerManager or Service in this case? Mr.AF I recommend you to use ForegroundService as of the goal of using these services are Long Running Processes that Users should be informed and interact with it . Consider when you try to backup when you Use ForegroundService then you can show to user The process left to end Cancel Backup Pause and etc So I recommend you to use this approach . 来源: