Now that namevaluepair is deprecated in API 22. What can i do if i want to implement 'namevaluepair' interface. below is my code
package com.example.passpass;
import org.apache.http.NameValuePair;
public class DoubleNameValuePair implements NameValuePair{
String name;
double value;
public DoubleNameValuePair(String name, double value) {
this.name = name;
this.value = value;
}
@Override
public String getName() {
return name;
}
@Override
public String getValue() {
return Double.toString(value);
}
}
You can use httpmime.jar file instead of it, which will work better that NameValuePair. You can Download it from here, http://www.java2s.com/Code/JarDownload/httpmime/httpmime-4.3.jar.zip/
Here is the sample code to use httpmime,
just add this jar to your project and then you can access MultipartEntity class.