Open-source project
qpython-android/qpython avatar
qpython-android/qpython

QPython: Android Python Engine with SL4A Device Control

QPython is an Android Python engine primarily designed for Python and AI learners. It offers a range of impressive features to enhance Python programming experience.

1,219 stars209 forksJavaLicense varies

At a glance

What is it?
QPython is a Python runtime for Android that bundles an interpreter, editor, and SL4A integration for accessing device hardware such as the camera, sensors, and SMS, available in two branches targeting beginners (Ox) and experienced developers (3x).
Who is it for?
QPython is the right tool for Android developers or learners who want to write Python scripts that interact with Android hardware through SL4A, including camera, sensors, and SMS APIs, without requiring a desktop machine. The Ox branch suits beginners and the 3x branch suits experienced users who need advanced features.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 169 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Python on Android with Direct Device Hardware Access

Running Python on a mobile device is useful for automation, learning, and scripted device control, but mobile Python environments typically offer a sandboxed interpreter that cannot reach hardware APIs. QPython extends a standard Python runtime with SL4A (Scripting Layer for Android), which exposes Android device APIs to Python scripts: camera, sensors, SMS, media, GPS, and other hardware-level interfaces that are normally accessible only through Java or Kotlin.

This makes QPython distinctly different from Python IDEs that happen to run on Android. The primary goal, as the README states directly, is to use Python to drive your Android device. A script can read accelerometer data, send an SMS, take a photo, or access the location service through the qpysl4a API. QPython targets Android developers who want a Python scripting layer, Python learners who want to practice on a phone, and automation users who want device-level control from Python.

Two Branches: Ox for Beginners, 3x for Advanced Users

QPython ships in two branches with different feature sets. QPython Ox is aimed at programming learners. It provides more approachable features for beginners and is the branch whose source code lives in the main qpython repository on GitHub. QPython 3x is aimed at experienced Python users and provides advanced technical features not present in Ox. The README links to a separate documentation page for each branch's features: qpython_3x_featues.rst for 3x and qpython_ox_featues.rst for Ox, both hosted in the qpython.org repository.

The current repository is specifically the QPython Ox project. The README provides a link to a Google Drive download for QPython 3.2.5 as the newest available APK, separate from the source build. The distinction matters because users looking for the advanced 3x features will not find them in this source repository. Both branches use the SL4A integration as their core differentiator from other Android Python tools.

Building QPython from Source

Building QPython from source requires macOS or Ubuntu with Android Studio. The README notes that Ubuntu may work but macOS is the primary documented path. After cloning, the build process initializes submodules before the Android Gradle build:

bash
git clone [email protected]:qpython-android/qpython.git
git submodule init
git submodule sync
git submodule update

After the submodule step, the project is built through Android Studio. The repository structure separates the main QPython code in the qpython/ module from the supporting libraries: qftplib, qpypluginman/, qpysdk/, qpysl4a, termemulator/, and termexec/. The qpysl4a submodule provides the SL4A API bindings, and a linked document lists the available APIs and test scripts.

Most users will install the pre-built APK rather than building from source. The README links to the Google Play store listing and a Google Drive APK for the current 3.2.5 release.

SL4A API Coverage and What Scripts Can Do

The SL4A layer in QPython exposes Android APIs through a local socket connection between the Python interpreter and an Android service. Scripts import Android functionality through qpysl4a and make API calls that translate to Android system calls.

The README notes that good SL4A support is the main goal, with specific examples including camera, sensor, SMS, and media APIs. The qpysl4a repository documents the available API methods; the README links to the API documentation and a set of test scripts. This coverage is the main reason to choose QPython over a generic Android Python interpreter: scripts that need device hardware access have a documented path through SL4A, whereas alternatives that implement only a Python interpreter cannot reach those APIs.

The QPYI component is part of the Ox branch for learners. The README mentions it as one of the notable features alongside the editor and SL4A, but does not detail its scope in the main README text.

Limitations: No Disclosed License and Aging Releases

The repository does not list a license in its metadata. The README does not mention a license file. This means the legal status of the source code is undefined, which creates risk for any use beyond personal reference. Teams that need to incorporate QPython code into another project should contact the maintainers before doing so.

The last published GitHub release is v3.2.3, dated February 8, 2023. The README links to a Google Drive APK for v3.2.5, but that version does not have a corresponding GitHub release. The last push to the main branch was on 2026-04-14. Package support for third-party Python libraries is tracked separately in the qpypi repository. Users who encounter a missing package should file a request there rather than in the main app repository.

Pydroid 3 is the primary alternative for Android Python development. Pydroid 3 provides a more polished IDE experience, pip integration, and a broader library support surface. QPython's specific advantage over Pydroid 3 is the SL4A integration: if a use case requires calling Android hardware APIs from Python, QPython is the tool that documents a path to do that. Pydroid 3 does not include SL4A.

Community, Support, and Repository Organization

QPython has active community channels for both English and Chinese speakers. English-speaking users can join the QPython Group on Facebook for general discussion, the QPython Slack workspace for contributor conversation, and the QPython Discord server. The README provides invite links for Slack and Discord. Chinese-speaking users have a WeChat group accessible via QR code in the README.

For bug reports, the README asks users to include phone and Android OS information, the QPython branch (Ox or 3x), the code that triggered the issue, where QPython was installed from, and a detailed description. Issues are split across three repositories: the main app in this repository, non-app issues in the qpython.org repository, and package support requests in qpypi.

The source repository uses Git submodules for several components. The qpysl4a, qftplib, and termemulator directories are submodules, which is why the build process requires three git submodule commands before the Android Gradle build. Anyone cloning the repository to study the SL4A API implementation should run the submodule initialization step first, otherwise those directories will be empty. The wiki linked in the README documents the development setup in more detail.

Editorial conclusion

QPython is the right tool for Android developers or learners who want to write Python scripts that interact with Android hardware through SL4A, including camera, sensors, and SMS APIs, without requiring a desktop machine. The Ox branch suits beginners and the 3x branch suits experienced users who need advanced features. The latest available release is v3.2.3 from February 2023, and the last push to the main branch was on 2026-04-14. The repository has no disclosed license, which is a practical constraint for any deployment beyond personal use.

Frequently asked questions

what is qpython

QPython is a Python engine for Android that includes a Python interpreter, a code editor, SL4A integration for Android device API access, and QPYI. It allows Python scripts to control Android hardware such as the camera, sensors, and SMS.

qpython vs pydroid

QPython's primary distinction from Pydroid 3 is SL4A integration, which lets Python scripts call Android device APIs such as camera, sensors, and SMS. Pydroid 3 offers a more polished IDE experience and broader library support but does not include SL4A.

how to use qpython

Install QPython from Google Play or the APK linked in the README, create a Python script in the built-in editor, and import qpysl4a to access Android device APIs. The qpysl4a documentation and test scripts are linked in the README for reference.

Official sources

  1. Issues
  2. Project website
  3. qpython-android/qpython on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/qpython-android-qpython.svg)](https://hysenlabs.com/projects/qpython-android-qpython)