开发者

Error:HttpHostConnectionException

开发者 https://www.devze.com 2023-03-05 00:07 出处:网络
i\'ve made a web servide to join code deployed on google-app-engine with my android application. whenever i try to do so i get the following error:

i've made a web servide to join code deployed on google-app-engine with my android application.

whenever i try to do so i get the following error: Error:HttpHostConnectionException:Connection to http://localhost:60569 refused can somebody please tell the solution of it... here is my android code:-

private void navigate() throws ClientProtocolException, IOException
 {

     DefaultHttpClient hc=new DefaultHttpClient(); 
     ResponseHandler <String> res=new BasicResponseHandler();
     HttpPost postMethod=new HttpPost("http://localhost:60569/PendingRequest.jsp"); 
     List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();

     nameValuePairs.add(new BasicNameValuePair("empId",empId));
     nameValuePairs.add(new BasicNameValuePair("password",password));
     nameValuePairs.add(new BasicNameValuePair("empName",name));
     nameValuePairs.add(new BasicNameValuePair("empPhnNo",phoneNo));
     nameValuePairs.add(new BasicNameValuePair("empEmail",email));

     postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));  
     String response=hc.execute(postMethod,res); 
     System.out.println("7");
     System.out.println(response);

     Intent intent=new Intent(this,RegisterEmployeeSecondActivity.class);
    startActivity(intent);
 开发者_运维百科}


add this code in your manifest...

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号