Help others to do the demonstration system, only has the basic additions and deletions to check and change function.
The core is the Android side and the background to transmit data over HTTP
Background is ASP. Database is MS SQL 2008
Android side
private void GetData () {requestparams params = new Requestparams ();p arams.put ("Action", "Getlista");p arams.put ("Chepai ", Etsearch.gettext (). toString ()); Netclient.post (Constants.che_url, params, new Basejsonres () {@Overridepublic void Onmysuccess (String data) {listdata.clear (); Textutils.isempty (data)) {list<chemodel> models = (Json.parsearray (data,chemodel.class)); for (int i = 0; i < mod Els.size (); i++) {map<string, string> che = new hashmap<string, string> (); Che.put ("Name", Models.get (i). Getchepai ()); Che.put ("Info", Models.get (i). Getxinghao ()); Che.put ("id", Models.get (i). GetId ()); Listdata.add (che);}} Adpter.notifydatasetchanged ();} @Overridepublic void Onmyfailure () {Utils.showshorttoast (getactivity (), "Network Error");}});
Background (ASP)
private void Getdatalista (HttpContext context) { int _pageindex = 1; int _pagesize =; if (pageindex > 0) _pageindex = pageindex; if (pagesize > 0) _pagesize = pagesize; string where = ""; if (!string. IsNullOrEmpty (Weizhi)) { where = "Weizhi like '%" +weizhi+ "% '"; } String json = CheweiBll.Current.GetJSONdataForAndroid (_pageindex, _pagesize, "id ASC", where); Context. Response.Write (Common.JSONhelper.CreateResponseJson ("1", "", JSON. Replace ("\" Griddata\ ":}", "\" Griddata\ ": []}"). ToLower ())); }
http://download.csdn.net/detail/shmiluwabi666/9546471
Android reads the background data and displays it. Simulation Cell Vehicle Management system