In the blog has the landing interface article http://blog.csdn.net/vestigge/article/details/8124674
It's not repeated, just look at the login code,
Passing the string with Mina has been looked at, and to implement the object is also very simple, only need to modify the filter:
Chain.addlast ("Codec", new Protocolcodecfilter (new objectserializationcodecfactory));
In the Android client, the logged in activity:
public class Loginactivity extends activity{private edittext accountedittext;
Private EditText Passwordedittext;
Private CheckBox Remebercheckbox;
public void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);
Requestwindowfeature (Window.feature_no_title);
Setcontentview (R.layout.activity_login);
accountedittext= (EditText) Findviewbyid (R.id.login_account);
passwordedittext= (EditText) Findviewbyid (R.id.login_password);
remebercheckbox= (CheckBox) Findviewbyid (R.id.login_remember);
Findviewbyid (R.id.login_login). Setonclicklistener (New Onclicklistener () {public void OnClick (View v) {
if (Accountedittext.gettext (). toString (). Equals ("") | | Passwordedittext.gettext (). toString (). Equals ("")) {Toast.maketext (loginactivity. This, "The account or password cannot be empty!"
", Toast.length_short). Show ();
}else{User User=new User ();
User.setaccount (Integer.parseint (Accountedittext.gettext (). toString ()));
User.setpassword (Passwordedittext.gettext (). toString ());
User.setoperation (Vqmessagetype.login);
Boolean b=new vqclient (). Sendlogininfo (user); If the login succeeds if (b) {Toast.maketext (loginactivity.this, "Login successful!")
", Toast.length_short). Show ();
StartActivity (New Intent (Loginactivity.this,mainactivity.class)); }else{Toast.maketext (loginactivity.this, "Connection timed out, Login failed!")
", Toast.length_short). Show ();
}
}
}
}); }
}