Update api and refact android code.