The Kivy GUI is used with Electrum on Android devices. To generate an APK file, follow these instructions.
p4a is used to package Electrum, Python, SDL and a bootstrap Java app into an APK file. We patched p4a to add some functionality we need for Electrum. Until those changes are merged into p4a, you need to merge them locally (into the master branch):
Something like this should work:
cd /opt
git clone https://github.com/kivy/python-for-android
cd python-for-android
git remote add agilewalker https://github.com/agilewalker/python-for-android
git checkout a036f4442b6a23
git fetch agilewalker
git merge agilewalker/master
2.1 Buildozer is a frontend to p4a. Luckily we don't need to patch it:
cd /opt
git clone https://github.com/kivy/buildozer
cd buildozer
sudo python3 setup.py install
2.2 Download the Crystax NDK manually.
Extract into /opt/crystax-ndk-10.3.2
3.1 Start the Android SDK manager:
~/.buildozer/android/platform/android-sdk-20/tools/android
3.2 Check the latest SDK available and install it.
3.3 Close the SDK manager.
3.4 Reopen the SDK manager, scroll to the bottom and install the latest build tools (probably v27)
Install "Android Support Library Repository" from the SDK manager.
In the gui/kivy
directory of Electrum, run make theming
.
Run contrib/make_packages
.
Run contrib/make_apk
.
Update your Android build tools to version 27 like described above.
Make sure that your p4a installation includes commit a3cc78a6d1a107cd3b6bd28db8b80f89e3ecddd2.
You probably need to clear the cache: rm -rf .buildozer/android/platform/build/{build,dists}