Room Database & Type Converters in Android | Singleton Pattern Room Hindi- CheezyCode #11

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

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

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

    सर आपके बताने का तरीका बहुत अच्छा हैं।🙏
    अच्छे से चीजे समझ आती है। Thanku Sir

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

      Thank you 🤘

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

    Nice job sir 👍 Your tutorial is very helpful.
    Love you ❤️❤️ so much ❣️ sir
    Love from Indore Madhya Pradesh.

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

    this playlist helps me a lot. kindly cover all other jetpack topics as soon as possible especially MVVM. thanks for such content.

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

      Thank you 🤘 and mvvm for sure

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

      @@CheezyCode waiting

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

    Bht se resources available hai android development ko le k in the form of videos, articles post etc.
    But the way you explain is just amazing ek bar me hi smjh aa jata hai and i am sure all 40.5K subscribers will be agree with me You are awesome
    Thank you so much.
    and my humble request is that can you please videos on Dagger hilt

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

      Thanks Saurabh....Dependency Injection and Coroutines will be next....stay tuned

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

    Sir , why companion object... we can directly achieve singleton using just object

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

    BLESSED TO FIND YOU.. I SPREAD THESE VIDEOS & THIS BRAND / CHANNEL A LOTTT

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

      Thank you 🤘...aapka din shubh ho 😁

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

      @@CheezyCode aapka bhi 🙏✨

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

    Nice explanation. Just one confusion, as mentioned by you in kotlin tutorial , object is used to create a synchronised singleton instance, then why are we again using the java way to create singleton inside the companion object ? I mean is it not defeating the whole purpose of it?

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

      It all depends how you access the object. If you access the object in the application class, you can define simple object declaration that will work.
      But we are accessing it with in activity - it is better to have thread safe singleton.

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

      @@CheezyCode Sorry bhai but samjh nhi aaya..firstly ki object b toh thread safe hota h na? secondly activiy me aisi kya problem h jis wjah se simple object decalaration will not work...but will work in application? pls agar aap thoda detail m smjha sko because i want to clear my concepts

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

    Thanks 🙌
    Ending music and song is nice 🙂

  • @ShivamPatel-vp5pb
    @ShivamPatel-vp5pb ปีที่แล้ว

    Amazing Explanation Sir ❤🫡

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

    Sir Coroutines ko bhi details me explain kr dena.. I am really enjoying this playlist.

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

      Sure bro...Coroutines pe dil se content ban rha hai....poori koshish

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

      @@CheezyCode thanks a lot 😇

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

    Great Teaching sir.....if possbile please provide the content "like website" for new video so that we can prepare for interview.........please sir...

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

      bilkul bro koshish karte hai...

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

    Great video.. keep it up. After finishing this series pl. make a series on Firebase Push Notification ( especially when app is no longer in background). I found many videos on that but they only showed either foreground or background scenarios.. no video found based on how to get Notification when app is no longer running in background which is realtime case ..

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

    very much helpful contents
    Thanks sir

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

    Very good explanation

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

    thanku sir just amazing❤❤❤

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

    Always Well Explained !! Thanks

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

    Database me agar 2 column me long value ho to kya dono long value to time me convert karega?
    Agr nahi to fir usko kese pata chalega k konsi long column ke liye ye converter use krna hai?

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

      Datatypes same hai toh converter chalega...aur ye try karo - clarity jabhi aayegi...question toh answer hojayege

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

    Love you don't stop

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

    Thnx for everything cheezy code

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

    Sir how to create the type convertor for Files and images

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

    If we have multi type converter, then how compiler know, which type converter they have to use??

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

      cheked your replies on previous comments, found solution, Thanks❤

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

      but if you have another way to explain now, pls
      Thanks❤

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

    Here, you made a convertor for date, but how to make convertor for any different types or any custom class. I need a convertor for type FILE

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

      Convert that to Binary...but I would suggest not to store that in DB...store it as a file only - just store the file name inside sqlite

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

      @@CheezyCode" store it as file only" ?
      Data type "File" is not available in DB....then how...?

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

    Sir, this code this work only one time when i again run the program the app is crashing
    please help i cannot find out the problem i done all the things correctly .

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

    sir why suspend is not working when i removed suspend work properly but is still there is not there in background thread how shou;d i do sir

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

    Thank you #CheezyCode

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

    Bro in this 6:41 typeconvertor we convert Data to Long for inserting for Fetching Long to Data is used when i will use in my real application the data will show as like this Wed jul 29 19:24:54 GMT + 05:30 2023 simply i want to format the data how to do that bro how to format like DD/MM/YY only

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

      Just google it

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

      stackoverflow.com/a/61410177

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

      stackoverflow.com/a/11773496

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

    can anyone answer, this is SQLlite right?

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

      Yes behind the scenes it is SQLite

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

    How will that automatically convert from date to long and long to date?????

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

      same question, how does it know when to Convert what to convert, we didnt define it here

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

      Primitive types don't need conversion
      Whenever it encounters types other than primitives - it looks for type converters. If type converters are present, it uses these functions to convert values, otherwise will throw an error.

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

      @@CheezyCode means It will look for a function that takes data type that needs to be converted, if it is present then it will use that function right ?

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

      Yes...check type converters documentation

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

      @@CheezyCode Sure, I’ll check, Thanks for your time 🫶

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

    Bhai gana bahut acha hai

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

      50k pe release karna h

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

    React native oe video banaiye

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

    ❤❤❤❤

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

    jab me database me data insert karta hu to app crash ho jata he , muje pata nahi kyu. aap help kar sakte ho

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

      Check the logcat for the error

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

    7:34 ; at this point , I think stupids like me will definitely select @TypeConverters in place of @TypeConverter as it was suggested first , which is going to throw a compile time error !

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

    Bhai vo converter wale fun jo banaye hai vo call kaha se kiye hai date ko change karne ke liye?
    Smaj nahi aaya yaar? 🤔
    7:58 ke baad samaj nahi aaya

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

      Room apne aap call karta hai...contactdatabase pe typeconverters ki annotation add kari h

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

      @@CheezyCode uske kaise pata kon sa call karna hai matlab agar m usme ek or fun rakhu
      FromlongtoString(value :Long) : string{
      return str(value)
      }
      To kya hoga?

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

      Bro data type check hota hai.... function jisme date type ka input ho, wo use hoga...
      Fir jab wapsi long jisme input hoga wo use hoga..room check karta hai data type dekh ke

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

      Entity ke andar jo field h uska type bhi toh dekhega...string banane se date type kaise milega

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

      Acha aise samajh skte ho -
      Room ne dekha entity ke andar date hai...usne kaha date store nahi kar skta - convertors pe pahocha usne dekha - koi aisa function jo input mei date le rha ho...usse mila ek function jo date ko long mei convert kar rha tha....
      Ab access kar rha hu database se - value mili long usne kaha long ke liye koi aisa method hai jo date mei convert kar rha ho - usse mil gya - usko use kar liya usne

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

    Little Correction
    fun getInstance(context: Context): ContactDatabase {
    if (INSTANCE == null) {
    synchronized(this) {
    if (INSTANCE == null) {
    INSTANCE = Room.databaseBuilder(
    context.applicationContext,
    ContactDatabase::class.java, "ContactDB"
    ).build()
    }
    }
    }
    return INSTANCE!!
    }

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

      why another if in inside ?

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

    gana ka kya naam h mil nahi raha h

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

      Gaana karege release...inhouse h