0

I am trying on Client/Server side application in android. I have a php file which simply get or post data. On Android I have an activity which get and post data from server file. I hav problem in accessing that file which is located on c://xampp/htdocs/Project/server.php and in android I have these lines of code:

URL url = new URL("http://192.178.10.54/xampp/htdocs/Project1/server.php");
URLConnection connection = url.openConnection();

But when I run my app these lines of exception occurres :

04-09 16:18:21.484: W/System.err(7752):java.io.FileNotFoundException: http://192.178.10.54/xampp/htdocs/Project1/server.php
04-09 16:18:21.664: W/System.err(7752):     at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
04-09 16:18:21.664: W/System.err(7752):     at com.android.ServerInterface.executeHttpRequest(ServerInterface.java:111)
04-09 16:18:21.664: W/System.err(7752):     at com.android.ServerInterface.getAnimalList(ServerInterface.java:60)
04-09 16:18:21.664: W/System.err(7752):     at com.android.AndroidListClient$GetListTask.doInBackground(AndroidListClient.java:106)
04-09 16:18:21.664: W/System.err(7752):     at com.android.AndroidListClient$GetListTask.doInBackground(AndroidListClient.java:1)
Rafael T
  • 15,401
  • 15
  • 83
  • 144
User42590
  • 2,473
  • 12
  • 44
  • 85

1 Answers1

0
URL url = new URL("http://192.168.10.54/xampp/htdocs/Project1/server.php");
URLConnection connection = url.openConnection();
Nirav Ranpara
  • 13,753
  • 3
  • 39
  • 54