Kivy and Play Store

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

    To begin with, a few words for those who do not write on the kiwi (for now, this is not for long). 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.
    The site of the framework.
    A good video course for beginners and followers.
    List of projects written in kiwi.

    So, you have a kiwi application, 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 it works on Android no less fine. There are two ways to check this.
    The first one is to install the Kivy Launcher application on the deviceand with it, run the application directly from the source. It is very convenient, and if you have a good text editor, you can even develop it directly on your phone / tablet. But there is one caveat. 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 run - check that the library does not contain any binaries, only pure Python. If so, just place it locally in the application folder and change the import accordingly. If you still have binaries, it won’t work from the source, you have to compile. First, check to see if there are any libraries in the recipe list .

    If not, you will have to deal with compiling their own or to communicate in chatwith developers (I recommend very responsive comrades). But most popular and important libraries have long been on this list.

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

    Install the buildozer program ( pip install buildozer ). We go into the application folder and run buildozer init. The buildozer.spec file appears in the folder. We change the settings there to taste, what is really important is requirements, and when it comes to release - the version, however, the file is well documented and sorting it out is a matter of a couple of minutes. And, well, yes, even the log level at the beginning is useful to put 2 instead of 1 to see why the compilation crashes if it crashes. Then run 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 a usb cable, run buildozer logcat, run the application and look at the computer logs and traysbacks. It was useful to me when the application just silently crashed at startup ...

    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?

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

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

    Now even though 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 buildozer downloads during installation.

    zipalign -v 4 path_to_signed_apk path_to_where_will_leap_ ready_apk

    So you have ready apk.

    Now you need to draw some pictures.

    The pictures are as follows - the application icon that will be displayed on the device (it needs to be registered in buildozer.spec), the application icon (512x512) that will be displayed in the market. Screenshots for the phone, seven-inch tablets, ten-inch tablets (in general, for those devices for which the application will be displayed in the market) and a recommended 1024x500 picture for the section (yeah, I know, it's funny, but it must be filled). 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 high-quality.

    When there is apk and all the pictures, we finally go to the developer console, register if not already, pay Google $ 25 for pleasure (maybe it was necessary to write about this at the beginning of the article?) arrange all the pictures, write descriptions, answer a couple of questions to get an age rating, download apk, wait a few hours for confirmation and enjoy the application in the market. Links to the laid out applications throw in comments.

    Also popular now: