0

What is adapter in Android what is the use of it?? I googled it but couldnt find out a clear solution.can anyone please explain me what is Adapter and its use in Android. If anyone knows any link regarding this topic please provide me..it will be very useful.. thanks in Advance

Kittu Rajan
  • 775
  • 1
  • 9
  • 7
  • Possible duplicate http://stackoverflow.com/a/3680182/1134705 – jnthnjns Dec 20 '12 at 13:05
  • good tutorial: http://www.vogella.com/articles/AndroidListView/article.html – Rodrigo Dec 20 '12 at 13:15
  • possible duplicate of [What's the role of adapters in Android?](http://stackoverflow.com/questions/3674951/whats-the-role-of-adapters-in-android) – Jack Dec 20 '12 at 14:34

3 Answers3

3

Adapter is used to supply the data to like spinner,radio buttons etc.... for example, you can create spinner programatically then spinner created without data, now with the adapter only we can supply the data to the spinner, this is the main advantage of adapter.

hope it will help to u.
Mohan
  • 651
  • 4
  • 13
2

Adapter is basically bridge between UI components and the data source that fill data into UI Component .

Like List view gets populated by using list adapter , from a datasource array

Chirag
  • 56,621
  • 29
  • 151
  • 198
2

Adapter is used as bridge between data layer and UIComponent. for example if you have some data about the Customer Offers and you want to display them in a ListView, you can do this by using an adapter. your adapter should response to (implement) some critical methods. getView(), getCount(), getItem, ....; When ListView want to display data it asks from it's adapter, the count of items, then for items that is visible in screen it asks the adapter for the "Row View". Important point is that, ListView by using adapter and an internal recycle manages the scraped views and prevents from creating many views. The parameter Convert View in method Adapter.getView(int position, View convertView, ViewGroup parent) is a scraped view.