Skip to content

ga-adi/cursor-adapters-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

title type duration creator
Cursor Adapters - Grocery List
lab
1:25
name city
Drew Mahrt
NYC

Cursor Adapters - Grocery List

Introduction

Note: This can be a pair programming activity or done independently.

In this lab, you will be displaying a list of grocery items from a SQLite database using a CursorAdapter. Each grocery item has a name, description, price, and type. On this screen, you will only be showing the name of each item.

The database is named SHOPPING_DB

The table is named SHOPPING_LIST

Exercise

Requirements

  • Extend and complete the SQLiteOpenHelper class to query the database for all of the grocery items
  • Make a ListView to display the grocery items
  • Use a CursorAdapter to display the queried grocery items

Bonus:

  • Delete an item from the database when you long-click on the list item (Look here for help)
  • Create a custom layout for the ListView item to show more info from the database

Starter code

The starter-code folder contains an Android project with the following:

  • A MainActivity.java file that prepopulates the database

Deliverable

The screenshot below shows what the app should look like.

Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages