Fixed NDK x86 compilation error. Refactoring

Edited C++ and Java code to not display warnings when compiling
(finally)