Search code examples
androidpythonsl4a

What kind of problems might one encounter if one runs SL4A continuously?


I have a small script, that functions as a broadcast receiver, and which I have programmed in Python (the script hands off processing to another main Python program). I don't know Java. In order for the receiver to function, however, SL4A naturally needs to keep running. As far as I can see:

  • SL4A does not hold a wakelock (which is not required for a broadcast receiving script anyway); no wakelock is indicated by GSAM Battery Monitor unless I explicitly acquire it with the wakeLockAcquirePartial (or whichever wakelock I need) API call. Hence it should not run down the battery too much.
  • Though it is described as "alpha quality" software, in a discussion in 2012 it was felt that SL4A was stable enough for the play store, and this option was only rejected because of the potential security problems involved in giving one app so many permissions.
  • I have seen SL4A crash, but that usually seemed to be the result of the script in question (e.g. not releasing a wakelock properly).

Given this, are any problems likely? I should note that the phone in question is not going to be used much for calls etc.


Solution

  • I ran an application with more than 3 threads for hours in daily use without a problem. But I used the method to turn the script into a standalone APK. This method can be found in the SL4A FAQ.