ListView ? BaseAdapter ?.

Slides:



Advertisements
Similar presentations
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Advertisements

ListView Examples. Basic Steps for Creating a Listview 1.Create a layout (e.g., a LinearLayout), with elements for –the ListView (
Y A S O O B A L I b o r n o n 1 9 t h F e b r u a r y i n K a n p u r d i s t r i c t o f U t t a r P r a d e s h. H e s t a r t e d s i n g i.
More Java: Encapsulation, Getters, Setters, Anonymous Class 1 CS300.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Presenting Lists of Data. Lists of Data Issues involved – unknown number of elements – allowing the user to scroll Data sources – most common ArrayList.
Android: Layouts David Meredith
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
Introducing the Sudoku Example
Subtitle touch | Title of presentation | Date DD/MM/YYYY Touch Cloud Android SDK Ghady Rayess – Jan 19 th, 2013.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
Content providers Accessing shared data in a uniform way 1Content providers.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
Mobile Computing Lecture#11 Adapters and Dialogs.
ListView.
Create Navigation Drawer Team 2 Zhong Wang Jiaming Dong Philip Wu Lingduo Kong.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
9 Persistence - SQLite CSNB544 Mobile Application Development Thanks to Utexas Austin.
User Interfaces: Part 1 (View Groups and Layouts).
Chapter 7: Reveal! Displaying Pictures in a Gallery.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
DKU-MUST Mobile ICT Education Center 11. AdapterView.
datasourc e + itemRenderer + layout Storag e Data Source.
ListView and ExpandableListView
Recap of Part 1 Terminology Windows FormsAndroidMVP FormActivityView? ControlViewView? ?ServiceModel? Activities Views / ViewGroups Intents Services.
Adapters 1 CS440. Adapters (again!)  Adapters are bridging classes, that bind data to user-interface Views. The adapter is responsible for creating the.
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
More App Customizations. Overview  Application/ Activity Customizations: Themes  Menu Customizations  Custom Dialogs  Custom Toasts  Custom Buttons.
David Sutton USING CONTENT PROVIDERS. TOPICS COVERED THIS WEEK  Persistence  Introduction to databases  Content providers  Cursors  Cursor adapters.
Mobile Programming Lecture 4 Resources, Selection, Activities, Intents.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Test Title Test Content.
UNIT 11 로봇 전화번호부 3/4 로봇 SW 콘텐츠 교육원 조용수.
Further android gui programming
ListView: Part 2.
Android Application SQLite 1.
Reactive Android Development
Example 13 Wendy Balmer Indiana U
Android Programming Lecture 6
Android ListView Demo.
ANDROID LISTS.

Title Layout Subtitle.
Android Lists and Fragments
ITunes Lab Copyright © 2012 Pearson Education, Inc.
Title With Picture Layout
Title With Picture Layout
INSERT TOPIC INSERT SUB TOPIC.
Android Topics Custom ArrayAdapters
Android Topics Custom ArrayAdapters Creating an Event Listener
Android Developer Fundamentals V2
Title with Picture Layout
Android Topics Limited Resources and why we need to consider them.
Android Topics Lab 5 Part II
HNDIT2417 Mobile Application Development
Title with Picture Layout
Title with Picture Layout
Your Presentation Name
Name of Project Manager Date
COMPANY+ TITLE OF THE IDEA Click to add a photo
Reactive Android Development
ListView A view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view. ListAdapter is used to.
Presentation transcript:

ListView ? BaseAdapter ?

Steps to create a ListView Image Title Content Image Title Content Prepare data Sources[Images + Titles + Description] Define appearance of a single row in xml Create a Custom adapter that maps data from the data source to single row Set Adapter to the ListView Decide what happens when the user clicks on an item. Image Title Content Image Title Content Image Title Content Image Title Content ListView

Step 1: Prepare the data sources Class ContactModel{ String image; String title; String content; // override getter setter Methods } ArrayList<ContactModel> contact =new ArrayList<ContactModel>(); Create Model or Class to contain all the data of adapter view. Make ArrayList of Object type (Class or Model of first step). Set values to ArrayList. Pass data in new Object Adapter Class through Constructor. ContactAdapter contactAdapter = new ContactAdapter(context,contact)

Step 2: Define the appearance of a Single row ImageView TextView 2 TextView 2 Single Layout Xml

Step 3: Create Custom Adapter Create class that extends BaseAdapter Implement all the methods Use the getView method to map the data sources to the Views of a single row.

Step 4: Set Adapter to ListView listView.setAdapter(contactAdapter);

Questions ?