Fix authentication issues in java API due to non US locale.
Fix compatibility issue with android 2.2 and earlier versions.