I'm not sure about 5K records, but ListViews are known to handle well even large number of records
using an effective recycling mechanism. See this thread for a detailed explanation.
Now, do yourself a favor and use Volley for your network resource loading. It does far better job
in async loading of records into lists than most of us... In any case either the library you use or your own code must perform the resource loading/networking from a background thread.
You should also apply the ViewHolder pattern to your code. Using a ViewHolder
is always a hood idea. it becomes crucial for a really large number of records. Please use it.
It should look like this
class ViewHolder {
textView text1;
Button button1;
}
class MyAdapter {
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder = null;
if (convertView==null){
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
convertView = inflater.inflate(layoutResourceId, parent, false);
viewHolder = new ViewHolderItem();
viewHolder.text1 = (TextView) convertView.findViewById(R.id.text1);
viewHolder.button1 = (Button) convertView.findViewById(R.id.button1);
..........
convertView.setTag(viewHolder);
}
viewHolder = (ViewHolderItem) convertView.getTag();
ObjectItem objectItem = data[position];
..........
}
}
And, finally, if you really need partial loading together with a Load more functionality, please read:
http://www.androidhive.info/2012/03/android-listview-with-load-more-button/