0

i am new to android development and want to store data on server but Http client is not working and showing error on NameValuePair,BasicNameValue and HttpParams. what should i do?

this is my code

 @Override
    protected Void doInBackground(String... params) {
        String type= params[0];
        String login_url="http://10.0.2.2/login.php";
        ArrayList<NamValuePair> dataTosend=new ArrayList<>();
        dataTosend.add(new BasicNameValuePair("name", user.name));
        dataTosend.add(new BasicNameValuePair("email", user.email));
        dataTosend.add(new BasicNameValuePair("password", user.password));

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

        return null;
    }

i have imported

import org.apache.https.params.NameValuePair;
import org.apache.https.params.BasicNameValuePair;
import org.apache.https.params.BasicHttpParams;
import org.apache.https.legacy;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;

import java.util.ArrayList;

and error is class not found

Bebo
  • 37
  • 1
  • 7
  • You should tell us what the error is – Tim Feb 22 '16 at 16:41
  • but that answer is not helpful .. if you will help me , i'll be thankful to you @Kamen , Commons Ware – Bebo Feb 22 '16 at 16:43
  • He means that you should give more information, or we simply won't be able to help you. We can't work with 'class not found' but we might be able to work with which class is not found. So is it BasicNameValuePair that is not being found? – Csteele5 Feb 22 '16 at 18:45

0 Answers0