I use WWW class try to download a picture from google street view api , the picture can be download in computer (debug mode) but cannot download in android (after build) .
In the app, the status keep loading for long time. Is that mean the unity app had no right to access internet on phone ?
This is my code:
IEnumerator _Refresh ()
{
loading = true;
Texture2D picture;
picture = new Texture2D (640, 640);
int width, height;
width = height = 1024;
string url = "http://maps.googleapis.com/maps/api/streetview?"
+ "size=" + width + "x" + height
+ "&location=" + lat + "," + lon
+ "&heading=0&pitch=0"
+ "&fov=90.0&sensor=false";
Debug.Log ("URL " + url);
WWW www = new WWW(url);
yield return www;
if (!string.IsNullOrEmpty (www.error)) {
Debug.Log ("Panorama " + name + ": " + www.error);
}else {
print ("Panorama " + name + " loaded url " + url);
picture = www.texture;
}
loading = false;
}