• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to make this kind of database ?

Hello all :)

Im making an android app,something like book on mobile.

This is the first time I m going to use SQL database,so I do not know much about it.

My problem is that I have activity with 3 different cardviews.
Each cardview represents section in that "book".

I want when I click on the first cardview to open up a list of where the list of lessons from that section of book is displayed, using the recyclerview that gets the data from the SQL database.

After the selected lesson, I want to open up activity that will open a particular PDF file (for example, Lesson 2 is selected and opens the pdf file lesson_2.pdf).

And so for every lesson and section.



This is very complicated for me.
If someone could help me, I would be very grateful.
 
If your app is displaying the contents of whole files, then I wouldn't use the database to store those. Just place them somewhere on the filesystem, within your app's data area.
Your database schema could store the list of lessons, and the location of the file which contains related content.
So you may have the following tables:-

Section: Stores the sections which are in the book.
Lessons: The individual lessons. Has a foreign key reference to the Section table. Also stores the location of the related PDF file.
 
If your app is displaying the contents of whole files, then I wouldn't use the database to store those. Just place them somewhere on the filesystem, within your app's data area.
Your database schema could store the list of lessons, and the location of the file which contains related content.
So you may have the following tables:-
Section: Stores the sections which are in the book.
Lessons: The individual lessons. Has a foreign key reference to the Section table. Also stores the location of the related PDF file.
 
If your app is displaying the contents of whole files, then I wouldn't use the database to store those. Just place them somewhere on the filesystem, within your app's data area.
Your database schema could store the list of lessons, and the location of the file which contains related content.
So you may have the following tables:-
Section: Stores the sections which are in the book.
Lessons: The individual lessons. Has a foreign key reference to the Section table. Also stores the location of the related PDF file.
Thanks.
Do you have any example how I can do this?
 
Just Google SQLite, which is the database used on Android. There are many tutorials and examples on the web.
 
Back
Top Bottom