Adapters android
Adapters android
• An adapter acts like a bridge between a data source and the user
interface.
• It reads data from various data sources, coverts it into View objects
and provide it to the linked Adapter view to create UI components.
• The data source or dataset can be an Array object, a List object etc.
• You can create your own Adapter class by extending the BaseAdapter
class, which is the parent class for all other adapter class.
• Android SDK also provides some ready-to-use adapter classes, such
as ArrayAdapter , CursorAdapter,SimpleAdapter ,
SimpleCursorAdapter etc.
Adapter View
• An Adapter View can be used to display large sets of data efficiently in
form of List or Grid etc. , provided to it by an Adapter.
• Adapter view is capable of displaying millions of items on the UI while
keeping the memory and CPU usage very low and without any
noticeable lag
• It only renders those view objects which are currently on screen,hence
saving memory
• Reuses already created layout to populate data items, as the user scrolls,
hence saving CPU usage
• Adapter takes the data from a data source and converting it into view
and then passing it to the AdapterView .
• The AdapterView is responsible for displaying the data
• List controls are classes that extend android.widget.AdapterView
and include ListView, GridView, Spinner, and Gallery