I want to fill my ListView
with data that's going to come from the web in the form of JSON. The list should be theoretically infinite, with the app making requests for more data if scrolled to the bottom.
Cursor
or an Array(List)
adapter to link my online database with my ListView
? Here is the difference: BaseAdapter is a very generic adapter that allows you to do pretty much whatever you want. However, you have to do a bit more coding yourself to get it working. ArrayAdapter is a more complete implementation that works well for data in arrays or ArrayList s.
What does an Adaptor do for a view like a ListView? An adapter actually bridges between UI components and the data source that fill data into UI Component.
In Android development, any time we want to show a vertical list of scrollable items we will use a ListView which has data populated using an Adapter . The simplest adapter to use is called an ArrayAdapter because the adapter converts an ArrayList of objects into View items loaded into the ListView container.
SimpleCursorAdapter . Used to write apps that run on platforms prior to Android 3.0.
Well I think you should look at ContentProviders
. They are more natural to the problem that you are trying to solve. You have to implement your custom Cursor
which ContentProvider
returns on a query request.
Ref:
http://developer.android.com/guide/topics/providers/content-providers.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With