add base code from android sdk