try {
// CALL GetText method to make post method call
GetText();
} catch (Exception ex) {
Dialog();
// show dialog
}
}
});
}
// Create GetText Metod
public void GetText() throws UnsupportedEncodingException {
// Get user defined values
Title = postTitle.getText().toString();
Name = postName.getText().toString();
Contents = postContents.getText().toString();
Log.d(this.getClass().getName(),"정보받냐1");
// Create data variable for sent values to server
String data = URLEncoder.encode("name", "UTF-8")
+ "=" + URLEncoder.encode(Title, "UTF-8");
data += "&" + URLEncoder.encode("email", "UTF-8") + "="
+ URLEncoder.encode(Name, "UTF-8");
data += "&" + URLEncoder.encode("user", "UTF-8")
+ "=" + URLEncoder.encode(Contents, "UTF-8");
String text = "";
BufferedReader reader = null;
// Send data
try {
// Defined URL where to send data
URL url = new URL("주소창");
Log.d(this.getClass().getName(),"정보받냐2");
// Send POST data request
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the server response
reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuilder sb = new StringBuilder();
String line = null;
// Read Server Response
while ((line = reader.readLine()) != null) {
// Append server response in string
sb.append(line + "\n");
}
text = sb.toString();
} catch (Exception ex) {
} finally {
try {
reader.close();
} catch (Exception ex) {
Dialog();
if(Title !=null);
else if (Name !=null);
else if (Contents !=null);
Log.d(this.getClass().getName(),"정보받냐3");
}
}
설정해놓은 로그들은 잘작동합니다만, 그 정보를 보내는곳 위치가 어디인지 몰라서 헤매고있습니다...
번거로우시겠지만 답변부탁드리며, 남은연말 잘보내시길바랍니다!