📜 ⬆️ ⬇️

Kivy and Play Store

About a year ago, I participated in the Kivy App Contest 2014 . The toy took one of the prizes (nomination “best idea”) and I was repeatedly asked to put it on the market. I put it off for a long time, but the day before yesterday I finally matured, and after spending the evening I laid it out. It turned out to be quite simple and I decided to write this instruction for those who, like me, write in Kiwi "on the table." Well, or those who write on Python and do not know that it is easy to write android applications on it and even upload them to the market. The instruction is designed for the same as I complete teapots in the development for Android. Professionals can stop reading here, and you can correct / add in the comments.

For a start, a few words for those who are at kiwi (so far, it is not for long) does not write. Kiwi is a very convenient framework that allows you to write applications on pure Python and compile them for Linux, Windows, OS X, Android and iOS without changing the code.
Framework Site
A good video course for beginners and followers.
List of projects written in Kiwi

So, you have an application on Kiwi, it works great on a PC and now you want to put it on the Play Store. What is needed for this?

To begin with - make sure that on android it works no less beautiful. Check it out there are two ways.
The first one is to install the Kivy Launcher application on the device and use it to launch the application directly from the sources. It is very convenient, and with a good text editor, you can even develop it directly on your phone / tablet. But there is one nuance. The application should not use external libraries - only Kiwi and the standard Python library. If external libraries are used, there is still a chance to start - check that the library does not contain any binaries, only pure Python. If this is the case, simply place it locally in the folder with the application and change the import accordingly. If you still have the binaries, you won't be able to run from the sources, you have to compile. First, check if there are libraries in the recipe list .
')
If not, you will have to deal with the compilation yourself or chat with developers (I recommend, very responsive comrades). But most popular and important libraries have long been on this list.

All that is described below is performed on Mac or Linux. On Windows, you will have to install a virtual machine and an image. On this page you can download an image with a pre-installed builddozer.

Install the buildozer program ( pip install buildozer ). Go to the folder with the application and run the buildozer init . The buildozer.spec file appears in the folder. We change the settings there to taste, what is really important is the requirements, and when it comes to release, the version, however, the file is well documented and dealing with it is a matter of a couple of minutes. Well, yes, even the level of logs at the beginning is useful to put 2 instead of 1, to see why the compilation falls, if it falls. Then run the buildozer android debug .

If everything went well, the bin folder will appear in the project folder, and the apk file will appear in it.
We check the program in any of two ways, process it with a file, bring it to perfection (just kidding, there is no perfection). The logcat option is very useful. We connect the device to the computer with usb cable, run the buildozer logcat , start the application and look at the computer logs and tracebacks. It came in handy when the application just crashed silently at launch ...

So, you have an application on Kiwi, it works great on android and now you want to put it on the Play Store. What is needed for this?

we first compile the release version:
buildozer android release
We get unsigned apk, it needs to be signed. And for this you need to create a key.
Run:
keytool -genkey -v -keystore path_there_where_will_learn_key / key_name.keystore -alias short_name_for_key -keyalg RSA -keysize 2048 -validity 10000

The key is ready. It must be preserved and cherished. Now you need to sign the application with this key (when posting new versions use the same key, you do not need to create a new one).
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore path_there_free_legs_key / key_name.keystore path_to_project / bin / unsigned_apk short_name

Now, although the file is called unsigned, it is already signed. Now it is desirable to optimize it with the zipalign utility. It lies in android sdk, which the buildozer downloads during installation.

zipalign -v 4 path_to_subscribed_apk path_there_where_will_leaf_good_apk

So you have a ready apk.

Now you need to draw some pictures.

The following pictures are the application icon that will be displayed on the device (it needs to be registered in buildozer.spec), the application icon (512x512), which will be displayed in the market. Screenshots for the phone, seven-inch tablets, ten-inch tablets (generally for those devices for which the application will be shown in the market) and a picture 1024x500 for the recommended section (yeah, I know, it's funny, but it is necessary to fill). I cut all of the above in a couple of minutes from the screenshots, but it is certainly better to spend time and do something quality.

When there is apk and all the pictures, we’ll finally go to the developer’s console , register if we don’t yet, pay Google for the $ 25 pleasure (maybe you should have written about this at the beginning of the article?) rating, download apk, wait a few hours for confirmation and admire the application in the market. Links to the applications laid out throw in the comments.

Source: https://habr.com/ru/post/189660/


All Articles