package com.example.joong;
import java.net.URL;
import java.util.ArrayList;
import org.apache.http.HttpConnection;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class add extends Activity{
Button ok_btn;
EditText name;
EditText pass;
EditText pass_chk;
EditText phone;
public static String s_name="";
public static String s_pass="";
public static String s_pass_chk="";
public static String s_phone="";
public static String localXml="";
public void se(){
new Thread(){
public void run(){
StringBuffer strUrl = new StringBuffer();
// TODO Auto-generated method stub
strUrl.append("http://아이피:8080/joong/NewFile.jsp?name=");
strUrl.append(s_name).append("&pass=").append(s_pass).append("&phone=").append(s_phone);
HttpClient httpclient = new DefaultHttpClient();
try{
URL url = new URL(strUrl.toString());
HttpConnection conn = (HttpConnection) url.openConnection();
}catch(Exception e){}
}
}.start();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add);
name = (EditText)findViewById(R.id.ID_edt);
pass = (EditText)findViewById(R.id.editText1);
pass_chk = (EditText)findViewById(R.id.editText2);
phone = (EditText)findViewById(R.id.PHONE_edt);
ok_btn = (Button)findViewById(R.id.ok_btn);
ok_btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
s_name = name.getText().toString();
s_pass = pass.getText().toString();
s_pass_chk = pass_chk.getText().toString();
s_phone = phone.getText().toString();
if(s_pass.equals(s_pass_chk)){
se();
}
else{
Log.e("비밀번호가같지 안앙~~~~", "2");
Toast toast =Toast.makeText(add.this, "비밀번호가 다릅니다.", Toast.LENGTH_LONG);
toast.show();
pass.setText("");
pass_chk.setText("");
}
}
});
}}
소스는 저래되는데 ㅠㅠ 똑같이 log찍어서 나오는 스트링값으로 url로 치면 디비에 저장이되는데
안드로이드에서는 안되네요 ㅠㅠㅠ 이거 도대체 뭐가 문제인가여 ㅠㅠ
커넥션이 잘 안되는거 같은데 커넥션어떻게 해야하나여 ㅠ