Search code examples
androidpythonsl4aqpython

How Can I Write/Run Python On Galaxy Note 3? And What Is SL4A?


For reasons not understood by most, I'm trying to write/run python code on my Galaxy Note 3. So far, I've installed the apps: "QPython", "Script Launcher", and "Droid Edit". In QPython, whenever I run a script, it takes me to a terminal looking window and just sits there. It doesn't even print "Hello World!" like it should. Occasionally, it runs for a split second and QPython just says "Script Ended". I've been advised to something called SL4A that I don't completely understand.

I've installed the .apk anyways, but when I attempt to run a program from Droid Edit in SL4A in background mode, I get a pop up saying "Unfortunately, SL4A has stopped." and if I click the run in terminal option I get a notification saying "Unable to open....". Has anybody had any luck with any of these running on a note 3? QPython and Droid Edit seem the most legitimate, but I can't get either to run this simple code. Thanks in advance for help!


Solution

  • The Scripting Layer for Android (abridged as SL4A, and previously named Android Scripting Environment or ASE) is a library that allows the creation and running of scripts written in various scripting languages directly on Android devices.

    QPython is a port to Python and let you access features of SL4A, execute python code & projects. It allows you to install other Python libraries via "pip", too.

    Have you tried QPython Console and see if your code runs? I have used QPython in my Note 2 and everything runs smoothly.

    I suggest you review your apk build and see if there is any error or misconfiguration. You can see this for more details http://qpython.org/question/18/how-to-use-qpython-in-my-android-development/ If you are interested in building native android apps in Python, check out Kivy too, it's a great framework for you to build cross-platform native apps.

    I have not tried Driod Edit before so cannot comment.