I have a python service as bot.py
bot.py
import time
i = 0
while (True):
time.sleep(1)
i += 1
print(i)
calling it from main.py
if platform == 'android':
service = autoclass('org.test.myapp.ServiceBot')
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
argument = ''
service.start(mActivity, argument)
after calling the service to run I want to keep this task(ServiceBot) running after closing the app, how I can implement that?
the log output after closing the app:
01-15 14:47:32.961 890 1391 I ActivityManager: Killing 28386:org.test.myapp:service_bot/u0a166 (adj 5): remove task
01-15 14:47:33.015 890 901 D ActivityManager: SVC-handleAppDiedLocked: app = ProcessRecord{69c2e8 28386:org.test.myapp:service_bot/u0a166}, app.pid = 28386