Android - Adapter

Why we need adapter?
Suppose you have a set of data having students name of an school that you need to show in your android application. Then how you will display it?

If you arrange them for a particular display size then what will happen when the application get installed to another device? Your layout design will be broken.

So what is the solution here? We have versatile devices in the market. And we have to make our application compatible to all of them.

Here we need to use adapter. According to its etymological meaning, adapter is something that can adapt. Basically, it adapts and arrange a list of data to display over versatile android devices.


We have three types of adapter implementation in android.

  • ArrayAdapter: Takes a set of data from an array
  • SimpleCursorAdapter: Takes data from a data object called Cursor, used to capture data from database.
  • BaseAdapter: Used to render custom view using adapter.































Comments