轻量级的框架肯定首选webapi,weibservice我劝你别用,VPN也是扯淡。
/**
*
查找一条数据
*
@param
uid
*/
public
user
find(integer
uid){
sqlitedatabase
db=dbopenhelper.getreadabledatabase();
//创建数据库辅助类
cursor
cursor
=db.rawquery("select
*
from
user
where
uid=?",
new
string[]{uid.tostring()});
//创建一个游标
if(cursor.movetofirst()){
//循环遍历查找数组
int
uid2=cursor.getint(cursor.getcolumnindex("uid"));
string
uname=cursor.getstring(cursor.getcolumnindex("uname"));
string
uaddress=cursor.getstring(cursor.getcolumnindex("uaddress"));
user
user=new
user();
user.setuid(uid2);
user.setuname(uname);
user.setuaddress(uaddress);
return
user;
}
cursor.close();
return
null;
}