Avatar ·

How to create .apk file using buildozer in Windows?

📁 Advanced Python Topics, AI, game, work

When trying to create an .apk file using buildozer, I encountered a problem: if you do this in Windows, the target android is not created, which can be seen by typing buildozer help in the terminal. If you create a virtual machine with Ubuntu, there is no such problem, but I don't want to switch to it yet, it's too early. The problem is probably because you need to install the python-for-android module, but it is not available for Windows, if I understood correctly.

This is my first attempt to use buildozer, ubuntu, and virtual machines, so my brain is already boiling, maybe I'm missing some nuance.

Does anyone know how to add a separate target for android?

Avatar ·

Your question is a bit confusing because personally, in versions before 1.4, `id` was also not available in `upload_to`.

Generally, the issue of storing file paths is quite common. In my opinion, the most normal option is to build a hash from `timestamp` + file name and create directories based on the first 4 characters of the hash

upload_to = 'upload_path/%s/%s/%s.jpg' % (hash[:1], hash[2:3], hash)

UPDATE Regarding specifically `id` in the file name. After saving the file, i.e., after assigning `id` in the database, you need to generate a new path and with

Log in to leave an answer

Blogs