URLConnection Caching Problem

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

URLConnection Caching Problem

Postby forrestgrant » Thu Nov 06, 2008 7:17 pm

I am loading a php file from a webserver and displaying its content. (For debugging purposes, right now I am just logging the text line by line)

Code: Select all
public void logText(String id) {
     URL url = new URL("http://server.com/file.php?id=" id);
     URLConnection conn = url.openConnection();
      InputStream is = conn.getInputStream();
      BufferedReader rd = new BufferedReader(new InputStreamReader(is));

      String line;
      while ((line = rd.readLine()) != null) {
           Log.d("PORT LINE", line);

//When a button is pressed, the app gets id from a TextField then:

Based on the id, the text may be different. This works perfectly on the first load, however if I change the ID, make a subsequent call, and display the new text, the text is exactly the same no matter what. The android app seems to be caching the remote file, even though setUsesCaches(false); is called.

Oddly, on my server, I see the request being logged with the new ID, so I know it is requesting the right file/params, but my android app is not receiving the new information.

Once Poster
Once Poster
Posts: 1
Joined: Thu Nov 06, 2008 7:01 pm


Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 2 guests