Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

size of .apk when coded with kivy compared to the one in Java

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 :

  1. The Code for this example .apk is a minimal app of Hello World . Code 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()
  1. Size of this file comtaining above code : 1 kb

  2. 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

  1. 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

  1. If i run this app for 1 time on android and after that check the size it becomes 24.11 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 ?

like image 516
paarth batra Avatar asked May 05 '14 03:05

paarth batra


1 Answers

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.

like image 125
Padraic Cunningham Avatar answered Nov 23 '22 06:11

Padraic Cunningham