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

Поділитися
Вставка
  • Опубліковано 6 жов 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

  • @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.

  • @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...

  • @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

  • @Subratsss
    @Subratsss 5 місяців тому

    Your teaching style is very very impressive

  • @droid-aman
    @droid-aman Рік тому +1

    thnks for explaining it with such simplicity

  • @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.

  • @jabidkhan6085
    @jabidkhan6085 11 місяців тому +1

    Good explain really your all videos very nice

  • @appshub6024
    @appshub6024 3 роки тому +3

    tutorial smooth as cheez..

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

    Very Simple Explanation

  • @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 ❤️

  • @nimeshluhana4796
    @nimeshluhana4796 3 роки тому +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

  • @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

  • @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

  • @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.

  • @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.

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

    Thankyou for video aapka din subh ho🙏😊

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

      Haha....thanks bro for supporting

  • @GhulamMuhammad-l7y
    @GhulamMuhammad-l7y Рік тому +1

    great content

  • @vishaltorgal3372
    @vishaltorgal3372 9 місяців тому +1

    Nice

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

    SIR please provide a complete tutorial about Room Database

  • @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

  • @TechnicalAkshay
    @TechnicalAkshay 5 місяців тому

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

  • @harshad_waghmare
    @harshad_waghmare 5 місяців тому

    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

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

    Sir please bring course on Android Development

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

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

  • @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

  • @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...

  • @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

  • @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

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

    Sir please make a tutorial on SearchView
    with suggestions

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

    Hi Can you make video on prepopulate database with upgrade version

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

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

  • @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. ❤️❤️👍🙏

  • @Ab-no6rz
    @Ab-no6rz 3 роки тому +1

    Best teacher

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

    sir please make vadoe on concureent acces

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

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

  • @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

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

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

  • @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

  • @Sikarwar0020
    @Sikarwar0020 3 роки тому +3

    First Comment.. 🔥🔥

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

      Thank you Vipin for your constant support. Cheers 🤘

  • @GHOST-mg7uu
    @GHOST-mg7uu 3 роки тому

    thank you so much!

  • @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

  • @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.

  • @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...

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

    Thanks

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

    Sir dagger pr Bhi 1 video banadijiye. Pls

  • @AP-pm9cp
    @AP-pm9cp 2 роки тому

    Android made easy ::CheeY Code

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

    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

  • @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

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

    Super explained

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

    Thanks sir

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

      Thank you Akash for always supporting. Cheers 🤘

  • @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

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

    SUperb *****

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

    Bro, you rock.

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

    Link to the song at the end? 😅

  • @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

  • @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

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

    Super

  • @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