Giter VIP home page Giter VIP logo

py4android's Introduction

py4android

A simple Python3 script to build Python static libraries for Android.

Of cause, by applying some changes easily, it would also work for shared libraries.

Tested on macOS 10.15 with NDK-r21 for Python 2.7.x.

If you dont work on macOS, you might have to change BUILD and NDK_TOOLCHAIN defined at front.

Usage

> python3 py4android.py [-h] [--api API] --version VERSION ARCH [ARCH ...]

Build Python for Android.

positional arguments:
  ARCH               currently supports: armeabi-v7a armv8a x86 x86_64

optional arguments:
  -h, --help         show this help message and exit
  --api API          specify Android API level (default 21)
  --version VERSION  specify Python version string (directory Python-<VERSION> must exists at this working path)
  • Download py4android.py along with Python source code
  • Unzip your Python-<VERSION>.tgz to Python-<VERSION> (within the same directory)
  • Hit commands like: python3 py4android.py --api 21 --version 2.7.14 armeabi-v7a armv8a x86 x86_64

    assuming you have define ANDROID_NDK_ROOT in your environ

  • Wait for compilations done, might take a while
  • If everything works fine. The include files could be found at prebuilt/android/<VERSION>/include, and the (static) libraries could be found at prebuilt/android/<VERSION>/libs/<ARCH>/libpython.a

py4android's People

Contributors

mustime avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

crackercat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.