Merge pull request #1593 from inclement/docfixes

APK building doc tweaks, including adding buildozer
This commit is contained in:
Mathieu Virbel 2013-11-03 04:59:25 -08:00
commit 90f9bdd836
6 changed files with 74 additions and 16 deletions

View File

@ -3,18 +3,22 @@
Create a package for Android
============================
You can create a package for android using the `python-for-android
<https://github.com/kivy/python-for-android>`_ project. This page explains how to
download and use it directly on your own machine (see
:ref:`Packaging your application into APK`), use the prebuilt :ref:`testdrive` virtual
machine image, or use the :ref:`buildozer` tool to automate the entire
process. You can also see :ref:`Packaging your application for Kivy Launcher` to run kivy
programs without compiling them.
.. _Packaging your application into APK:
TestDrive
---------
There is a VirtualBox Image we provide with the prerequisites along with
the Android SDK and NDK preinstalled to ease your installation woes. You can
download it from `here <http://kivy.org/#download>`_.
Packaging your application into an APK
--------------------------------------
This section describes how to download and use python-for-android directly.
You'll need:
- A linux computer or virtual machine
@ -128,6 +132,60 @@ http://developer.android.com/guide/publishing/app-signing.html
The release binary will be generated in
bin/KivyTouchtracer-1.1.0-release-unsigned.apk (for the previous touchtracer example.)
.. _testdrive:
TestDrive
---------
We provide a VirtualBox Image with python-for-android along with
the Android SDK and NDK preinstalled to ease your installation woes. You can
download it from `here <http://kivy.org/#download>`_.
Once the VM is loaded, you can follow the instructions from
:ref:`Packaging your application into APK`. You don't need to download
with `git clone` though, as python-for-android is already installed
and set up in the virtual machine home directory.
.. _Buildozer:
Buildozer
---------
Buildozer is a tool that automates the entire build process. It
downloads and sets up all the prequisites for python-for-android,
including the android SDK and NDK, then builds an apk that can be
automatically pushed to the device.
Buildozer currently works only in Linux, and is an alpha
release, but it already works well and can significantly simplify the
apk build.
You can get buildozer at `<https://github.com/kivy/buildozer>`_::
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python2.7 setup.py install
This will install buildozer in your system. Afterwards, navigate to
your project directory and run::
buildozer init
This creates a `buildozer.spec` file controlling your build
configuration. You should edit it appropriately with your app name
etc. You can set variables to control most or all of the parameters
passed to python-for-android.
Afterwards, plug in your android device and run::
buildozer android debug deploy run
to build, push and automatically run the apk on your device.
You can check the buildozer README at
`<https://github.com/kivy/buildozer>`_ for more documentation of
buildozer's capabilities.
.. _Packaging your application for Kivy Launcher:
Packaging your application for the Kivy Launcher

View File

@ -372,7 +372,7 @@ cdef class EventDispatcher(ObjectWithUid):
return self.__properties[name]
cpdef dict properties(EventDispatcher self):
'''Return all the properties in that class in a dictionnary of
'''Return all the properties in that class in a dictionary of
key/property class. Can be used for introspection.
.. versionadded:: 1.0.9

View File

@ -30,7 +30,7 @@ mixer.set_num_channels(32)
class SoundPygame(Sound):
# XXX we don't set __slots__ here, to automaticly add
# a dictionnary. We need that to be able to use weakref for
# a dictionary. We need that to be able to use weakref for
# SoundPygame object. Otherwise, it failed with:
# TypeError: cannot create weak reference to 'SoundPygame' object
# We use our clock in play() method.

View File

@ -89,13 +89,13 @@ from time import time
from kivy.vector import Vector
class EnhancedDictionnary(dict):
class EnhancedDictionary(dict):
def __getattr__(self, attr):
try:
return self.__getitem__(attr)
except KeyError:
return super(EnhancedDictionnary, self).__getattr__(attr)
return super(EnhancedDictionary, self).__getattr__(attr)
def __setattr__(self, attr, value):
self.__setitem__(attr, value)
@ -273,9 +273,9 @@ class MotionEvent(MotionEventBase):
#: .. versionadded:: 1.7.0
self.triple_tap_time = 0
#: User data dictionnary. Use this dictionnary to save your own data on
#: User data dictionary. Use this dictionary to save your own data on
#: the touch.
self.ud = EnhancedDictionnary()
self.ud = EnhancedDictionary()
self.depack(args)

View File

@ -1573,7 +1573,7 @@ class BuilderBase(object):
if Factory_is_template(cname):
# we got a template, so extract all the properties and
# handlers, and push them in a "ctx" dictionnary.
# handlers, and push them in a "ctx" dictionary.
ctx = {}
idmap = copy(global_idmap)
idmap.update({'root': rctx['ids']['root']})

View File

@ -1,8 +1,8 @@
'''
Dictionnary store
Dictionary store
=================
Use a Python dictionnary as a store.
Use a Python dictionary as a store.
'''
__all__ = ('DictStore', )