App installed size is different on different devic

2019-04-11 10:14发布

My app is a background service without any GUI. Apk size is about 9 MB. When I installed this app on Samsung Note II(OS 4.4.2), application size is 18.55 MB, on Samsung Galaxy S4 37 MB and on Samsung Galaxy S5 69.47 MB.

I already found a similar question but no solution at: Different installed app size on different devices

Thanks for prompt response.

enter image description here enter image description here

2条回答
爷、活的狠高调
2楼-- · 2019-04-11 10:31

You can try with android:installLocation

The application may be installed on the external storage, but the system will install the application on the internal storage by default. If the internal storage is full, then the system will install it on the external storage. Once installed, the user can move the application to either internal or external storage through the system settings.

android:installLocation="auto"

FYI

The Google play store main application (APK) size, not the total app size, which includes the OBB (Opaque Binary Blob) expansion files. OBBs are the extra files that an app downloads to run.

查看更多
够拽才男人
3楼-- · 2019-04-11 10:32

It depends on which android os you are installing. After Kitkat they have introduced ART : ART (Android RunTime) is the next version of Dalvik. Dalvik is the runtime, bytecode, and VM used by the Android system for running Android applications.

ART has two main features compared to Dalvik: Ahead-of-Time (AOT) compilation, which improves speed (particularly startup time) and reduces memory footprint (no JIT) Improved Garbage Collection (GC)

AOT means your apps are compiled to native code once. What is stored on your phone and run is effectively native, not bytecode. This differs from the traditional VM model, which interprets bytecode. Interpreters are slow, so VM developers added a technology called Just-in-Time (JIT) compilation, which compiles (and hopefully optimizes) your code to native code on-the-fly. Dalvik is a JIT'ing VM. The downside to JIT is that the JIT compiler runs while you are using your app, adding latency and memory pressure. The upside is that the JIT compiler can look at how you are using your code to perform profile-directed optimizations.

AOT is like JIT, but it runs once—say, at app installation time. While it lacks the ability to perform profile-directed optimizations, it is possible to perform more extensive optimizations since the compilation is less time sensitive. AOT is useful on systems, such as mobile devices, where JIT adds an unacceptable latency or memory cost to running apps. I think AOT is the right step for Android and ART looks quite impressive.

ART was first included in Android KitKat, but isn't yet enabled by default. You can enable it via Settings > Developer options > Select runtime > Use ART.

So It varies as per android framework.

查看更多
登录 后发表回答