JiBX on Android (or any other build-time bytecode manipulation library)
I’m considering JiBX
for a project that has to run on Blackberry and RIM. While the community seems to have considered using JiBX with J2ME
(according to JiBX
jira tickets), Android is relatively new.
So, the
question is: has anyone had success (or a problem, for that matter) on Android using JiBX or any other library that requires modifying the bytecode-like code at build time?
The discussion has unfolded about how such libraries should run on Android (compared to libraries that use runtime bytecode detection), but I haven’t seen many reports of people actually trying to do this.
Solution
It won’t work because android doesn’t do bytecode. Android’s Java runtime uses a register-based virtual machine (Dvalik), which executes .dex files instead of class files. Theoretically, you can generate this code instead of Java bytecode.