Add the permissions android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE to AndroidManifest.xml.