Android SDK: How to Work with Multiple Database Tables


show more Working with multiple database tables 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 ...

Working with multiple database tables

My sample application so far uses a single database table to store tours data. I'm now going to add some new functionality to the application. I'm going to let the user add a tour to a list that we'll call mytours--a custom list-- and then I'll let them show a filtered view that only shows the tours that they've selected. I'll need a second database table to manage this, and I'll define it first in my database open helper class. Now this entire task will take quite a bit of code, so as I have in the past, I've provided a typing help file called typinghelp.txt that's a part of the Multiple Tables project.

I'll start with the first snippet where I'm defining the table mytours. There are two declarations here, one for the new table name, and one for an SQL create statement that will create the table in the database. I'll copy that code to the clipboard, and I'll go to the class ToursDBOpenHelper.java. In the class I'll place the cursor after al...

Working with multiple database tables
Video duration: 10m 28s 3h 41m Intermediate

Viewers:

Working with multiple database tables 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 ...