How to Retrieve and Display Data with the Android SDK


show more Retrieving and displaying data provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage show less
please wait ...

Retrieving and displaying data

Once you've inserted data into a database table, the next natural thing you'd like to do is retrieve and display it. I'm working in a new version of the project called RetrieveData. In this project's datasource class, I already have the code to add new rows. It's called the Create Method. And now I'll add code to retrieve all rows and all columns of the same database table. I'll start at the top of the class. I'll define a constant which will be an array of strings. The array will contain one string for each column in the database table.

I'll create it here as a private static final field, I'll data type it as String with opening close bracket, which means it's an array, and I'll name it allColumns. I'll set it using a pair of braces, and then within the braces I'll define a commented limited list of all of my column names. The column name constants are in my OpenHelper class. So I'll start off with ToursDBOpenHelper, and then I'll star...

Retrieving and displaying data
Video duration: 11m 44s 3h 41m Intermediate

Viewers:

Retrieving and displaying data provides you with in-depth training on Developer. Taught by David Gassner as part of the Android SDK: Local Data Storage

Subject:
Developer
Software:
Android Java
Author:
please wait ...