android - How can I make HttpClient works faster? -


i have application posts , gets php , mysql server. used function actions took 5 seconds. used httpparams didn't work, too.

is there way make faster?

string responsebine(){     log.d("destpek wext","");     try{         httpclient httpclient = new defaulthttpclient();         httpget httpget= new httpget(urlindex);         if(logged) {             httpresponse rs = httpclient.execute(teketin.httppost, localcontext);             entityutils.tostring(rs.getentity());             rs = httpclient.execute(httpget, localcontext);             entityutils.tostring(rs.getentity());         }         responsehandler = new basicresponsehandler();         string rsp = new string(httpclient.execute(httpget, responsehandler).getbytes("iso-8859-1"),"utf-8");         return rsp;     }catch(exception e){         system.out.println("exception : " + e.getmessage());     }     log.d("destpek wext","");     return  ""; } 

i facing similar issues yours until discovered volley(android library http requests). using volley helped reducing seconds.

still not satisfied queries taking 2 3 seconds, switched node.js + mysql , brought down timing around 200 milliseconds!


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -