I'm having trouble connecting to the internet in an Android build. I created a simple program that checks if there is an connection. Also I set in 'Edit > Project Settings > Player' the Internet Access to Require. But there is still no sign of connection in the app. Does anyone know what the problem is? Thank in Advance!
public class CheckInternet : MonoBehaviour {
private bool isInternet = false;
public Text ConnectedText;
public Text IntText;
int i = 0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
StartCoroutine (TestInternet());
IntText.text = i++ + "";
if (isInternet) {
ConnectedText.text = "Connected";
} else {
ConnectedText.text = "Not Connected";
}
}
IEnumerator TestInternet(){
WWW internet = new WWW("www.google.com");
yield return internet;
if(internet.error!=null)
isInternet=false;
else
isInternet=true;
}
}

