Improves a bit the Java code
Minors improvement to the Android code