SQLite + Android - Insert Data in Database Table (Book Library App) | Part 2

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 144

  • @fral.2708
    @fral.2708 2 года назад +5

    Thank you very much for this! Just a question: to export the databases every time is the only way to see the datas with SQLite-Studio? It is a bit cumbersome. Maybe there is some extension for Android Studio to see the datas directly on the IDE?

  • @RealOny
    @RealOny 4 года назад +5

    My application keeps crashing upon clicking on the add button, try catch yielded no results and kept crashing.

    • @majinzeke4977
      @majinzeke4977 4 года назад +1

      Same. I need help!

    • @jemmytech5474
      @jemmytech5474 3 года назад

      Same, I need help

    • @aimilios4794
      @aimilios4794 3 года назад +3

      Same but i fix it after crying 2 hours above the keyboard. Open the github link in the description of the video and check line by line the Database helper. In my case i forgot to add the following line "this.context = context;" in the constructor of the Database Helper class. Hopefully this will help you!

    • @bernardolaborde5310
      @bernardolaborde5310 3 года назад +3

      The problem was the space in the query
      before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      You have to space in the begining of Interger

    • @xavispartan117
      @xavispartan117 3 года назад

      i had the same issue, i put as comment the Toast line in the else statement in the MyDataBaseHelper class
      before:
      } else {
      Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show();
      }
      after:
      } else {
      /*Toast.makeText(context, "¡Venta Guardada!", Toast.LENGTH_LONG).show();*/
      }
      it worked for me, you can try it

  • @عبدالسلامخالدبدرصيام

    شكرا جزيلا .. لقد استفدت كثير..

  • @РусланАлимов-я2у
    @РусланАлимов-я2у 2 года назад

    You are the best kotlin Shifu that I have ever listent to. Thank you very much😘

  • @seifabdihafid681
    @seifabdihafid681 3 года назад +5

    I keep getting failed 😞 when I click at the add button on my add activity class

    • @rubinho388
      @rubinho388 2 года назад

      did you get why it was getting failed? I'm with the same problem

    • @seifabdihafid681
      @seifabdihafid681 2 года назад

      @@rubinho388 yeah I was able to after a few trials thanks

    • @baraaksarihabiles5954
      @baraaksarihabiles5954 2 года назад

      @@seifabdihafid681 can you tell me what did you do please..I have the same problem

    • @jimbotron2
      @jimbotron2 Год назад

      @@baraaksarihabiles5954 I fixed it by changing the DATABASE_VERSION to 2 instead of 1

  • @ravanelmochamad
    @ravanelmochamad 3 года назад +6

    7:49
    I don't have the databases, help please

    • @zawhninthet843
      @zawhninthet843 Год назад

      me too; if u r ok help me pls

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @skanerkodowkreskowychqr3794
    @skanerkodowkreskowychqr3794 11 месяцев назад

    Thank You. Very Useful video

  • @hassanalighumman1473
    @hassanalighumman1473 2 года назад

    Love from Pakistan bro. Great video series.

  • @dilnamo
    @dilnamo Год назад +1

    Hello, Can you help me? I wrote your code in my Android studio, but it is showing only Failed?

  • @sakshamvasudev1645
    @sakshamvasudev1645 Год назад

    we can see database through app inspection as well

  • @dmytroazhdier2311
    @dmytroazhdier2311 4 года назад +4

    Thanks for your time!
    This video was helpful to me :-)

  • @pandakaradi4959
    @pandakaradi4959 4 года назад +3

    how to add images too with this!

  • @jenniesloft9225
    @jenniesloft9225 2 года назад +2

    I have two titles inside of database file not three and it doesn't open by sqllite

    • @1ngramM
      @1ngramM Год назад

      do you have an answer to this?

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @shaheershukri
    @shaheershukri 3 года назад

    if i wanna add some column in database.. where do i need to modified my code?

  • @laziboi5975
    @laziboi5975 3 года назад +1

    I like how he explain the code 😁

  • @abdulrehmanalibrohi221
    @abdulrehmanalibrohi221 Год назад

    will you please tell me in backend you will use java or kotlin?

  • @jakubdura8452
    @jakubdura8452 2 года назад

    U can use database inspector to show db :D

  • @zaidtahir936
    @zaidtahir936 Год назад +1

    I am doing same like as but my Toast show "Failed" guide me ?

  • @michaelvalentino9141
    @michaelvalentino9141 Год назад

    What application that you use to create android application?

  • @stephenbender2807
    @stephenbender2807 28 дней назад

    My solution to the "Add Movie" crashing the database was to change:
    public DatabaseHelper(@Nullable Context context) {
    super(context, DATABASE_NAME, DATABASE_VERSION, null);
    this.context = context; }
    to
    public DatabaseHelper(@Nullable Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
    this.context = context; }

  • @AbdulBasit-yf8xv
    @AbdulBasit-yf8xv 3 года назад

    Can you make a video about foreign key insertion as well..

  • @jayperson2239
    @jayperson2239 Год назад +1

    7:47 there is no sqlitetutorial files in my device file explorer. can u help me about this?

    • @zaidtahir936
      @zaidtahir936 Год назад

      Bro same did you solve that problem?

    • @lanzmanlapaz
      @lanzmanlapaz Год назад

      same here

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @shashanksp9168
    @shashanksp9168 2 года назад +1

    DB NAMES OF bookauthor is taking as book_authorTEXT , and same folows for the title please help
    here's my code
    String query ="CREATE TABLE " + TABLE_NAME +
    " (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
    + COLUMN_TITLE + " TEXT ,"
    + COLUMN_AUTHOR + " TEXT,"
    + COLUMN_PAGES + " INTEGER );";
    after creation of table it shows book_authorTEXT and book_titleTEXT together in database

    • @shashanksp9168
      @shashanksp9168 2 года назад

      I'm not getting a space between book_author and TEXT in the create code too..

  • @amnakhalil5587
    @amnakhalil5587 4 года назад +2

    it's throwing null pointer exception as i click to add ........Is there anyone to help me?

    • @majinzeke4977
      @majinzeke4977 4 года назад +1

      I need help with this too!!! Please

  • @playtoy_cardi_7201
    @playtoy_cardi_7201 7 месяцев назад

    what if i want to insert an image of the book also, can ou explain pls or make a video with this app and code?

  • @ampa4989
    @ampa4989 3 года назад

    The video is helpful, but that dracula mode is a bit difficult to discern.

  • @amandasjoberg463
    @amandasjoberg463 6 месяцев назад

    I am struggling with how to avoid opening and closing the database multiple times, because I read that best practise is to open it once when starting the app and to close it once when closing the app. I also read that is recommended to have the dbhelper as a singleton. I have several viewmodels that access the database through the database helper and I'm finding it difficult to put all of this together... how do I open it once if I need both a writable and readable db? Also, the context that is passed, is it the activity or fragment? I have one activity and several fragments which in turn have their own view models. Currently all viewmodels create a new dB helper and each method in the dBhelper class opens and closes the dB. I'm real,y struggling with architecture... Anybody got any tips?

  • @sinoiumarzoda7857
    @sinoiumarzoda7857 4 года назад

    Thank you a lot, I like the way you explaining.

  • @puch9830
    @puch9830 2 года назад

    i have login and register page, how do i create crud along with login?how do i put them in one db...i keep having problems on every step

  • @Dewnam
    @Dewnam Месяц назад

    Hey there’s no option like device file explorer what do I do?

  • @anastasiosarvanitis9533
    @anastasiosarvanitis9533 3 года назад +1

    Thank you so much, your tutorial is amazing, I will be checking your udemy courses ;)

  • @حسنسلاممكي
    @حسنسلاممكي 7 месяцев назад

    when i went to file explore and to data - data , i did not find my file project and it shows error to the over files that said the package not debuggable .!!!!!!!!

  • @nasrullahsafdari
    @nasrullahsafdari Год назад

    Thanks for the video, but I have a question, what if we want to create two tables? How we can do it?
    I tried several times but the second table was not created?
    Thanks

  • @dominikkajba8766
    @dominikkajba8766 3 года назад +1

    Brate legenda si

  • @deveshsingh4214
    @deveshsingh4214 3 года назад

    Thank you very helpful.

  • @Tu_Calisthenics
    @Tu_Calisthenics 3 года назад

    Thank you so much, i'm learn very much from you! :))

  • @willemsmit2929
    @willemsmit2929 4 года назад

    Thank you helped a lot!

  • @cjdrix
    @cjdrix 3 года назад +1

    Any fix for BookLibrary keep stopping. Every time i put some data it always says Booklibrary keep stopping. Thankyou in advanced

    • @StevdzaSan
      @StevdzaSan  3 года назад

      Switch to ROOM Library

    • @a_36_atharvathosar11
      @a_36_atharvathosar11 3 года назад

      The error comes because of the else statement in the addBook() function. I Don't know the reason but I worked my way to the conclusion through debugging.

    • @a_36_atharvathosar11
      @a_36_atharvathosar11 3 года назад

      For me, this.context = context statement was missing in the constructor. Fixing that fixed the issue for me.

    • @ricetech1396
      @ricetech1396 Год назад

      @@a_36_atharvathosar11 hey, how exactly did you fix that cus I am having de same issue

  • @leodehazover9
    @leodehazover9 Год назад

    Anyone please helps me, I dont have the purple navigation bar as above. How can I make it. I didnt see Stevdza created it. Please help!!!

  • @tusharchavan668
    @tusharchavan668 4 года назад

    Hii After Clicking On Item in recyclerview again there is one recyclerview inside it and I have to create table for it in same database but the name of the table is first recyclerview item name how can I?

  • @tqaquotes9379
    @tqaquotes9379 10 месяцев назад

    I have problem in settings the emulator, can anybody help?

  • @sandrokhoshtaria9923
    @sandrokhoshtaria9923 4 года назад

    Very good videos. Keep it up!

  • @majinzeke4977
    @majinzeke4977 4 года назад +2

    When I click on the add button, my app crashed. Do you guys might know why?

    • @majinzeke4977
      @majinzeke4977 4 года назад +1

      I got it to work

    • @jemmytech5474
      @jemmytech5474 3 года назад

      @@majinzeke4977 could you tell me bro, how

    • @jemmytech5474
      @jemmytech5474 3 года назад

      Problem solved. +923345850933 contact me to share the code.

    • @jemmytech5474
      @jemmytech5474 3 года назад

      Thank you dear stackoverflow

    • @wafaab1688
      @wafaab1688 3 года назад +1

      how did you resolve the problem ??

  • @coderinmood5119
    @coderinmood5119 3 года назад

    Awesome Video

  • @sammybelete4711
    @sammybelete4711 2 года назад

    how you guy found three files inside ur /data/data/project_name/database file, which android studio version are you using... i only got one file and i coded exactly in program and it create the table and don't even insert texts inside my rows...

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @wheepup8452
    @wheepup8452 2 года назад

    the database folder does not appear in the File Explorer. I followed the correct path. It says that "run-as:/data has wrong owner: 0/1000, not 100" Please help

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @كمالالحميري-ي6ض
    @كمالالحميري-ي6ض Год назад

    When I add the data the message tell me not added where is the mistake

  • @minhnguyendang8900
    @minhnguyendang8900 3 года назад

    How to update recycleview after insert data ?

  • @gamesforu6619
    @gamesforu6619 Год назад

    Can I save object in database instead of multiple variables as you did?

    • @mannb1023
      @mannb1023 Год назад +1

      no, sql is not an object oriented language. If you want to store objects maybe a noSql language can do it? But I doubt that too

  • @ifatou
    @ifatou 9 месяцев назад

    👏👏👏👏 espectacular

  • @codingwithme3794
    @codingwithme3794 4 года назад

    Yes, true, but for me, I did not find a database file to choose the Book.db file to display on db browser for sqlite. What is the problem?

    • @StevdzaSan
      @StevdzaSan  4 года назад +1

      Make sure you opened a right app path.

    • @codingwithme3794
      @codingwithme3794 4 года назад +2

      @@StevdzaSan The problem has been resolved and now I want to display a link but there is a problem when it displays in db browser for sqlite it displays like this: Landroid.text.style.URLSpan; @ 7cc9ba
      How do I display the link correctly in db browset for sqlite and in programming when using recyclerview I will display the image from the link Is this idea correct in the sense will it be displayed through the link Can you help me?

    • @onepath8122
      @onepath8122 3 года назад +3

      @@codingwithme3794 how you solved the previous issue?

    • @zawhninthet843
      @zawhninthet843 Год назад

      how u resolve the previous problem

    • @eldomart
      @eldomart 6 месяцев назад

      try File-Invalidate caches-Clear VCS Log Caches and Indexes->Invalidate and Restart, it will restart and start from building Gradle again, the Persistent Database should show up in the Device File Explorer by itself without us having to start the App at all.

  • @GeorgeR-dt4yu
    @GeorgeR-dt4yu 2 года назад

    There were errors downloading files and/or directories: Writing local file failed!
    when saving sqlite

    • @shashanksp9168
      @shashanksp9168 2 года назад

      first close the database opened in the sqlbrowser and retry saving .

  • @BrianMaia
    @BrianMaia 4 года назад

    Thank you very much! You helped me a lot.

  • @andhikapratama345
    @andhikapratama345 3 года назад

    You are amazing

  • @TheEasyNotes
    @TheEasyNotes 4 года назад +1

    i m wating for the 3rd part/please hurry up

  • @kghoxbulah465
    @kghoxbulah465 4 года назад

    How to do it Click on the title to transfer data Another activity displays the title and content

    • @bernardolaborde5310
      @bernardolaborde5310 3 года назад

      The problem was the space in the query
      before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      You have to space in the begining of Interger

  • @kostiasavchenko7742
    @kostiasavchenko7742 2 года назад

    Thank's a lot. It works :)

  • @bahrifaten8672
    @bahrifaten8672 8 месяцев назад

    It doesn't work it's Always shows failed

  • @kghoxbulah465
    @kghoxbulah465 4 года назад

    Thanks

  • @Schnovak
    @Schnovak 8 месяцев назад

    4:03

  • @niphomahlangu2733
    @niphomahlangu2733 2 года назад

    Thank you. 👏🔥👏🔥👏

  • @hyno
    @hyno 2 года назад

    #DONE

  • @jham6676
    @jham6676 3 года назад +1

    why it is failed

  • @rubenoganesyan1669
    @rubenoganesyan1669 4 года назад

    Thx a lot.

  • @harshithas9410
    @harshithas9410 4 года назад

    I'm getting like duplicate resources how to solve it

  • @johnohnitmartinez907
    @johnohnitmartinez907 3 года назад

    Can sqlite can be realtime ?

  • @gilmarcossantos3951
    @gilmarcossantos3951 2 года назад

    Muito obrigado!

  • @naznazanavc7780
    @naznazanavc7780 4 года назад

    magnificent

  • @hapham7098
    @hapham7098 3 года назад

    thank youuuu

  • @pandakaradi4959
    @pandakaradi4959 4 года назад

    How to store images insql

  • @vikassingh1801
    @vikassingh1801 4 года назад +2

    Bro Integer value is not storing in database my app crashes everytime but string value are getting stored perfectly... Plss help

    • @AhmedMostafa-so2jp
      @AhmedMostafa-so2jp 4 года назад +2

      i got the same problem, have you fixed it?

    • @jemmytech5474
      @jemmytech5474 3 года назад

      Why he doesn't response to anyone?

    • @bernardolaborde5310
      @bernardolaborde5310 3 года назад

      The problem was the space in the query
      before (" + COLUMN_ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      after "" (" + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +"
      You have to space in the begining of Interger

  • @moataz2415
    @moataz2415 3 года назад +2

    always give me failed after all of that , short sad story

  • @adityaverma3832
    @adityaverma3832 4 года назад

    i can't call mydatabasehelper object in mainactivity can anyone help me

  • @namanagarwal3831
    @namanagarwal3831 4 года назад

    Tutorials awesome but one thing is going wrong when I rotate phone from portate to landscape recycling view not showing any data how to fix it portate mode working fine 🙄

    • @yishakwondim6698
      @yishakwondim6698 4 года назад

      you have to create another xml file for landscape mode

  • @leandrocoelhinho
    @leandrocoelhinho 4 года назад +1

    muito bom, parabéns

  • @pankajwandre5961
    @pankajwandre5961 4 года назад

    👍👍👍👍

  • @anohene1
    @anohene1 4 года назад

    Can you do a video of this in Kotlin too?

    • @StevdzaSan
      @StevdzaSan  4 года назад +1

      I started creating kotlin tutorials for beginners. There will be an advanced topics in the future as well

    • @anohene1
      @anohene1 4 года назад

      @@StevdzaSan Sure. I'll wait for that. Thanks

  • @ntry6429
    @ntry6429 2 года назад

    db.execSQL("DROP TABLE IF EXISTS" + TABLE_NAME);
    _EXISTS_ is Error in my program..

    • @ricetech1396
      @ricetech1396 Год назад

      @ntry Try out adding space after EXISTS

  • @umangkosrekar4788
    @umangkosrekar4788 3 года назад +4

    i m getting and error of "E/RecyclerView: No adapter attached; skipping layout" can anyone help

  • @kalidsherefuddin
    @kalidsherefuddin Месяц назад

    Thanks