I have created fake rest api locally. I can access json data at http://localhost:3000/db in my PC.If I am using same url in android code ,I am not getting data. Please help me to solve this problem
Asked
Active
Viewed 829 times
0
-
Check this post: http://stackoverflow.com/questions/21811789/android-connection-to-localhost – inder_gt Jan 31 '16 at 15:56
-
I tried this but it is not working – Riding Cave Jan 31 '16 at 16:04
-
To help you to solve this problem you should share some code to us – Robin Vinzenz Jan 31 '16 at 16:20
-
protected Void doInBackground(Void... arg0) { // Creating service handler class instance WebRequest webreq = new WebRequest(); // Making a request to url and getting response String jsonStr = webreq.makeWebServiceCall(url, WebRequest.GET); Log.d("Response: ", "> " + jsonStr); studentList = ParseJSON(jsonStr); return null; } – Riding Cave Jan 31 '16 at 18:17
-
I am using url="http://192.168.1.105:3000/db – Riding Cave Jan 31 '16 at 18:18
-
Both PC and android device is on same network – Riding Cave Feb 01 '16 at 08:44
-
I tried http://stackoverflow.com/questions/30236716/locally-call-restful-web-service-generated-by-netbeans-ide-from-android?rq=1 – Riding Cave Feb 01 '16 at 08:45
-
When I am using another laptop ,I am able to access the rest api in my device. Could you please tell me how to bypass the proxy(I am using my office laptop)? – Riding Cave Feb 03 '16 at 03:38