add android build support

1. modify some code and add android build support