Answered step by step
Verified Expert Solution
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 :
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 :
- Create the Book class with all getter and setter methods to maintain single book as an object.
- Create the DatabaseHandler class with the appropriate extends and the onCreate and onUpdate methods.
- Create the method addBook(Book B) that inserts a record in the table.
- Create similarly the methods updateBook(Book B) and deleteBook(Book B)
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started