2
I’m using the class HttpURLConnection
to make the connection to a site that returns a JSON and I did the following encoding:
URL url = new URL("http://hmkcode.appspot.com/rest/controller/get.json");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.connect();
When executing the methods url.openConnection()
and connection.connect()
the system takes a long time to respond. I even have the desired feedback, but it takes about 5 minutes to execute the methods.
Why is this happening? Remembering that I am doing everything within the method doInBackground
of a AsyncTask
Shows your Asynctask. Some other routine may be slow, not connection act. (debugged?)
– José Diogo Castro