Utils code for Android in Scala