1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to make this kind of database ?

Discussion in 'Android Development' started by Bojan Dolić, Oct 30, 2018.

  1. Bojan Dolić

    Bojan Dolić Newbie
    Thread Starter

    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.
     


  2. Deleted User

    Deleted User Guest

    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.
     
  3. Bojan Dolić

    Bojan Dolić Newbie
    Thread Starter

     
  4. Bojan Dolić

    Bojan Dolić Newbie
    Thread Starter

    Thanks.
    Do you have any example how I can do this?
     
  5. Deleted User

    Deleted User Guest

    Just Google SQLite, which is the database used on Android. There are many tutorials and examples on the web.
     
  6. Bojan Dolić

    Bojan Dolić Newbie
    Thread Starter

    How can I fill the database with the lessons when the user enters the application.
     
Loading...
Similar Threads - kind database
  1. manjula1
    Replies:
    0
    Views:
    424
  2. FoxMulder
    Replies:
    0
    Views:
    371
  3. Cinemato
    Replies:
    0
    Views:
    408
  4. RamAy
    Replies:
    1
    Views:
    892
  5. arpan_de
    Replies:
    0
    Views:
    243
  6. Steven Schroeder
    Replies:
    0
    Views:
    484
  7. Zarox
    Replies:
    7
    Views:
    8,486
  8. John Galli
    Replies:
    3
    Views:
    568
  9. Notes_Norton
    Replies:
    6
    Views:
    918
  10. dontpanicbobby
    Replies:
    12
    Views:
    1,941

Share This Page

Loading...