/IDEKivyAndroid

IDEKivyAndroid is a custom Python IDE for Android built with Kivy. It allows execution of Python scripts using a native isolated interpreter, provided by a custom executable called mini_python.

Primary LanguagePythonMIT LicenseMIT

IDEKivyAndroid (Kivy-based Android Python Runner)

Author: SK Sahil (@Sahil-Pixel
Co-authors:


πŸ“Œ Overview

IDEKivyAndroid is a custom Python IDE for Android built with Kivy that executes Python scripts using an isolated native Python interpreter. It features:

  • A graphical interface for viewing output
  • Embedded Python interpreter (mini_python) compiled as a native executable
  • Support for Python’s multiprocessing module on Android
  • Full integration of Python's standard library and native modules (e.g. math, sqlite3)

This makes it ideal for Python education, quick script testing, and multiprocessing demonstrations directly on Android devices


πŸš€ Features

  • βœ… Kivy GUI with text-based output viewer
  • βœ… Embedded and user-defined script execution
  • βœ… Native mini_python ELF binary linked with libpython3.11.so
  • βœ… Support for multiprocessing using Process
  • βœ… Dynamic extraction of stdlib.zip from assets
  • βœ… Environment setup using Java's ProcessBuilder
  • βœ… Custom Recipe for python-for-android

πŸ“± How It Works

  1. App UI is built with Kivy (main.py) and embeds a script (SCRIPT_CODE).
  2. Python script is written to a file (script.py) at runtime.
  3. mini_python, a native ELF executable, is invoked via ProcessBuilder.
  4. The Python environment (PYTHONPATH, LD_LIBRARY_PATH, etc.) is configured dynamically.
  5. Standard library is unzipped if needed (stdlib.zip) to support modules.
  6. Script output and errors are displayed in the Kivy interface.

πŸ”§ Build Setup

Prerequisites

  • Python 3.11
  • python-for-android
  • buildozer
  • Android NDK (via buildozer)

Setup On Buildozer side

  • p4a.local_recipes = ./recipes
  • requirements = python3,kivy,minipython

To Build

  • buildozer android debug

πŸ“· Screenshot

Here's what the app looks like on Android:

IDEKivy screenshot