We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc778b3 commit bbf5db4Copy full SHA for bbf5db4
doc/source/services.rst
@@ -215,3 +215,24 @@ Then need create ``MyBroadcastReceiver.java``, code::
215
}
216
217
218
+
219
+This code start ``service.py`` from ``buildozer.spec`` when get signal ``ACTION_BOOT_COMPLETED``::
220
221
+ services = Test:./service.py:foreground
222
223
+For example ``service.py``::
224
225
+ import os
226
+ from time import sleep
227
228
+ from jnius import cast
229
+ from jnius import autoclass
230
231
+ PythonService = autoclass('org.kivy.android.PythonService')
232
+ CurrentActivityService = cast("android.app.Service", PythonService.mService)
233
234
+ while True:
235
+ print("python service running.....", CurrentActivityService.getPackageName(), os.getpid())
236
+ sleep(10)
237
238
0 commit comments