android-service

Can accessibility service be stopped or killed?

余生颓废 提交于 2019-12-02 02:46:28
I have written an accessibility service and I want the service to be stopped/killed once it receives an accessibility event (i.e. in method onAccessibilityEvent ). Can this be done? I have tried to kill using kill process as below but it is not working. unbindService(mSvcConn); android.os.Process.killProcess(android.os.Process.myPid()); I have given the below permission in AndroidManifest.xml <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /> I know that accessibility service cannot be started programmatically but can't it be stopped/killed either? alanv An

Gesture Listener across entire device

三世轮回 提交于 2019-12-02 02:25:53
问题 I was looking at an application (SwipePad), and noticed that after the application launches, it detects gestures across the entire platform, even after the main part of the application as been sent to the back (onPause... i.e. it isn't the current activity). It looks like it's using some kind of system service to keep itself alive, but how is it still getting the gesture from the bezel at the system level like that? It also was interesting that the application itself isn't using root. Any

ActivityNotFoundException while trying to start a service.

孤街浪徒 提交于 2019-12-02 02:19:48
I am getting an Activity not found exception while trying to start a service. I have the service registered in the Manifest. Adding what I think is the relevant code and the LogCat. Let me know if you need to see any more. 01-29 17:41:51.440 9196-9196/drvr.drvlog E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: drvr.drvlog, PID: 9196 android.content.ActivityNotFoundException: Unable to find explicit activity class {drvr.drvlog/drvr.drvlog.GPSService}; have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1719)

Doubts about bindService

只谈情不闲聊 提交于 2019-12-02 01:28:54
问题 I have some boubts about Android bound service. The guide: http://developer.android.com/guide/components/bound-services.html ,about bindService() , says: The `bindService()` method returns immediately without a value But this does not seems to be correct, since here the signature of the method is public abstract boolean bindService (Intent service, ServiceConnection conn, int flags) where the returned boolean value is described as below: If you have successfully bound to the service, true is

Gesture Listener across entire device

我与影子孤独终老i 提交于 2019-12-02 00:58:41
I was looking at an application (SwipePad), and noticed that after the application launches, it detects gestures across the entire platform, even after the main part of the application as been sent to the back (onPause... i.e. it isn't the current activity). It looks like it's using some kind of system service to keep itself alive, but how is it still getting the gesture from the bezel at the system level like that? It also was interesting that the application itself isn't using root. Any thoughts? hatcyl You can make layouts that can sit on top of all other windows. They will be running from

Sticky service not restarting when created in custom object

心不动则不痛 提交于 2019-12-01 23:42:59
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 onServiceConnected(ComponentName name, IBinder service) { MyService.MyBinder binder = (MyService.MyBinder)

OnServiceConnected not getting called

北慕城南 提交于 2019-12-01 23:39:05
问题 I referred to the following questions already but could not find an answer: Can't get service object (onServiceConnected never called), onServiceConnected not getting called , getting a null pointer exception, and onServiceConnected never called after bindService method Here is my code: @Override public void onStart() { super.onStart(); Context context = getApplicationContext(); Intent intent = new Intent(context, PodService.class); context.bindService(intent, mPodServiceConn, Context.BIND

Change notification intent in Android

試著忘記壹切 提交于 2019-12-01 23:08:03
问题 I have a service that shows a notification that I wish that will be able to go to a specific activity of my app each time the user presses on it. Usually it would be the last one that the user has shown, but not always. If the activity was started before, it should return to it, and if not, it should open it inside of the app's task, adding it to the activities tasks. In addition, on some cases according to the service's logic, I wish to change the notification's intent so that it will target

OnServiceConnected not getting called

点点圈 提交于 2019-12-01 21:43:37
I referred to the following questions already but could not find an answer: Can't get service object (onServiceConnected never called) , onServiceConnected not getting called , getting a null pointer exception , and onServiceConnected never called after bindService method Here is my code: @Override public void onStart() { super.onStart(); Context context = getApplicationContext(); Intent intent = new Intent(context, PodService.class); context.bindService(intent, mPodServiceConn, Context.BIND_AUTO_CREATE); } private ServiceConnection mPodServiceConn = new ServiceConnection() { @Override public

use registerReceiver for non activity and non service class

不问归期 提交于 2019-12-01 21:39:38
I am trying to registerReceiver for BluetoothDevice events like ACTION_ACL_CONNECTED , ACTION_ACL_DISCONNECTED . But the class in which I am using registerReceiver does not extend Activity class nor Service class - so I am passing Context to that class and registering receiver as follows context.registerReceiver(ActionFoundReceiver, new IntentFilter(BluetoothDevice.ACTION_ACL_CONNECTED)); context.registerReceiver(ActionFoundReceiver, new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECTED)); context.registerReceiver(ActionFoundReceiver, new IntentFilter(BluetoothDevice.ACTION_ACL_DISCONNECT