제가 지금 post통신을 한번 해보고있는데요 문제가 있습니다
12-02 09:01:22.700 3397-3397/com.example.admin.myapplication E/AndroidRuntime: FATAL EXCEPTION: mai
Process: com.example.admin.myapplication, PID: 3397
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient;
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.DefaultHttpClient" on path: DexPathList[[zip file
이런 오류가 뜨네요 ㅠㅠ 해결방법좀 알려주세요
public class MainActivity extends Activity {
private EditText edt1, edt2, edt3;
private Button btn1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
write();
}
});
}
private void write() {
try {
HttpClient client = new DefaultHttpClient();
String postURL = "http://localhost:8080/JJUstubuilding_test/andjoin_pro.spring";
HttpPost post = new HttpPost(postURL)
List params = new ArrayList();
params.add(new BasicNameValuePair("user_id", edt1.getText()
.toString()));
params.add(new BasicNameValuePair("user_pw", edt2.getText()
.toString()));
params.add(new BasicNameValuePair("user_name", edt3.getText()
.toString()));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, "euc-kr");
post.setEntity(ent);
HttpResponse responsePost = client.execute(post);
HttpEntity reEntity = responsePost.getEntity();
if (reEntity != null) {
Log.w("RESPONSE", EntityUtils.toString(reEntity));
}
} catch (Exception e) {
}
}
}