http - Android - Open URL in background -


there website example http://website.com can stuff there, link example: http://website.com/3020/hype. have go link article (3020) liked. can stuff when loged in.

i have this:

httpclient client = new defaulthttpclient();               string geturl = "http://website.com/3020/hype/";             httpget = new httpget(geturl);             httpresponse responseget = client.execute(get, cookiestuff); 

where cookiestuff cookie string got loggin in.

this works, takes ages. there option?

yes there nother option.. internet connections , database connection should made in aynctask or handler.. improve time taken connection (the connections make in background)..

here example async task:

private class yourtask extends asynctask<string, void, string> {     @override     protected string doinbackground(string... s) {          //here have make loading / parsing tasks         //don't call ui actions here. example toast.show() couse exceptions         // ui stuff have make in onpostexecute method      }      @override     protected void onpreexecute() {         // method called during doinbackground in process         // here can example show progressdialog     }      @override     protected void onpostexecute(long result) {         // onpostexecute called when doinbackground finished         // here can example fill listview content loaded in doinbackground method      } 

}

to execute asynctask:

new yourtask().execute("");


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -