This is a further question based on one of my previous questions. Creating an android service to run in the background using python I have looked at the recommendations made but I now wonder if it is possible to create the background service in python for android with no gui so it is almost like a passive service. Any help will be greatly appreciated.
Asked
Active
Viewed 575 times
1
-
Services don't have any GUI ... – 0101100101 Aug 22 '14 at 13:04
-
from my understanding to start the service it requires a gui – Daniel Prinsloo Aug 22 '14 at 13:04
1 Answers
1
I am not sure how to write a service for Android in Python. But you can maybe start your service using a BroadcastReceiver at boot time.You could register your broadcast receiver to filter intents with Intent.ACTION_BOOT_COMPLETED.

hoomi
- 1,882
- 2
- 16
- 17
-
do you have any links or example code that i could see (this is my first time developing for android so I am not fully sure how things should be set out i have read guides online but they are mostly in java) – Daniel Prinsloo Aug 22 '14 at 13:14
-
Have a look at http://stackoverflow.com/questions/11460941/broadcast-receiver-not-receiving-action-boot-completed. You have to read both question and answer – hoomi Aug 22 '14 at 13:17
-
So correct me if i'm wrong but i would only need the
portion of that code for it to start on boot? – Daniel Prinsloo Aug 22 '14 at 13:23 -
Correct!! You also need a class which extends BroadcastReceiver. Here is a tutorial on how to create a BroadcastReceiver http://www.vogella.com/tutorials/AndroidBroadcastReceiver/article.html – hoomi Aug 22 '14 at 13:25