fixed some bugs which occured on android. And add samples.