I just created an apk after creating an app in kivy however it seems to me that the size of the apk created is really big on the android and after running the app the size is becoming bigger an bigger . See example below :
import kivy kivy.require('1.0.6')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.button import Button
class MyApp(App):
def build(self):
return Button(text='Hello world')
if __name__ == '__main__':
MyApp().run()
Size of this file comtaining above code : 1 kb
On Creation of its apk using python for android project with steps its size ( 6.7 MB): 3.1 ./distribute.sh -m "kivy" 3.2 ./build.py --dir /home/kivy/HelloWorld/ --package org.ex.helloworld --name "HelloWorld" --icon /home/kivy/Work/HelloWorldDistribute/a.png --version 1.3 --orientation portrait debug installd
kivy@kivy-VirtualBox:~/android/python-for-android/dist/first/bin$ du -h HelloWorld-1.3-debug.apk 6.7M HelloWorld-1.3-debug.apk
On Installing this app on android Samsung galaxy s3 using following command :
4.1 adb install -r HelloWorld-1.3-debug.apk 421 KB/s (6996727 bytes in 16.208s) pkg: /data/local/tmp/HelloWorld-1.3-debug.apk Success
Size on Android : 10.5 MB
Does it mean that minimum size of android app created from kivy will be 10.5 MB ? I have seen many apps which are of smaller size and are made in Java ? Is there any way to make apps from kivy of smaller size ? Can someone advice ?
When you write an Android app using Kivy and Python you have to include some Kivy and Python libs in the build, Kivy itself is 5-6mb so depending on how much data you include in your app the size will vary. Each build has an entire Python interpreter as Brousch pointed out.
After you have built an apk, if you look inside the file you will see the different sizes of each file in your distribution.
If you look here there is a guide to the basic layout of a distribution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With