Advertisement
Guest User

Untitled

a guest
May 29th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import android.net.http.AndroidHttpClient;
  2.  
  3. public class HttpManager {
  4.  
  5. public static String getData(String uri) {
  6. HttpClient client = AndroidHttpClient.AndroidHttpClient.netInstance("AndroidAgaent");
  7. HttpGet request = New HttpGet(uri);
  8. HttpResponse response;
  9.  
  10. try {
  11. response = client.execute(request);
  12. return EntiyUtils.toString(response.getEntinity());
  13. } catch (Exception e) {
  14. e.printStackTrace();
  15. return null;
  16. } finally {
  17. client.close();
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement