Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN ANDROID STUDIO Consider the below table : Table BOOKS Field Type Key Id Int PRIMARY Name TEXT Author TEXT ISBN TEXT * ISBN is

IN ANDROID STUDIO Consider the below table :

Table BOOKS
Field Type Key
Id Int PRIMARY
Name TEXT
Author TEXT
ISBN TEXT

* ISBN is a serial number for a book ex : 978-3-16-148410-0

Part I :

  1. Create the Book class with all getter and setter methods to maintain single book as an object.
  2. Create the DatabaseHandler class with the appropriate extends and the onCreate and onUpdate methods.
  3. Create the method addBook(Book B) that inserts a record in the table.
  4. Create similarly the methods updateBook(Book B) and deleteBook(Book B)
  5. Create the method getListBooks() that returns a List.

Part II :

Create the below activities :

MainActivity:

  • Allows the user to create a new Book using a method from part I.
  • Have a Display button that will open ListBooksActivity when clicked.

ListBooksActivity :

  • It will display a List of all the books entered by the user in the database, using a the list method from part I
  • When the users clicks on a certain book in the list, two Buttons will then be visible : Delete and Update. A text containing the ISBN of the book will be visible also.
  • When the user clicks on the delete Button, he will be asked in a dialog box if he wants to delete the selected book, when confirmed the book will be deleted using a method from part I.
  • If the users wishes to change the ISBN of a book, he can change it in the displayed text box and click on Update button that will update the information in the database.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions