Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25966] Android: Use conditional compiling to decrease binary size

GitHub Issuen/a
TypeStory
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, CLI
Labelsn/a
ReporterHans Knöchel
AssigneeEric Merriman
Created2018-04-14T11:52:38.000+0000
Updated2018-04-17T20:04:15.000+0000

Description

This is a proposal to split the Android core into different (.so) sub-modules in order to decrease the general APK binary size (~ 28MB after the most recent 64 Bit changes). On iOS, we do this since a few years - triggered by the same reasons, practically by wrapping all classes in precompiler statements like USE_TI_UITABLEVIEW. The macros are generated [by the CLI](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L6075) and represent the Titanium symbols used within the app. For Android, this could be done similar, but will also require major refactoring of the package structure itself.

Comments

  1. Joshua Quick 2018-04-16

    I think a better solution would be to get rid of the C/C++ code generation and set up the V8/JNI bindings dynamically instead. This would significantly reduce the app size and we would no longer need the Android NDK to do hyperloop and module builds, which also means faster build times. While setting up the V8/JNI bindings dynamically would add overhead on startup, doing a loadLibrary() on a large *.so file already has huge overhead and reducing its size may even-out the performance implications.

JSON Source