0
protected Void doInBackground(Void... params) {
        //server able to receive it
        ArrayList<NameValuePair> dataToSend = new ArrayList<>();
        dataToSend.add(new BasicNameValuePair("username", user.username));
        dataToSend.add(new BasicNameValuePair("password", user.password));

        HttpParams httpRequestParams = new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
        HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);

        HttpClient client = new DefaultHttpClient(httpRequestParams);
        HttpPost post = new HttpPost(SERVER_ADDRESS + "Register.php");

        post.setEntity();

        return null;
    }
Dhrupal
  • 1,863
  • 1
  • 23
  • 38
Manibala Sinha
  • 127
  • 1
  • 3
  • https://stackoverflow.com/questions/32949626/org-apache-http-entity-fileentity-is-deprecated-in-android-6-marshmallow – CommonsWare Jul 15 '16 at 12:47
  • your better not to use `Apache HttpClient`.. it's retired... use HttpURLConnection or other libraries. – Bharatesh Jul 15 '16 at 13:19

1 Answers1

0

useLibrary in build.gradle(Module:app), ex:

 defaultConfig {
        applicationId "com.example.softwareengineer.robot"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        useLibrary 'org.apache.http.legacy'
 }
Timothy
  • 2,004
  • 3
  • 23
  • 29
Manibala Sinha
  • 127
  • 1
  • 3
  • defaultConfig {useLibrary 'org.apache.http.legacy'} – Manibala Sinha Jul 15 '16 at 12:36
  • add httpClient.jar file in libs folder and run the jar file in build.gradle(Module:app) write useLibrary 'org.apache.http.legacy' compile 'org.apache.httpcomponents:httpcore:4.4.1' compile 'org.apache.httpcomponents:httpclient:4.5' – Manibala Sinha Aug 31 '16 at 18:55