1,首先安装android按照网址:http://www.open-open.com/lib/view/open1386252535564.html,
2,正式开始入门:
a,要知道android客户端与服务器之间是如何通信的
其关键部分代码如下:是将客户端的请求发给服务器
public class UserService {
/**
* 验证用户登录是否合法 返回值:请求是否成功
*
* @throws Exception
*/
// get方式传递参数HttpUrlConnection,传递登陆时的数据
public static String check(String name, String psw) throws Exception {
// 192.168.1.100
// Android模拟器默认的地址是10.0.2.2
String urlStr = "http://10.0.2.2:8080/AppServer/doLoginServlet";
// 将用户名和密码放入Ha