@TypeConverter - Insert Image in Database | Android Studio Tutorial

Поделиться
HTML-код
  • Опубликовано: 19 окт 2020
  • 🏆 My Online Courses
    ⭐Discount Coupon: LAUNCH-STEVDZA-SAN
    stevdza-san.com
    🐱‍👤 Wanna become a member? Join!
    / @stevdzasan
    📸 Instagram
    / stevdza_san
    Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.
    Room is now considered as a better approach for data persistence than SQLiteDatabase. It makes it easier to work with SQLiteDatabase objects in your app, decreasing the amount of boilerplate code and verifying SQL queries at compile time.
    In this video I'm going to show you how to use one specific annotation @TypeConverter to convert any object to acceptable type, that later can be stored in ROOM database.
    Source code: gist.github.com/stevdza-san/e...

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

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

    you have helped me a lot with your tutorials, the room series and the Retrofit ones were so usefull, you need more spotlight!

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

    Man, ANOTHER great video. Thanks! Most underrated Android channel!

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

    This is an amazing solution to storing images locally and avoiding excessive network calls...

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

    Thanks man ! For the past one week I was after something related to room db, this video was the key to the solution.

  • @bort7504
    @bort7504 3 года назад +3

    I'm already looking forward to the @ForeignKey annotation. :) Great work in all of your vids, keep it up!

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

    I SUBSCRIBED JUST BY WATCHING THIS PLAYLIST OVERALL! Its professional

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

    wow I spent like 2 weeks trying to figure this out on my own. could've just watched this video. lol. thank you!!!!

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

    YOUR ARE GREAT DEVELOPER!

  • @lara-kp7lp
    @lara-kp7lp 3 года назад +1

    How to use type conveter for example images: list?

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

    Bravo 👏

  • @RahulRawat-rj8ol
    @RahulRawat-rj8ol 2 года назад

    thanku sir for making world knowledgable but my quetion is that i have a list of images which i am getting from the gallery and i want to store them into database i am coverting every single image by your given method but its not working in case of list the same converter error so please tell me what is the solution for that because i am getting the typecoverter error same for which i am using converter where i am doing wrong

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

    thank you very much

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

    Do they absolutely need to be prefixed with "to" and "from"?

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

    awsome thank

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

    Thanks bro

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

    Svaka cast brate odakle si Crna Gora , Srbija?

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

    Please make videos in Light theme.. Its hard to see the video in dark theme due to RUclips's 480p quality in some devices and location. Nice and helpful 👍

  • @yaminishilpa4541
    @yaminishilpa4541 4 месяца назад

    Grt one

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

    Thanks.

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

    can we do the same in java Project?

  • @Alex-yw7sn
    @Alex-yw7sn 3 года назад

    way didn't you create the recyclerView?

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

    How can I store Date and Time in Room please Reply....... By the way thanks for TypeConverter Video

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

    thanks

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

    - Hello! I have a problem: "Row too big to fit into CursorWindow requiredPos=0, totalRows=1; query: SELECT * FROM recipe_data_table ORDER BY recipe_id ASC", i think i need to compress my image file before putting it into database, but i am not sure(( Help me, please)
    - P.S. it work for bitmap which size in bytes is 2560000
    , but it doesnt work for bitmap wtih size 31227680 bytes
    - maybe this log will be helpful: "Window is full: requested allocation 5325755 bytes, free space 1999899 bytes, window size 2097152 bytes"

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

      EDITED: I fixed it with adding BitmapFactory.Options().inSampleSize index (we need to calculate image size, because max image size we can work with in database is about 2 MB)

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

    Is it efficient to store images in a db? I always stored them in app storage and saved the uris in the database

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

      If you store just URL it might not show when you are offline. Except if you are using image loading library which does all of this for you.

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

      @@harrisonrohan it's recommended not to save images in your DB unless your use case needs that
      there is a bunch of ways to do such as save the image in a file in the mobile storage and use the file path and etc

  • @Alex-yw7sn
    @Alex-yw7sn 3 года назад

    It is helped me
    val recyclerView = findViewById(R.id.recyclerView)
    recyclerView.adapter = adapter
    recyclerView.layoutManager = LinearLayoutManager(this)

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

    Bro can i get your firebase course for free plz.....