android - improving speed performance on a data call -


i making api call web service android application problem returns around 22000 records, loading array after convert each record object assign array listview. fastest/best way fetch data web service? (buffer) ? , best practices type of issues.

i recommend using library handle data call...

please try using android query; specifically, see section entitled asynchronous network.

this aquery library (androidquery) lightweight, , requires 1 jar small jar file. can used maven or gradle android projects well. allows fetch xml or json data remote server in either asynchronous or synchronous fashion. have used many times json back-end, , real timesaver.

this library allows specify progressbar automatically appear , disappear during network download process.

here example of http call json back-end, asynchronously:

public void asyncjson(){      //perform google search in few lines of code      string url = "http://www.google.com/uds/gnewssearch?q=obama&v=1.0";     aq.ajax(url, jsonobject.class, this, "jsoncallback");  }  public void jsoncallback(string url, jsonobject json, ajaxstatus status) {      if(json != null) {             //successful ajax call     } else {             //ajax error     }  } 

aquery can simplify other aspects of android programming (such eliminating findviewbyid() calls many scenarios).


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -