3 ms·
Java has a good chance to be smaller When you need a library you either call one of the Java default libraries (through JNI which I suspect is larger than a cl
by benibela 6y ago
Java has a good chance to be smaller
When you need a library you either call one of the Java default libraries (through JNI which I suspect is larger than a class file) or include a native library.
And the native code needs to be included four times for different CPUs. Or you need four different apks
Probably the normal apks are so big, because they include the support library or the Kotlin standard library
- kllrnohj 6y agoJava's bytecode is also more information dense than assembly is. Even if you only support a single architecture, a pure-Java Android app is going to almost certainly be smaller than a pure-C one, and by non-trivial amounts. If you start adding things like the Kotlin standardy library or Jetpack libraries or whatever then yes size balloons. But so too will the C app's size as its feature set expands to match. For example if this framework supported text[1] its size would explode as it grew ICU, FreeType, etc... dependencies, which are "huge." 1: yes there is a CNFGDrawText function but it uses a static map ( https://github.com/cntools/rawdraw/blob/a2a9f3c88b5caf92ef3c4e9bce145815ed25e2f6/CNFGFunctions.c#L54 https://github.com/cntools/rawdraw/blob/a2a9f3c88b5caf92ef3c... ) which I'm pretty sure is ASCII only, and obviously doesn't support fonts. Or internationalization of any kind. And similarly for text layout it only "works" because it's always monospace with a known "font" ( https://github.com/cntools/rawdraw/blob/a2a9f3c88b5caf92ef3c4e9bce145815ed25e2f6/CNFGFunctions.c#L240 https://github.com/cntools/rawdraw/blob/a2a9f3c88b5caf92ef3c... )