improve java codes and make android project can be built