Android: make AndroidUtils more general.