-
-
Save tleyden/159e762e90439a09795a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
DefaultHttpClient client = new DefaultHttpClient(); | |
HttpGet request = new HttpGet("http://10.0.3.2:8080/longpoll"); | |
HttpResponse response = client.execute(request); | |
BufferedReader rd = new BufferedReader | |
(new InputStreamReader(response.getEntity().getContent())); | |
String line = ""; | |
while ((line = rd.readLine()) != null) { | |
Log.i(Application.TAG, line); | |
} | |
Log.i(Application.TAG, "Done reading response"); | |
} catch (Exception e) { | |
Log.e(Database.TAG, "Error", e); | |
} | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment