用php列出android中的mysql值

时间:2011-07-24 05:33:34

标签: java php android mysql

到目前为止,我只能获得显示的回复,例如:

echo 111;

我正在使用此代码来解析响应:

        ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
    postParameters.add(new BasicNameValuePair("code",
            getString(R.string.code)));
    postParameters.add(new BasicNameValuePair("code", szid));
    // String valid = "1";
    String response = null;
    try {
        checkback.setText("Checking Version...");
        response = CustomHttpClient.executeHttpPost(
                "http://synamegames.com/giveaway/versioncheckid.php",
                postParameters);
        String res = response.toString();
        // res = res.trim();
        res = res.replaceAll("\\s+", "");

有什么方法可以列出其他5个值并让android安排它们按顺序排列吗?

ID | Code
1  | 512
2  | 521
3  | 232
4  | 315
5  | 124

1 个答案:

答案 0 :(得分:1)

我做了同样的教程,现在正在使用this one从MySQL结果中获取列表视图。