1- download Apache jar files (as of this answer) 4.5.zip file from:
https://hc.apache.org/downloads.cgi?Preferred=http%3A%2F%2Fapache.arvixe.com%2F
2- open the zip copy the jar files into your libs folder. You can find it if you go to the top of your project where it says "Android" you'll find a list when u click it. So,
Android -> Project -> app -> libs
,Then put jars there.
3- In build.gradle (Module: app) add
compile fileTree(dir: 'libs', include: ['*.jar'])
in
dependency {
}
4- In the java class add these imports:
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.CoreProtocolPNames;