<commit_before>Buildozer
=========

Buildozer is a tool for creating application packages easily.

The goal is to have one "buildozer.spec" file in your app directory, describing
your application requirements and settings such as title, icon, included modules
etc. Buildozer will use that spec to create a package for Android, iOS, Windows,
OSX and/or Linux.

Buildozer currently supports packaging for Android via the `python-for-android
<http://github.com/kivy/python-for-android/>`_
project, and for iOS via the kivy-ios project. iOS and OSX are still under work.

For Android: please have a look at `Android-SDK-NDK-Informations
<https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Informations>`_. Please note that
the default SDK/NDK coded in Buildozer works for Python 2.

We provide a ready-to-use `Virtual Machine for Virtualbox <https://kivy.org/#download>`_.

Note that this tool has nothing to do with the eponymous online build service
`buildozer.io <http://buildozer.io />`_.

Installing Buildozer with python2 support:
------------------------------------------

#. Install buildozer::

    # via pip (latest stable, recommended)
    sudo pip install buildozer

    # latest dev version
    sudo pip install https://github.com/kivy/buildozer/archive/master.zip

    # git clone, for working on buildozer
    git clone https://github.com/kivy/buildozer
    cd buildozer
    python setup.py build
    sudo pip install -e .

#. Go into your application directory and run::

    buildozer init
    # edit the buildozer.spec, then
    buildozer android debug deploy run

Installing Buildozer with python3 support:
------------------------------------------

The pip package does not yet support python3.

#. Install buildozer from source::

    git clone https://github.com/kivy/buildozer
    cd buildozer
    python setup.py build
    sudo pip install -e .

#. Download and extract the Crystax NDK somewhere (~/.buildozer/crystax-ndk is one option): https://www.crystax.net/en/download
#. Go into your application directory and execute::

    buildozer init

#. Make sure the following lines are in your buildozer.spec file.::

    # Require python3crystax:
    requirements = python3crystax,kivy

    # Point to the directory where you extracted the crystax-ndk:
    android.ndk_path = <Your install path here.  Use ~ for home DIR>

#. Finally, build, deploy and run the app on your phone::

    buildozer android debug deploy run

#.  Please note the "android" buildozer target, and use that for any and all buildozer commands you run (even if the docs just say "android").


Buildozer Docker image
----------------------

A Dockerfile is available to use buildozer through a Docker environment.

#. Build with::

    docker build --tag=buildozer .

#. Run with::

    docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version<commit_msg>Updates Python 3 install instructions, fixes #710<commit_after>Buildozer
=========

Buildozer is a tool for creating application packages easily.

The goal is to have one "buildozer.spec" file in your app directory, describing
your application requirements and settings such as title, icon, included modules
etc. Buildozer will use that spec to create a package for Android, iOS, Windows,
OSX and/or Linux.

Buildozer currently supports packaging for Android via the `python-for-android
<http://github.com/kivy/python-for-android/>`_
project, and for iOS via the kivy-ios project. iOS and OSX are still under work.

For Android: please have a look at `Android-SDK-NDK-Informations
<https://github.com/kivy/kivy/wiki/Android-SDK-NDK-Informations>`_. Please note that
the default SDK/NDK coded in Buildozer works for target Python 2.
For target Python 3 see `Installing Buildozer with target Python 3 (CrystaX)
<#installing-buildozer-with-target-python-3-crystax>`_.
For host Python, both versions are seamlessly supported.

We provide a ready-to-use `Virtual Machine for Virtualbox <https://kivy.org/#download>`_.

Note that this tool has nothing to do with the eponymous online build service
`buildozer.io <http://buildozer.io />`_.

Installing Buildozer with target Python 2 (default):
----------------------------------------------------

#. Install buildozer::

    # via pip (latest stable, recommended)
    sudo pip install buildozer

    # latest dev version
    sudo pip install https://github.com/kivy/buildozer/archive/master.zip

    # git clone, for working on buildozer
    git clone https://github.com/kivy/buildozer
    cd buildozer
    python setup.py build
    sudo pip install -e .

#. Go into your application directory and run::

    buildozer init
    # edit the buildozer.spec, then
    buildozer android debug deploy run

Installing Buildozer with target Python 3 (CrystaX):
----------------------------------------------------

After following the steps above to install buildozer and generate the default spec file,
you need to setup Crystax NDK as described below.

#. Download and extract the Crystax NDK somewhere (~/.buildozer/crystax-ndk is one option): https://www.crystax.net/en/download

#. Make sure the following lines are in your buildozer.spec file.::

    # Require python3crystax:
    requirements = python3crystax,kivy

    # Point to the directory where you extracted the crystax-ndk:
    android.ndk_path = <Your install path here.  Use ~ for home DIR>

#. Finally, build, deploy and run the app on your phone::

    buildozer android debug deploy run



Buildozer Docker image
----------------------

A Dockerfile is available to use buildozer through a Docker environment.

#. Build with::

    docker build --tag=buildozer .

#. Run with::

    docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version
{'fraction_non_alphanumeric': 0.11828521434820648, 'fraction_numerical': 0.0031496062992125984, 'mean_word_length': 3.109273903666427, 'pattern_counts': {'":': 2, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 11, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752785', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1587, 'n_words': 657}