Using Python for Android and QPython
Instant App
Do you want to teach your Android device some clever tricks without mastering the art of native app development? Install Python, and you can automate practically any task and write complete apps using this popular scripting language.
To make it easier to run various scripting languages on the Android platform, Google created the Scripting Layer for Android (SL4A) project [1]. Although Google at some point has lost interest in maintaining the project, the last release of the framework runs perfectly well on any Android version before 5.0. The Python for Android component includes Python 2.6, so practically any script compatible with this version of Python will work on Android. More importantly, the combination of the scripting layer and Python for Android can be used to access Android APIs, so you can write Python scripts that offer the same functionality as native Android apps.
That's all fine and dandy, but it looks like the SL4A project is no longer maintained, and the available APK packages don't run well on Android 5.0 and higher. Thankfully, the project's code is released under the Apache License 2.0, so the SL4A [2] and Python for Android [3] parts have already been forked and updated to work with Android 5.0.
The SL4A and Python for Android pair is not the only option for using Python for Android. The QPython project [4] aims to build an entire Python environment for the Android platform (Figure 1). QPython is available in Google Play Store in two editions: QPython is based on the Python 2.x series [5], and QPython3 comes with Python 3.x [6]. Both versions are packed with useful features. What's more, QPython supports SL4A, so it provides a drop-in replacement for Google's Scripting Layer for Android and Python for Android. The environment comes with the PIP package manager, which allows you to add practically any Python library and module to your project.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

News
-
System76 Releases COSMIC Alpha 7
With scores of bug fixes and a really cool workspaces feature, COSMIC is looking to soon migrate from alpha to beta.
-
OpenMandriva Lx 6.0 Available for Installation
The latest release of OpenMandriva has arrived with a new kernel, an updated Plasma desktop, and a server edition.
-
TrueNAS 25.04 Arrives with Thousands of Changes
One of the most popular Linux-based NAS solutions has rolled out the latest edition, based on Ubuntu 25.04.
-
Fedora 42 Available with Two New Spins
The latest release from the Fedora Project includes the usual updates, a new kernel, an official KDE Plasma spin, and a new System76 spin.
-
So Long, ArcoLinux
The ArcoLinux distribution is the latest Linux distribution to shut down.
-
What Open Source Pros Look for in a Job Role
Learn what professionals in technical and non-technical roles say is most important when seeking a new position.
-
Asahi Linux Runs into Issues with M4 Support
Due to Apple Silicon changes, the Asahi Linux project is at odds with adding support for the M4 chips.
-
Plasma 6.3.4 Now Available
Although not a major release, Plasma 6.3.4 does fix some bugs and offer a subtle change for the Plasma sidebar.
-
Linux Kernel 6.15 First Release Candidate Now Available
Linux Torvalds has announced that the release candidate for the final release of the Linux 6.15 series is now available.
-
Akamai Will Host kernel.org
The organization dedicated to cloud-based solutions has agreed to host kernel.org to deliver long-term stability for the development team.