I use compileSdk 23version 23 with library support.
I used the httplegacy library (I copied it to the app / libs folder from androidSdk / android-23 / optional / org.apache.http.legacy.jar) and in gradle I put:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
To download this library.
In my Connection class, I have a way to load an instance DefaultHttpClientlike this:
private static HttpClient getClient(){
HttpParams httpParameters = new BasicHttpParams();
int timeoutConnection = 3000;
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
int timeoutSocket = 3000;
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
DefaultHttpClient httpClient = new DefaultHttpClient(httpParameters);
return httpClient;
}
But Android Studio says all classes apache.httpare out of date.
What can I use to follow best practices?
source
share