Java Android Room Database | Insert and Query | RecyclerView Example

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

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

  • @ncglorious.j-song8616
    @ncglorious.j-song8616 2 года назад

    i have trouble in set up Room Database since yesterday. and now you save me life

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

    Super clear, I think the problem that I could of had was watching this before learning about the List Class and basic design patterns like the
    Singleton. I am so glad I studied before watching this, this was good man keep it up! I will say though that you will probably often get people without any experience complaining, with that said I am sorry you have to deal wit that!
    I Will say that I was a bit thrown off by the new technologies used outside of vanilla Java, like the database annotations; obviously because this is the first time I have ever used any dependencies outside of code I have made myself.

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

      I am glad that you like it, thanks for your feedback!

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

    Спасибо, отличный туториал !)
    Thanks, great tutorial !)

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

    TQ. this tutorial is straight to the point.

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

    Great tutorial

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

    Super Duper Thanks Bro

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

    Thanks, man. You're very skilled. It was easy to follow you. Thanks! But still problems with migrating to the non-deprecated Activity Results API. I tried to follow your advice to Gaurav Samar but, after finishing saving a user, it will not show the updated list... It only shows it if I restart the app

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

    You are so amazing man, much thanks for you work

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

      Thank you for your feedback, Please subscribe for more videos.

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

    Thank you so much. Very simple and good tutorial!

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

      Thank you for your feedback ! Please subscribe!

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

    This Worked :-)

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

    thanks so much for the tutorial, i can't seem to understand databases properly enough to integrate it into my app. So i can't store buttons in a databse right? this is so tough.

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

      thats correct you cannot store any view in the db, you can just store the primitive type of data types. Thanks!

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

      bhai view store krke kya karega koi logic nhi bana lol

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

    Well explained..... Thanks :)

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

      Thanks for your feedback, Please subscribe!

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

    Thank you!

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

    can you implement a ViewModel and LiveData in this code please? I've been struggling a lot with them and cant understand how they work nor implement them..
    Thanks for the video!

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

      Thank you for your feedback, I have similar video in kotlin, explore the kotlin playlist to find the video, Thanks!

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

      did you find the solution ????

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

    cant get room to fucking work with a single table, there's always some weird ass fucking problem. by the time i've got it to stop trying to insert null into an int field, i might have made 10 databases that work in SQLite or whatever

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

    I cant make object of AppDatabase (17:50). AppDatabase is abstract class. Abstract class can't have object in Java.

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

      Because RoomDatabase has defined methods, the inheriting class cannot be an interface. And because you write your undefined method in that abstract class, it cannot be a class.
      Also, Room will map our database objects to Java objects. Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.
      public abstract UserDao userDao(); // abstract method is not allowed for non abstract class

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

    How to sync these recylerview data into MySQL databaseserver online

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

      You can make api call and send that data to your server.

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

      @@LearningWorldz Im able to send it to server but I want synchronisation feature which work offline and online

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

      @@LearningWorldz just like he did: www.simplifiedcoding.net/android-sync-sqlite-database-with-server/

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

      Pls help me if you can

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

    db class package understanding (full DB class)

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

    Please do without "allowMainThreadQueries".

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

    well, there is some issue currently,
    AppDatabase_Impl does not exist
    dunno whats wrong here, can you help with this

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

      try clean and rebuild, hope that help! where exactly you are getting error?

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

      @SensibleGuy check your dependencies
      If your using kotlin, change annotationProcessor to kapt
      Further if you get any error like kapt not found, at the top of your app level gradle add
      plugin {
      id 'kotlin-kapt'
      }

    • @ЕгорПоляков-т5ъ
      @ЕгорПоляков-т5ъ 3 года назад

      @@LearningWorldz i get the same error. It doesn't work even after clean and rebuild(

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

      @@ЕгорПоляков-т5ъ Could you check the gradle file and see if you have all the dependency on place, have you tried below
      If your using kotlin, change annotationProcessor to kapt
      Further if you get any error like kapt not found, at the top of your app level gradle add
      plugin {
      id 'kotlin-kapt'
      }

    • @ЕгорПоляков-т5ъ
      @ЕгорПоляков-т5ъ 3 года назад

      ​@@LearningWorldz thank for answer but my dependencies is in order and i don't use kotlin(

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

    for the little improvement first tell your students what you gonna build and then try to clear things one by one what is the process of thinking then make .......my question is USER... user in insert query part what to mean...

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

      Thanks for your feedback, Its always been mention at the starting of video as well as in the description of video. Please explain your question more clearly?

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

    startActivityForResult is deprecated now! What should i do??

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

      Declare 'someActivityResultLauncher in your activity and then call 'openSomeActivityForResult' function when you want to launch an activity.
      ActivityResultLauncher someActivityResultLauncher = registerForActivityResult(
      new ActivityResultContracts.StartActivityForResult(),
      new ActivityResultCallback() {
      @Override
      public void onActivityResult(ActivityResult result) {
      if (result.getResultCode() == Activity.RESULT_OK) {
      Intent data = result.getData();
      }
      }
      });
      public void openSomeActivityForResult() {
      Intent intent = new Intent(CurrentActivity.this, SomeActivity.class);
      someActivityResultLauncher.launch(intent);
      }
      Hope this help!

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

      @@LearningWorldz Thnx man

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

    how can we add pagination in the same application

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

      check this video, Hope this help, Thanks!
      ruclips.net/video/OeYlsoPQO2c/видео.html
      ruclips.net/video/Zb7SLUUbwQc/видео.html

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

    sir eak cheec smaj ni ayi @Insert ki querry me User ke bad ... kyu use keya he ?

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

      for insert in room you don't need to write query, you can simply pass the Entity object it will automatically insert in the table. thats the beauty of room.

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

      @@LearningWorldz thanks sir

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

    how we can solve ViewModulProvider ?

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

      use this assuming your view model name is 'MainActivityViewModel'
      MainActivityViewModel viewmodel = new ViewModelProvider(this).get(MainActivityViewModel.classs);
      viewmodel.anyFunctionInViewModelClass();
      Hope this help!. Thanks!

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

      @@LearningWorldz still shows an err

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

    its not the recomended way....should uv used mvvm model

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

      Thanks for your feedback, I have other videos based on MVVM so this video just to learn Room in java..thanks!

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

      @@LearningWorldz ok man ...happy growing💪

  • @vasiliy.x
    @vasiliy.x 3 года назад

    Super slow. Didn't run the code once in the middle of the video. No explanation during coding.

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

      Sorry to hear that, will try to improve in future videos! Thanks for your feedback!

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

    thanks so much for the tutorial, i can't seem to understand databases properly enough to integrate it into my app. So i can't store buttons in a databse right? this is so tough.

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

      yes you cannot store buttons in the db, you can store primitive type of data. hope this help!

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

      @@LearningWorldz thank you so much yeah that helps a lot. So only Strings and Ints i guess etc. Maybe arrays too.

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

      correct!

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

      I guess you are new to programming, u need to explore more, why would someone store button in a db ?