1

I been following online tutorials on how to uploading image into a database from an android app and have everything working except this small part

private HttpParams getHttpRequestParams(){
    HttpParams httpRequestParams = new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpRequestParams, 1000*30);
    HttpConnectionParams.setSoTimeout(httpRequestParams, 1000*30);
    return httpRequestParams;
}

HttpParams and BasicHttpParams have been deprecated. Does anyone know what can I use instead of them?

alexjan
  • 21
  • 3
  • Possible duplicate of [With what can I replace http deprecated methods?](http://stackoverflow.com/questions/29995749/with-what-can-i-replace-http-deprecated-methods) – Marten Jan 27 '17 at 15:57

1 Answers1

0

If something is deprecated, then in most cases the reason described in documentation. Look into HttpParams source code(cmd+b shortcut for AS):

/**
 * Represents a collection of HTTP protocol and framework parameters.
 *   
 * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
 * 
 * @version $Revision: 610763 $
 *
 * @since 4.0
 *
 * @deprecated Please use {@link java.net.URL#openConnection} instead.
 *     Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a>
 *     for further details.
 */

Which gives you even blog post about the reason.

ps do not reinvent the wheel, use Retrofit.

eleven
  • 6,779
  • 2
  • 32
  • 52