public
class
Client_Protocol {
StringTokenizer token =
null
;
Client_Protocol(String msg) {
String fp =
""
;
String n_message =
""
;
token =
new
StringTokenizer(msg,
"/"
);
fp = token.nextToken();
n_message = token.nextToken();
if
(fp.equals(
"LOGINPAGE"
)) {
Login_protocol(n_message);
}
else
if
(fp.equals(
"CREATEPAGE"
)) {
Id_Check(n_message);
}
}
private
void
Login_protocol(String m) {
token =
new
StringTokenizer(m,
"@"
);
String protocol = token.nextToken();
String msg = token.nextToken();
if
(protocol.equals(
"ISRIGHT"
) && msg.equals(
"true"
)) {
intent =
new
Intent(getApplicationContext(), Carpool_main_Activity.
class
);
so.msg =
"REQUEST_INFO/"
+ editText_id.getText().toString();
send_toServer(so);
}
else
if
(protocol.equals(
"ISRIGHT"
) && msg.equals(
"false"
)) {
println(
"계정 정보가 틀렸습니다."
);
}
else
if
(protocol.equals(
"ISRIGHT"
) && msg.equals(
"notfound"
)) {
println(
"아이디가 틀렸습니다."
);
}
else
if
(protocol.equals(
"LOGIN"
)) {
intent.putExtra(
"SendObject"
,so);
SharedPreferences pref = getSharedPreferences(
"pref"
,
0
);
SharedPreferences.Editor editor = pref.edit();
editor.putString(
"ID"
,so.id);
editor.commit();
send_toServer(
"REQUEST_ROOM_INFO/NO_MEANING"
);
Progress_Handler.sendEmptyMessage(
0
);
while
(
true
){
if
(!helper.arriveVector){
}
else
{
Progress_Handler.sendEmptyMessage(
1
);
break
;
}
}
System.out.println(
"액티비티 실행"
);
}
}
private
void
Id_Check(String m) {
if
(m.equals(
"EXIT"
)) {
helper.g_msg = m;
System.out.println(
" GLobal Mesaage change"
);
}
else
{
helper.g_msg = m;
System.out.println(
" GLobal Mesaage change"
);
}
}
}