Skip to content Skip to sidebar Skip to footer

Creating An Android Service To Run In The Background Using Python

I would like to know if it is possible to run an android service in the background (and possibly on boot) without rooting the device, using python and sl4a and if so how would i go

Solution 1:

For running a service in background or on boot you have to define a Broadcast Receiver which will basically start the service.

Please refer code snippets mentioned in the answer of below question.

Android BroadcastReceiver on startup - keep running when Activity is in Background

I have seen some information about developing in python on pythoncentral but I have never developed a service using python/sl4a.


Solution 2:

If anyone is looking for a python for android (p4a) solution:

python-for-android supports the use of Android Services, background tasks running in separate processes. These are the closest Android equivalent to multiprocessing on e.g. desktop platforms, and it is not possible to use normal multiprocessing on Android. Services are also the only way to run code when your app is not currently opened by the user.


Post a Comment for "Creating An Android Service To Run In The Background Using Python"