how to use asynctask to make api connection
public class SomeOtherClass { //Some url endpoint that you may have String myUrl = "http://myApi.com/get_some_data"; //String to place our result in String result; //Instantiate new instance of our class HttpGetRequest getRequest = new HttpGetRequest(); //Perform the doInBackground method, passing in our url result = getRequest.execute(myUrl).get();}