One of google's tips to reduce APK
size is by avoiding using Enumerations
, they said : A single enum can add about 1.0 to 1.4 KB of size to your app's classes.dex file.
, How that is possible ? and is it the same case for natice ( C/C++ ) code ?
Source : https://developer.android.com/topic/performance/reduce-apk-size.html
Asked
Active
Viewed 215 times
0

Dhia Hassen
- 508
- 4
- 20
-
1check this https://www.youtube.com/watch?v=Hzs6OBcvNQE&feature=youtu.be if it helps. also search similar topics @ https://plus.google.com/communities/116342551728637785407 – Raghunandan Oct 10 '16 at 18:51
1 Answers
2
Dex bloating for java enums has been discussed in SO before. Enumerations in C/C++ do not bloat code at all. They are just numeric constants and code size for every switch takes several bytes per case statement. If enum values are consecutive and not large, switch can be translated to a TBB instruction which requires only a byte for every case plus size of the command itself.

Community
- 1
- 1

Alexey Guseynov
- 5,116
- 1
- 19
- 29