當我連接到我的服務器我展示它在Java代碼中一樣,地址:隱藏Android的Web服務URL
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.1.13/spotnshare/syncAddress.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
但我們告訴我,有代碼的IP地址是不正確的,而且我猜應該把它放在一個配置文件中作爲別名。
有人知道嗎?
public static String SYNCADDRESS = R.string.syncAddress; 類型的R.string.syncAddress是int,它不會工作。 – silentnuke 2012-08-01 22:51:46
好主意:我更正了示例代碼(必須使用getResources()。getString())調用資源。 – tephyr 2012-08-02 16:15:03