Room Database in Android | Introduction to Room Persistence Library Hindi- CheezyCode #10

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ย. 2024
  • Learn Room Database in Android with examples in Hindi. Learn how to store data in SQLite Database in Android using Room Persistence Library. This is part of the android architecture jetpack library. What is the need of a Room Database? What advantages does it provide over SQLite Database? Less Boilerplate and Compile-Time Verification of SQL queries provides a huge advantage over SQLite. Learn what are Entities, DAO, Database class in Android. Learn all this about Android Jetpack Components in Hindi by creating small projects.
    These components help in writing clean code and help in following clean architecture in android. Learn all this about Android in Hindi by creating small projects. Everything is explained in Hindi (हिंदी में )
    Topics Covered -
    1. What is Room Database in Android?
    2. Need of Room Library and benefits of using Room Library over SQLite
    3. What is Entity? @Entity
    4. What is Data Access Object or DAO? @Insert, @Update, @Delete, @Query Annotations
    5. How to define a database using RoomDatabase Class? @Database Annotation
    6. Simple Example of Room Database
    ViewModel Concept -
    • Android ViewModel Tuto...
    ViewModelFactory -
    • Android ViewModel Fact...
    Beginner series in Android Playlist (Hindi) -
    • Android Tutorials Step...
    Kotlin Beginners Tutorial Series -
    • Kotlin Beginner Tutori...
    For more info - visit the below link
    www.cheezycode.com
    We are social. Follow us at -
    Facebook - / cheezycode
    Twitter - / cheezycode
    Instagram - / cheezycode

