您可以使用HTTPGET得到的页面和httpPost当用户按下提交后的结果。您所要做的就是确保该文章能够传输网页期望的数据,并且使用它期望的格式。
检查需要什么的好方法是使用Firefox Live HHTP头添加(https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/)。
例如,GET可能是
URI uri = new URI();
HttpGet request = new HttpGet(uri);
HttpResponse response = defaultHttpClient.execute(request);
HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity);
然后你把你与编辑文本框和按钮等Android的视图当用户按下提交,你得到的文本形式编辑的文本框,然后如下构建一个POST。
URI uri = new URI();
HttpPost request = new HttpPost(urri);
request.setHeader("Content-type", "application/x-www-form-urlencoded");
List bodyParams = new ArrayList();
bodyParams.add(new BasicNameValuePair(, );
// repeat additional bodyParams.add() as necessary for further parameters
request.setEntity(new UrlEncodedFormEntity(bodyParams, HTTP.UTF_8));
HttpHost httpHost = new HttpHost();
HttpResponse response = defaultHttpClient.execute(httpHost, request);
HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity);