Rascalsailor
Newbie
Hi all
I got a json parser running in AS with an AVD based on the example at:https://www.tutorialspoint.com/android/android_json_parser.htm
The code attempts to access json data at:"http://api.androidhive.info/contacts/
The resulting response in Logcat in Studio gives:
Response from url:
However when I access the URL using Chrome I get the proper Json data:
I eventually used Xampp to make a local server and I accessed the jason as a local file :http://10.0.2.2/mydocs/test_data.json
This worked fine.
My question is, why would the code running on AS with an AVD return the above response, but an access to the url using a browser gets the json data fine?
Regards
Russell
I got a json parser running in AS with an AVD based on the example at:https://www.tutorialspoint.com/android/android_json_parser.htm
The code attempts to access json data at:"http://api.androidhive.info/contacts/
The resulting response in Logcat in Studio gives:
Response from url:
HTML:
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
However when I access the URL using Chrome I get the proper Json data:
I eventually used Xampp to make a local server and I accessed the jason as a local file :http://10.0.2.2/mydocs/test_data.json
This worked fine.
My question is, why would the code running on AS with an AVD return the above response, but an access to the url using a browser gets the json data fine?
Regards
Russell
Last edited: