I want to access a parameterized url with Android. All it has to do is "load" the page so that it does what its supposed to do (update database with parameters given).
I was having trouble just loading the url so I watched a video on regular HttpClient activity -- just waiting for the response and gathering that information. I figured that it would still be loading the page and therefore also letting that page execute. I can't even get that to run the page correctly or gather a response.
Here's the code I used:
String url = "http://www.removed.com?param1="+param1+"¶m2="+param2;
try{
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
InputStream webs = entity.getContent();
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(webs, "iso-8859-1"), 8 );
test.setText(reader.readLine());
webs.close();
}catch(Exception e) {
Log.e("Error in conversion: ", e.toString());
}
}catch(Exception e) {
Log.e("Error in connection: ", e.toString());
}
Please let me know what I can do to get this to execute the page and update the database. If I put in the parameters manually into a browser, it works.