Chapter 6. Populating Your GUI with Data

In the previous chapter, we learned how to work with data stored in the internal memory of our customer's phone using file storage and SQLite. In this chapter, we will see how to populate our GUI (Graphical User Interface) with this data.

In this chapter, we will go through the following recipes:

  • Populating simple objects
  • Populating datepicker
  • Populating the spinner
  • Populating ListViews
  • Creating a custom adapter

Introduction

After offering the possibility to insert and delete data from a database or file, the logical follow-up is to display this data on our GUI. We already did this for simple elements like buttons and labels in the previous chapter without paying too much attention to what was happening. Also, we never tried to display types other than string or int. In this chapter, we will look at the mechanisms involved in the modification of the data displayed by the GUIs and display complex objects into complex views such as ListView or a drop-down list (known as the spinner).

To populate these GUI objects, we will need to master the concepts of adapter play a little with the String.xml file of the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.8.82