ความคิดเห็น • 135

  • @sunilkumar-zl6eo
    @sunilkumar-zl6eo 3 ปีที่แล้ว +22

    Sir .........Great work......Your teaching will make the lot of guys career......respect from heart...

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +7

      Thank you for your love brother. Cheers

    • @rishabjain2634
      @rishabjain2634 2 ปีที่แล้ว

      @@CheezyCode sirjii wo do bar kaise hova entry oncreate tho 1 hi bar call hogna when app opens??

    • @rishabjain2634
      @rishabjain2634 2 ปีที่แล้ว

      @@CheezyCode sirijii when we open our app as manytimes as we want to should get only the entries in the table once how to implement it

  • @chetanmittal660
    @chetanmittal660 ปีที่แล้ว +1

    amazing explanation sir, maine bhot logo ki video dekhi, yaha tk ki 1-1 ghnte vali bhi dekhi lekin kisi ne itna exact aur accha ni smjhaya jitna aapne smjhaya. Dil se shukriya

  • @uavishal777
    @uavishal777 ปีที่แล้ว +3

    What an explanation Sir.....Till Now only I used to see code and type but after your explanation, I am knowing every concept line by line...Please upload more concept if you can sir...

  • @theuntoldtree
    @theuntoldtree 2 ปีที่แล้ว +4

    other tutorials:- here is theory explanation || here is code .
    cheezy code:- here is theory explanation && here is code + ye language bhi seekh lo vo language bhi seekh lo.
    thanks again sir.

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว +1

      Thank you 👍

  • @appshub6024
    @appshub6024 3 ปีที่แล้ว +3

    tutorial smooth as cheez..

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว

      haha...cheers bro ✌️

  • @amanpahari690
    @amanpahari690 ปีที่แล้ว +1

    thnks for explaining it with such simplicity

  • @jabidkhan6085
    @jabidkhan6085 10 หลายเดือนก่อน +1

    Good explain really your all videos very nice

  • @moeed1584
    @moeed1584 3 ปีที่แล้ว +5

    very well explained sir, requesting you to please cover more topics.

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +3

      Yes bro in progress

    • @moeed1584
      @moeed1584 3 ปีที่แล้ว +1

      ​@@CheezyCode
      getting error
      "Kotlin version that is used for building with Gradle (1.3.72) differs from the one bundled into the IDE plugin (1.4.21) ""
      sir please tell ext.kotlin_version
      Thanks in advance

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      Just google it....you need to update Kotlin version

  • @chandansuthar6447
    @chandansuthar6447 2 ปีที่แล้ว +1

    Very Simple Explanation

  • @Subratsss
    @Subratsss 4 หลายเดือนก่อน

    Your teaching style is very very impressive

  • @raokarampal
    @raokarampal 3 ปีที่แล้ว +1

    Thankyou for video aapka din subh ho🙏😊

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      Haha....thanks bro for supporting

  • @user-iw1sx7ue8u
    @user-iw1sx7ue8u ปีที่แล้ว +1

    great content

  • @sat_talk
    @sat_talk 3 ปีที่แล้ว +1

    Thanks, bro for the Awesome Video..

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว

      Thank you brother 🤘. Please support us by sharing these videos if possible

  • @shrikanttiwari6682
    @shrikanttiwari6682 3 ปีที่แล้ว +2

    Nice explanation. Kotlin coroutine is interesting topic. Request to make a separate video on coroutine as well to clear visibility for the same.

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +4

      As soon as possible

  • @vishaltorgal3372
    @vishaltorgal3372 9 หลายเดือนก่อน +1

    Nice

  • @chndraja
    @chndraja 2 ปีที่แล้ว +2

    Awesome Sir, thoroughly enjoyed Android Architecture Components playlist.
    Do you have any videos on Multi Module Project ?? If not please make one.

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      Not on multi module - Dagger is in progress then HILT

  • @arpitkhandelwal2999
    @arpitkhandelwal2999 3 ปีที่แล้ว +1

    Good going
    But a small request to u please make a separate video on coroutine
    including evething about that it really helps to clear the basis of coroutine and how it works ....

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +7

      Sure brother...it will be covered in this series

    • @arpitkhandelwal2999
      @arpitkhandelwal2999 3 ปีที่แล้ว +1

      @@CheezyCode THANKS for your efforts ❤️

  • @Ab-no6rz
    @Ab-no6rz 3 ปีที่แล้ว +1

    Best teacher

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +2

      Thank you 🤘

  • @suhebrafique7341
    @suhebrafique7341 ปีที่แล้ว +2

    How to store custom object arraylist in room database, can you please add one video on it

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว +1

      just convert that into json and store it in DB

    • @suhebrafique7341
      @suhebrafique7341 ปีที่แล้ว

      @@CheezyCode ok, thank you for the reply. Also i want to know can we store a complete arraylist at a time in room?

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว

      Yes..
      2 options-
      - Save method mei list of object accept karlo
      - arraylist as a unit store karana hai toh as a string save karlo by converting it into json

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว

      @Insert
      suspend fun addNote(notes: List)
      For instance - this method will store the list of notes in the db in one go

  • @nimeshluhana4796
    @nimeshluhana4796 2 ปีที่แล้ว +4

    Hey
    Good Explanation
    You have mentioned that the getContact function will be called in the background thread. Now, can this also be made a suspend function, so that we can use the advantages of a coroutine rather than running this on a thread only?

    • @nehasahoo2638
      @nehasahoo2638 2 ปีที่แล้ว +1

      We can do that, but since we made its return type a livedata(which anyway runs on background thread) the suspend keyword is skipped for that function

  • @Sikarwar0020
    @Sikarwar0020 3 ปีที่แล้ว +3

    First Comment.. 🔥🔥

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      Thank you Vipin for your constant support. Cheers 🤘

  • @InnovativeChangazi
    @InnovativeChangazi 2 ปีที่แล้ว +2

    Can you explain why you have used coroutines-core along with coroutines android? In the documentation for android for coroutines only a single library implementation is used and that is the android implementation.

  • @yunhi1853
    @yunhi1853 ปีที่แล้ว +1

    sir new errror pls suggest solution
    > 'compileDebugJavaWithJavac' task (current target is 1.8) and 'kaptGenerateStubsDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.

  • @TechnicalAkshay
    @TechnicalAkshay 4 หลายเดือนก่อน

    Why google choose to make Room Database as annotation instead of using inheritance in for using room database functionality

  • @rishabjain2634
    @rishabjain2634 2 ปีที่แล้ว

    ​ @Cheezy Code sirjii wo getcontact() wale function mai...Kisne Flow use kiya hai aur apne LiveData konsa use karna hai?

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      Flow use kar skte ho....Livedata bhi use kar skte ho...dono aane chaiye...

  • @IntegersTechnology
    @IntegersTechnology 5 หลายเดือนก่อน

    SIR please provide a complete tutorial about Room Database

  • @singhpraveen5460
    @singhpraveen5460 2 ปีที่แล้ว +1

    Sir please bring course on Android Development

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      koshish poori hai bro...

  • @AP-pm9cp
    @AP-pm9cp 2 ปีที่แล้ว

    Android made easy ::CheeY Code

  • @ayushpandey538
    @ayushpandey538 3 ปีที่แล้ว +2

    Sir can we insert whole ArrayList() at once or we need to insert each element one by one?

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +2

      Whole list can be inserted...room with mvvm wala example refer kar skte ho

    • @ayushpandey538
      @ayushpandey538 3 ปีที่แล้ว

      @@CheezyCode thanks sir

  • @akankshatripathi3222
    @akankshatripathi3222 ปีที่แล้ว

    sir the kotlin plugin does not support as well as annotation processor there is an error in kapt in my case

  • @nehamandhare2480
    @nehamandhare2480 3 ปีที่แล้ว

    Super explained

  • @GHOST-mg7uu
    @GHOST-mg7uu 3 ปีที่แล้ว

    thank you so much!

  • @sjaffri6939
    @sjaffri6939 ปีที่แล้ว

    SUperb *****

  • @nihal999in
    @nihal999in 2 ปีที่แล้ว

    Awesome Sir, Please ek video aap Dagger Hilt pe aap banaiye.. bahut easy ho jayega samjhnaa .. please 🙏🙏🙏

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว +1

      new series on Dagger 2 is live.

    • @nihal999in
      @nihal999in 2 ปีที่แล้ว

      @@CheezyCode please share link and try to make a series on dagger hilt. Your teaching way is awesome. ❤️❤️👍🙏

  • @ahsansyed4146
    @ahsansyed4146 3 ปีที่แล้ว

    Good Work Buddy, DAO m ArrayList support nai krta room ? LiveData ?

  • @champion5946
    @champion5946 ปีที่แล้ว

    Thanks

  • @harshad_waghmare
    @harshad_waghmare 4 หลายเดือนก่อน

    Sir how to fetch roomdata into lazyColumn? i searched it ,there are complicated ways shown beyond understanding..please make a video on it through viewmodel,repository etc

  • @TarunAttri
    @TarunAttri 2 ปีที่แล้ว

    Bro, you rock.

  • @saeedsharif2463
    @saeedsharif2463 ปีที่แล้ว

    sir please make vadoe on concureent acces

  • @binodbhandari7543
    @binodbhandari7543 3 ปีที่แล้ว

    Super

  • @AkashJhaDDN
    @AkashJhaDDN 3 ปีที่แล้ว

    Thanks sir

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว

      Thank you Akash for always supporting. Cheers 🤘

  • @Dharmendrakumar-tl8vp
    @Dharmendrakumar-tl8vp 2 ปีที่แล้ว

    I am using Room database with coroutines but I am unable to compile the code and i am getting following error "error: Type of the parameter must be a class annotated with @Entity or a collection/array of it. kotlin.coroutines.Continuation

  • @sahinmunshi6441
    @sahinmunshi6441 ปีที่แล้ว

    Sir please make a tutorial on SearchView
    with suggestions

  • @tanishqsingh4
    @tanishqsingh4 ปีที่แล้ว

    Hi Can you make video on prepopulate database with upgrade version

  • @jayeshpobari395
    @jayeshpobari395 3 ปีที่แล้ว

    new hu to pahle sqlite sikhna chahiye ya diect room database ?

  • @samarthvarshney512
    @samarthvarshney512 ปีที่แล้ว

    if you face an error in contactDao just upgrade do a minor change in gradel , change the def room_version = "2.4.3" and the error will go

  • @sandhyaverma5751
    @sandhyaverma5751 3 ปีที่แล้ว

    Sir dagger pr Bhi 1 video banadijiye. Pls

  • @GamLopStudio
    @GamLopStudio 3 ปีที่แล้ว +1

    Can Realm better then SQLite for CRUD system ?

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      Depends on the scenario. This debate is same as SQL vs NoSql. Totally depends on your scenario

  • @mohit1483
    @mohit1483 3 ปีที่แล้ว

    Should a newbie in android development learn jetpack or stick to java ,xml ..?

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +2

      Newbie -
      1. KOTLIN
      2. ANDROID WITH KOTLIN - BASICS
      3. JETPACK COMPONENTS
      4. ADVANCED CONCEPTS

    • @mohit1483
      @mohit1483 3 ปีที่แล้ว

      @@CheezyCode thank you ....is java /xml still valid because I started with it and becoming comfortable

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      It is valid and will be there for long.

    • @mohit1483
      @mohit1483 3 ปีที่แล้ว

      @@CheezyCode 😁keep the good work on...!thank you

  • @pritamdas2232
    @pritamdas2232 3 ปีที่แล้ว

    after every insert delete and update operation my recyclerview automatically scroll to top ..
    ..plz tell how to prevent this....

  • @yunhi1853
    @yunhi1853 ปีที่แล้ว

    cannot find implementation for com.example.aawe.ContactDatabase.
    cuasing error where we declared abstract fun in database

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว

      Check the dependencies are there

    • @yunhi1853
      @yunhi1853 ปีที่แล้ว

      @@CheezyCode thanks error resolved

  • @mohammadtaqi4051
    @mohammadtaqi4051 2 ปีที่แล้ว

    Why did you pass "applicationContext"... What if we pass only "this"...
    Does this have any effect?
    (I know applicationContext ties with application lifecycle and"this" ties with activity lifecycle) if i am not wrong

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      Activity rotated activity died. Storing activity context holds the object, so memory leak

    • @mohammadtaqi4051
      @mohammadtaqi4051 2 ปีที่แล้ว

      @@CheezyCode Thx... Bt can you elaborate little bit more...

  • @TheAbhidugar
    @TheAbhidugar 3 ปีที่แล้ว

    Bhaiya do I need to learn SQL to learn Room database? I have no knowledge of any database system. Newbie Here. Please reply.

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +3

      Han thoda idea Toh chaiye rdbms visualize karne ke liye - Jahan pe multiple tables involve honge waha thoda gyaan chaiye - baaki agar related tables nahi h Toh issue nahi hoga...
      But Sql is recommended for every developer.

  • @arbazabdullah5431
    @arbazabdullah5431 5 หลายเดือนก่อน

    Pre populate room database

  • @roh9934
    @roh9934 3 ปีที่แล้ว

    Bro, the data get inserted again after OnCreate again. Suppose I have to put data only once. No matter how many times I run the app, how to do that?

  • @sulmanrasheed007
    @sulmanrasheed007 3 ปีที่แล้ว

    Sir Android Navigation Component b kara de Java mai... Thanks

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +3

      Bro Android is Kotlin only. Navigation component will be covered but that will be in Kotlin - no more Java in Android world

    • @sulmanrasheed007
      @sulmanrasheed007 3 ปีที่แล้ว

      @@CheezyCode Ok

    • @Sikarwar0020
      @Sikarwar0020 3 ปีที่แล้ว +1

      @@sulmanrasheed007 switch to Kotlin... Asli maza to Kotlin me hai.. sab kuch easy hai aur Features bhi hai Kotlin me as compared to java

  • @simransingla9397
    @simransingla9397 2 ปีที่แล้ว

    I have an error on databasebuilder plz help me

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      What's the error?

    • @simransingla9397
      @simransingla9397 2 ปีที่แล้ว

      @@CheezyCode not enough information to infer type variable T : this is showing to me while i move cursor to database builder and has error(Unresolved reference java) on java(ContactDatabase::class.java)also

  • @ss5380
    @ss5380 หลายเดือนก่อน

    Link to the song at the end? 😅

  • @mubaraknative
    @mubaraknative ปีที่แล้ว +1

    Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type). kotlin.unit error

  • @technicalwizard2200
    @technicalwizard2200 2 ปีที่แล้ว

    Can we store the pdf document in room database?

    • @CheezyCode
      @CheezyCode  2 ปีที่แล้ว

      We can store but what's the need. Keep the file as is and store it's name

  • @leetcodebaby6680
    @leetcodebaby6680 ปีที่แล้ว +1

    Bhai function kyu abstract hoga? class kyu abstract hoga? Ye sab nahi btana hota? Ratta mar rkha hai bas vo yaha aake pel diya sab.

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว +2

      😂

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว +1

      Ratta marlo naukri chaiye toh...waise answer jaan na hai toh Google will help...aur shayad shi se puch lete toh yahin bta dete

  • @tamimkhan1428
    @tamimkhan1428 3 ปีที่แล้ว

    please sir,Give us Rx java tutorial. advance thanks

  • @hamzajaved7746
    @hamzajaved7746 3 ปีที่แล้ว

    Share GitHub link please

    • @CheezyCode
      @CheezyCode  3 ปีที่แล้ว +1

      Will do

    • @hamzajaved7746
      @hamzajaved7746 3 ปีที่แล้ว

      @@CheezyCode Thanks Ma wait kr rha hun ap k links ka ap tutorials achy hain bus ap source code bhe provide kr dya krain

  • @ramashishkumar6416
    @ramashishkumar6416 2 ปีที่แล้ว +1

    dataBase = Room.databaseBuilder(
    applicationContext,
    ContactDatabase::class.java,
    "contactDB"
    ).build() after adding getting error-- java.lang.RuntimeException: cannot find implementation for com.example.roomdatabaseapplication_fromcheezycode.ContactDatabase. ContactDatabase_Impl does not exist

  • @RahulPahuja1991
    @RahulPahuja1991 ปีที่แล้ว

    Room has error
    error: There is a problem with the query: [SQLITE_ERROR] SQL error or missing database (no such table: contacts)
    public abstract androidx.lifecycle.LiveData getAllContact();

    • @CheezyCode
      @CheezyCode  ปีที่แล้ว +1

      Check the entities annotation on database

    • @RahulPahuja1991
      @RahulPahuja1991 ปีที่แล้ว

      @@CheezyCode yes you are right, the entity name was incorrect