PHP로 만든 소스를 서버로 업로드하여 안드로이드에서 DB호출을 하려고 만들었습니다.
하지만 ' PHP(이)가 중지되었습니다 ' 라는 메시지만 나오고 종료가 되는데 어디서 문제인지 모르겠습니다.
도와주세요 ㅜ
public class PHPActivity extends ListActivity {
/** Called when the activity is first created. */
JSONArray jArray;
String result = null;
InputStream is = null;
StringBuilder sb = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayList<NameValuePair> nameValueParirs = new ArrayList<NameValuePair>();
try{
//http post
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("서버 주소/category.php");
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}
catch(Exception e){
Log.e("log_tag", "Error in http connection" + e.toString());
}
//Convert response to string
try
{
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"),8);
sb = new StringBuilder();
sb.append(reader.readLine() + "\n");
String line="0";
while ((line = reader.readLine()) != null)
{
sb.append(line + "\n");
}
is.close();
result = sb.toString();
}
catch(Exception e)
{
Log.e("log_tag","Error converting result "+e.toString());
}
//END Convert response to string
String ct_name;
try{
JSONArray jArray = new JSONArray(result);
JSONObject json_data=null;
for(int i=0;i<jArray.length();i++){
json_data = jArray.getJSONObject(i);
ct_name = json_data.getString("category");
}
}
catch(JSONException e1)
{
Toast.makeText(getBaseContext(),e1.toString() ,Toast.LENGTH_LONG).show();
}
catch(ParseException e1){
e1.printStackTrace();
}
}
}




Logcat에는 어떻게 나오나요?