4 Replies Latest reply on Mar 30, 2015 7:24 PM by Subhajit Choudhury

    How to reduce the apk file size generated

    Subhajit Choudhury

      I am having an issue to reduce the file size generated in android.I had gone through, may be, every possible look out in google for the same. But could not get a clear view.

      Is there a way to possibly reduce the apk file size? Any help would be appreciated

        • Re: How to reduce the apk file size generated
          Jon Tara

          Do you think the size is excessive? How large is it? Do you include some seed data for your database? Do you have a lot of images/videos or other static content?


          It's hard to help without any details about your app.

            • Re: How to reduce the apk file size generated
              Subhajit Choudhury

              Hi Jon,


              Sorry my bad. I should have included more info.

              I have not yet connected to any databases. Basically only html and css. 3 UI pages were created.

              3 css files with sizes 42KB, 120KB 19KB

              2 JS files both for jquery mobile patch and minified

              Well images directory holds up to be 3.2 MB (Thats a lot i guess)

              and default Application file structure.


              The app with 3 pages UI design sized up to 10 MB


              I have used minifed in build.yml also to minify the css and JS stuffs.

              What should I do? is there any way to compress the size from Rhodes framework itself?

              Please Help!!

                • Re: How to reduce the apk file size generated
                  Jon Tara

                  That's about the minimum size of a Rhodes app. There really isn't anything to do to make it smaller.


                  I think that is pretty reasonable. Have you look at the size of apps lately?


                  The good news is that's a static overhead, and it doesn't grow much as you write more code.


                  Rhodes has a "big lump" of code which is the actual RhoRunner app that runs your Ruby code. Because of recent changes, both iOS and Android apps get built with two different architectures (iOS 32 and 64-bit, Android ARM and Intel) and that has almost doubled the minimum possible app size.


                  But your Ruby code, templates, Javascript, CSS, etc. doesn't get doubled. As the project grows, it will grow at a slower rate than a pure native application would. And if you write Ruby code, it will probably grow at a slower rate than Javascript code would.


                  Javascript code is stored as source in the app, but Ruby code is stored as compiled bytecode. And because it is not machine code, it is not doubled when a platform has dual architectures.