Fork from google code and for Android