SQLite Database Tutorial Android Studio | Note List View App with Persistent Data

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • How to build a simple note taking app with persistent data using SQLite Database, Java and Android Studio. In this beginner friendly tutorial learn how to create an SQLite open helper java class to save, edit and delete persistent data. An excellent beginner Android App idea to follow along with to further your understanding of how to use list views and SQL Databases.
    SQLite Tutorial Source Code:
    github.com/codeWithCal/SQLite...
    ⏱️ TIMESTAMPS ⏱️
    00:00 - Intro
    00:53 - Note App XML
    04:40 - List View Java
    07:58 - SQLite Helper
    13:36 - Save Data
    14:25 - Edit Data
    16:39 - Delete Data
    #AndroidNoteApp #SQLiteAndroidStudio #AppDevelopment

КОМЕНТАРІ • 80

  • @captainbucket3397
    @captainbucket3397 Рік тому +3

    Probably one of the best Android tutorials out there, great job!

  • @sleep-zzz5120
    @sleep-zzz5120 2 роки тому

    How can i add api json data to sqlite database and how update, edit and delete it?

  • @loup3176
    @loup3176 Рік тому

    thanks for the good video But no matter how I look at it, I don't know how to link to the basic weekly list data storage. Can you give me some tips?

  • @PhilosephersStone1
    @PhilosephersStone1 Рік тому

    Hey, I have an issue. I set a custom path for my Database, but when I uninstall and reinstall the app, it says I can't open the database (which has not been deleted). So if anyone has an answer DX

  • @ahmedamer2340
    @ahmedamer2340 7 місяців тому

    hi Cal, thanks a lot for this amazing tutorial, I assuming i have the same app and i want to implement a button to share a note or some notes the user select to share them to an other device that has the app installed what is the best way to do that ? ... in short I am trying to share parts of the sqlite database how to do that ? waiting for your kind response and thanks in advance

  • @brendenbonker7636
    @brendenbonker7636 2 роки тому +15

    play at 0.75%. Thank me later

    • @LucasAndrade-lx9sx
      @LucasAndrade-lx9sx 2 роки тому

      I went beyond. Played at 0.50%, because I am beginner.

    • @monotyc6085
      @monotyc6085 4 місяці тому

      actually that would be 0.75 or 75% 🤓

    • @brendenbonker7636
      @brendenbonker7636 4 місяці тому

      @@monotyc6085 dead right 😅

  • @gametech2331
    @gametech2331 2 роки тому

    how to add one more option in listview?

  • @stephensagarinojr.4170
    @stephensagarinojr.4170 Рік тому

    Hi, is it possible to add an image?

  • @prismalakai
    @prismalakai 2 роки тому

    My Application say this "process system isnt reponding" and "myapp" keeps stopping can someone help me?. ;)

  • @rodrigoleitefonseca341
    @rodrigoleitefonseca341 8 місяців тому

    Good night friend. Do know how can i copy a database SQLITE from the assets directory to a APK? In kotlin.

  • @kingjiealdwinlee9189
    @kingjiealdwinlee9189 2 роки тому

    great tutorial i hope you could make a tutorial where you use firebase to do the same thing as the video

  • @GoodGuyOlo
    @GoodGuyOlo Рік тому +8

    Hi, first of all, great tutorial, but I do have some problems. At 7:42 when You start the app, and add notes, in Your case, after adding new notes, they show up after You click SAVE button. In my case, nothing shows up and I cant get it to work. I've tried and tried and probably redone whole project like 20 times and I still cant get my list to show up. Any ideas?
    Best regards

    • @mudkip2439
      @mudkip2439 7 місяців тому

      Hi, I managed to fix it by using onResume() in MainActivity.java, simply add:
      @Override
      protected void onResume() {
      super.onResume();
      setNoteAdapter();
      }
      setNoteAdapter() updates the ListView and that made it work for me

    • @developerazcom
      @developerazcom 4 місяці тому

      Hi make sure youre created on activity class the method saveNote. May be it helps.

  • @aanshi8189
    @aanshi8189 11 місяців тому

    Hey ! Can you make an application that uses both Android and dbms . A small company app that contains details of employees and company

  • @janettaylor260
    @janettaylor260 2 роки тому +1

    Hi Cal, great tutorial. Would you be able to advise how to create a dialog of Yes / No before the delete? Also, to add a filter search for the notes. Thanks

    • @CodeWithCal
      @CodeWithCal  2 роки тому +1

      Search and Filter tutorial:
      ua-cam.com/video/M73Vec1oieM/v-deo.html&ab_channel=CodeWithCal
      Yes no alert dialog
      stackoverflow.com/questions/2478517/how-to-display-a-yes-no-dialog-box-on-android
      Hope this helps :)

  • @chigoziehenryike6208
    @chigoziehenryike6208 3 роки тому

    I love your videos Man keep making more videos, Please make a login and registration video and a simple booking app..

    • @CodeWithCal
      @CodeWithCal  3 роки тому

      Hey, thanks a lot. Firebase log in / real time DB is on the long term to do list :)

  • @khrisulmer8533
    @khrisulmer8533 6 місяців тому

    Thanks for the help broooo!!!

  • @abdessamedben4090
    @abdessamedben4090 Рік тому

    thanks so much. I have checked Playback speed, it is still Normal

  • @Daily_SketchBook
    @Daily_SketchBook 3 роки тому

    hi cal can u please tell me how I can add an image and get the date and time when the note is taken

    • @CodeWithCal
      @CodeWithCal  3 роки тому

      Getting current time is as simple as
      Date today = new Date();
      I would then convert to a string using a date formatter, then as long as you use the same date formatter you shouldn't have any trouble converting back to date from string.
      And give this a try for the image:
      stackoverflow.com/questions/9357668/how-to-store-image-in-sqlite-database

  • @juncinthlumanog1140
    @juncinthlumanog1140 2 роки тому

    Thank you, Pal

  • @girldoescode9240
    @girldoescode9240 3 роки тому

    If i'm using fragments what should I use instead of intents?

    • @CodeWithCal
      @CodeWithCal  3 роки тому +1

      I would use view pager
      developer.android.com/training/animation/screen-slide

  • @finvest01
    @finvest01 2 роки тому

    Please help. I have created a database which containing name of a product and quantity of the product , again user enter the same product name but quantity in negative or it could be in positive, now I Want to update the product and it's available quantity by performing the calculation, if user entered quantity in positive than old quantity + this new quantity, same for subtraction. How do I do this please help ,make a video on this.

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      That's a very specific video request.
      I think you have the tools from this video to update your rows based on the user input.
      Good luck 🍀

  • @glaubenskraft31
    @glaubenskraft31 2 роки тому

    Hey cal first of all ty for the vid. I'm having a problem with SQLite which is this quote on SQLiteManager.java: try (Cursor result = sqLiteDatabase.rawQuery("Select * from " + TABLE_NAME, null)) Can you help?

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      What's the error you are getting?

    • @glaubenskraft31
      @glaubenskraft31 2 роки тому

      @@CodeWithCal It was about my table name, I fixed it but thank you for the answer

  • @RoseColoredMew
    @RoseColoredMew Рік тому

    I’m having issues deleting an item.. I select the button and it sends me back to the list view with the items still there. Any advice cal?

    • @CodeWithCal
      @CodeWithCal  Рік тому

      Are you filtering out deleted correctly?

  • @maryannadelman4438
    @maryannadelman4438 2 роки тому +1

    Would you happen to have a version of this same tutorial for Kotlin?

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      No I don't, I might do a persistent data tutorial in Kotlin. It's a good idea 💡

  • @leandrocruz6621
    @leandrocruz6621 2 роки тому +1

    Perfeito

  • @techtrash9138
    @techtrash9138 3 роки тому +4

    please make more tutorials on android with java

  • @nipuniherath8639
    @nipuniherath8639 2 роки тому

    Can this method create a Room Database? Or is this different ?

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      Room is different, but it looks good at mapping to objects with less conversion code
      The highlighted answer in this post does a great job explaining the difference.
      stackoverflow.com/questions/50650077/sqlite-database-vs-room-persistence-library

  • @MaxDiegardo
    @MaxDiegardo Рік тому

    thanks for the tutorial! in my emulator, the data isnt persistent. i close the app, and opened, the data isnt there.

    • @MaxDiegardo
      @MaxDiegardo Рік тому

      nevermind! i forgot to add in the addtosql after appending to list

    • @Tr1xIx
      @Tr1xIx Рік тому

      @@MaxDiegardo I have the same problem and can't figure out the solution. Could you give me some pointers?

  • @mickelhaj6158
    @mickelhaj6158 2 роки тому

    when 6:50 i click save the note doesnot shows

  • @_juniormastermind_
    @_juniormastermind_ 3 роки тому

    Please make a tutorial how to make an advanced calculator with all the equations possible without any apis with the help of java in android stuido.Thanks

    • @CodeWithCal
      @CodeWithCal  3 роки тому +2

      Have you seen this one? ua-cam.com/video/2hSHgungOKI/v-deo.html
      It's in Kotlin but you should be able to apply the principles to Java.
      Kotlin is based on Java the code structure is mostly the same just some slightly different Syntax :)

    • @_juniormastermind_
      @_juniormastermind_ 3 роки тому

      @@CodeWithCal yes I have watched it,Thanks ,but I need to understand in java also

  • @roamingcelt
    @roamingcelt 2 роки тому +2

    Maybe redo. Splitting the tutorial into 2 parts, so as not to be rushed.

  • @mohiuddeenkhan2355
    @mohiuddeenkhan2355 2 роки тому +3

    Its great but its very very fast.

  • @sanxd4840
    @sanxd4840 3 роки тому +1

    When the app is closed and reopened after that the notes duplicate, is there any solution to that?

    • @CodeWithCal
      @CodeWithCal  3 роки тому +1

      Oversight on my behalf, we need to make sure this is method loadFromDBToMemory() is only called once.
      Try creating global boolean variable firstLoad or something,
      then
      if(firstLoad)
      {
      loadFromDBToMemory();
      firstLoad = false;
      }

    • @angelo4324
      @angelo4324 2 роки тому

      I had same problem, finally I was able to fix it.
      1st created a new javacclass.
      (public class FirstLoad {
      public static boolean firstLoad = true;
      })
      2nd. Add something to Main activity
      (public void load(){
      if(FirstLoad.firstLoad){
      loadFromDBtoMemory();
      FirstLoad.firstLoad = false;
      })
      @Code With Call, please tell me if this is correct.

    • @nemoelkristianalarcio3287
      @nemoelkristianalarcio3287 2 роки тому +1

      @@CodeWithCal my problem is the data duplicates on the first load after I added it
      but it fixes when I close and reopen the app
      What can I do?
      Thank you in advance.

    • @rockfuerte
      @rockfuerte 2 роки тому

      I have the same error, and i tried your codes for solve that and didn´t work, another solution?

    • @janettaylor260
      @janettaylor260 2 роки тому +6

      @@rockfuerte Hi All, I had the same problem when using the back button the details were duplicated. The following is how I fixed it:
      private static boolean firstRun = true;
      private void loadFromDBToMemory()
      {
      if(firstRun)
      {
      SQLiteManager sqLiteManager = SQLiteManager.instanceOfDatabase(this);
      sqLiteManager.populateFilmListArray();
      sqLiteManager.close();
      finish();
      }
      firstRun = false;
      } // private void loadFromDBToMemory()
      Hope this helps someone.

  • @microhandsltd
    @microhandsltd 2 місяці тому

    Great video but you are too fast for me. As a beginner I would like to have time to follow each step. Play at 0.75% don’t know what that means. Is the speed?

  • @asmitajagadale5197
    @asmitajagadale5197 2 роки тому

    Please can u share source code of this note app?

  • @blauornuo7060
    @blauornuo7060 11 місяців тому

    easy peasy lemon squeezy

  • @jeffreyriggs1911
    @jeffreyriggs1911 10 місяців тому

    seems to be a nice tutorial, but way too fast. I cant keep up, got to keep rewinding, etc...

  • @EricBalcon
    @EricBalcon Рік тому

    Nice but way way too fast for me...

  • @mustplay8932
    @mustplay8932 2 роки тому +2

    hey slow down

  • @mikefrank2643
    @mikefrank2643 2 роки тому +1

    It was preferable that you had done it in kotlin

  • @notyoubussines145
    @notyoubussines145 2 роки тому +3

    Sorry Cal...
    But this is not a tutorial, you just show us how you can do it if you know already all the steps....and then you do it so fast that nobody not already familiar can follow...
    Obviously just my opinion but it is a honest feedback.

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      I am assuming you have some knowledge of programming yes.
      I think this is a tutorial. It may not be a good tutorial. But It is a tutorial in my opinion 😆

    • @debrunynha4958
      @debrunynha4958 Рік тому

      If you can't follow the tutorial, slow it down, i watched it on 0.5x, pausing, and got it, it's a great tutorial, but maybe you should learn how to program before watching it and criticizing a person who just wants to help

    • @monotyc6085
      @monotyc6085 4 місяці тому

      @@debrunynha4958it would be much easier if it was much slower. And that has nothing to do with the ability to program lil bro.

    • @monotyc6085
      @monotyc6085 4 місяці тому

      @@debrunynha4958please do us a favor and be quiet

  • @monotyc6085
    @monotyc6085 4 місяці тому

    please slow down a bit this is inhuman