Optimize the logic of select API level for android platform.