I tried to run the following program in an Android Studio scratch file:
import android.net.Uri
println (Uri.encode("?"))
But it fails with the following error:
Unresolved reference: android
But this seems to work:
import java.net.URLEncoder
println (URLEncoder.encode("?", Charsets.UTF_8.name()))
How to tell Android Studio about android
?