For more on packaging your app for Android, check out:
Package Your App for Android
00:00 Packaging Your App for Android. Packaging your application for both Android and iOS will be shown as an example in this course. But you should be aware that the creation of mobile apps using Kivy is a moving target for multiple reasons.
00:15 Building for both platforms involves using a number of third-party software libraries and tools, and these change regularly. This can mean one or more parts of the process will be different when you attempt it. In addition, the mobile platforms themselves are regularly updated, which can mean that the tools need new versions to work with the latest and greatest OS that’s available. But with these potential issues in mind, let’s move on to take a look at how to package your Kivy app for Android.
To accomplish this, first you’ll need to install a package called
pip. Note that it is possible to achieve this on Windows, but involves using the WSL subsystem, and you won’t have direct access to an Android device from it, so this falls outside the scope of this course. On macOS and Linux, the path is more straightforward.
01:34 You’ll also need to install a Java runtime. The one you install will depend on your operating system and architecture. The Java development kit needed for use with Buildozer must be the correct one, or the build process will fail.
Next, create a new folder and navigate to it in your terminal. Once you’re there, you’ll need to run the following command. This will create a
buildozer.spec file that you’ll use to configure your build.
03:17 The build step can take a long time. Fifteen to twenty minutes is not unusual. Depending on your hardware, it may take even longer, so feel free to grab a drink and check out some other Real Python tutorials while you wait.
04:48 The Buildozer tool has many other commands you can use. Check out the documentation to see what else you can do. If you need more fine-grain control, then you can also package the app using Python-for-Android, which is used under the hood of Kivy. You won’t be covering this here, but if you’re interested, check out the project’s Quickstart.
Become a Member to join the conversation.