您好我开发了一个Android应用程序,它主要与我的服务器进行通信以进行注册,登录等...我已经完成了所有编码,我的应用程序在模拟器中工作正常但是当我部署它时我的Android手机,应用程序没有连接到我的服务器 这是我用来连接
的代码public Object execute(Map<String,String> params,String key,Class typeInfo)throws RestGatewayException
{
//httpClient = RestClientConnectionPool.getHttpClient(restHostInfo.isPooolConnections());
httpClient = new DefaultHttpClient();
String url = RestRequestMaker.prepareURL(key, params, restHostInfo);
HttpRequestBase method = RestRequestMaker.prepareHttpMethod(restHostInfo.getRequestMethods().get(key),url);
try
{
httpResponse = httpClient.execute(httpHost, method);
if(typeInfo==null)
{
return RestResponseHandler.getResponse(httpResponse.getStatusLine().getStatusCode());
}
else
{
String jsonResponse = RestClientUtil.getJSONResponse(httpResponse.getEntity().getContent());
return RestResponseHandler.getResponse(jsonResponse, typeInfo);
}
}
catch (ClientProtocolException e)
{
throw new RestGatewayException(e.getMessage(), e.getCause());
}
catch (IOException e)
{
throw new RestGatewayException(e.getMessage(), e.getCause());
}
}
我的应用程序被击中了
httpResponse = httpClient.execute(httpHost, method);
在Android的情况下使用webservices时有什么方法吗?或者我的方法不正确?