Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a kivy application using buildozer and the latest kivy?

Tags:

kivy

Using buildozer I have successfully built and run an Android application. Buildozer uses kivy-stable (1.7)

How do I build a kivy application using the latest kivy 1.8 ?

I noticed at https://github.com/kivy/python-for-android/blob/master/recipes/kivy/recipe.sh the lines

VERSION_kivy=${VERSION_kivy:-stable}
URL_kivy=https://github.com/kivy/kivy/zipball/$VERSION_kivy/kivy-$VERSION_kivy.zip

Does this mean that only the kivy-stable version can be used with buildozer ?

Thanks

like image 326
user2915097 Avatar asked Nov 07 '13 11:11

user2915097


People also ask

Which Python version is best for Kivy?

0 Kivy supports both Python >= 2.7 and Python >= 3.4 with the same codebase. Python 3 is also now supported by python-for-android. However, be aware that while Kivy will run in Python 3.4+, our iOS build tools still require Python 2.7.

What is Buildozer Kivy?

Buildozer is a tool that aim to package mobiles application easily. It automates the entire build process, download the prerequisites like python-for-android, Android SDK, NDK, etc.

How do I deploy my Kivy app?

Packaging your application for the Kivy Launcher¶Go on Google Play Store and search for Kivy Launcher from kivy org. Click on Install. Select your phone… And you're done!


1 Answers

I can't remember if buildozer has a switch to use kivy master (1.8 is unreleased), but you can certainly make it work. Here's a few instructions assuming your shell is something bash-like.

First, create your own local kivy repository:

git clone https://github.com/kivy/kivy.git

Second, export the environment variable P4A_kivy_DIR to point at this directory. If this variable exists, python-for-android (including the one downloaded and used by buildozer) will use that directory to build kivy.

export P4A_kivy_DIR="$PWD/kivy$
echo $P4A_kivy_DIR

The second line should print out the directory of your newly cloned kivy.

You can then run buildozer. You might need to first delete the .buildozer file in your app dir, or more specifically some of the python-for-android components - easiest is just to do

rm -rf /path/to/your/app/.buildozer/android/platform/python-for-android

After that, just run buildozer and the python-for-android component should use your copy of kivy master.

If you want this behaviour to automatically work every time, you could put the export line in your .bashrc or some other suitable shell setup file. If you don't do this, you'll need to run the export line every time you create or replace a .buildozer directory.

like image 172
inclement Avatar answered Sep 19 '22 16:09

inclement