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
-
openSUSE Joins End of 10
openSUSE has decided to not only join the End of 10 movement but it also will no longer support the Deepin Desktop Environment.
-
New Version of Flatpak Released
Flatpak 1.16.1 is now available as the latest, stable version with various improvements.
-
IBM Announces Powerhouse Linux Server
IBM has unleashed a seriously powerful Linux server with the LinuxONE Emperor 5.
-
Plasma Ends LTS Releases
The KDE Plasma development team is doing away with the LTS releases for a good reason.
-
Arch Linux Available for Windows Subsystem for Linux
If you've ever wanted to use a rolling release distribution with WSL, now's your chance.
-
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.