最后,我在团队负责人的指导下解决了我的问题,下面是我们在 constants.java 类中使用的代码
public static final String GET_CENTRAL_SERVER = String.format("%s/AccountService/security/ValidateAccess", TIMEMACHINE_ACCOUNTS_SERVER);
并在 serversync.java 类中添加代码片段
public String getCentralServer(Context context, String serial_number) throws Exception{
// TODO Auto-generated method stub
WebServiceClient client = new WebServiceClient(Constants.GET_CENTRAL_SERVER);
client.addParam("accesscode", String.valueOf(serial_number));
client.addParam("type", "2");
client.Execute(RequestMethod.GET);
String response = client.getResponse();
if (response != null){
response = response.replaceAll("\\\\/", "/");
response = response.replace("\"", "");
response = response.replace("\n","");
response = "http://" + response;
return response;
}
return null;
}