sending values from android to server
<p>I want to set the following code in a start and stop button to send my values to server after every second . so i am wondering how to adopt best strategy for it .should i put in a thread or refresh the activity . please guide me the easy direction to adopt . Thanks</p>

<pre><code>URL url = new URL("http://............./add.jsp?a="+value+"&amp;b="+value+"");

URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"));
String line = null;
String response = "";
while ((line = rd.readLine()) != null) {
    response += line;                          
}

wr.close();
rd.close();
</code></pre>
