@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...
you have helped me a lot with your tutorials, the room series and the Retrofit ones were so usefull, you need more spotlight!
Man, ANOTHER great video. Thanks! Most underrated Android channel!
This is an amazing solution to storing images locally and avoiding excessive network calls...
Thanks man ! For the past one week I was after something related to room db, this video was the key to the solution.
I'm already looking forward to the @ForeignKey annotation. :) Great work in all of your vids, keep it up!
I SUBSCRIBED JUST BY WATCHING THIS PLAYLIST OVERALL! Its professional
wow I spent like 2 weeks trying to figure this out on my own. could've just watched this video. lol. thank you!!!!
YOUR ARE GREAT DEVELOPER!
How to use type conveter for example images: list?
Bravo 👏
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
thank you very much
Do they absolutely need to be prefixed with "to" and "from"?
awsome thank
Thanks bro
Svaka cast brate odakle si Crna Gora , Srbija?
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 👍
Grt one
Thanks.
can we do the same in java Project?
way didn't you create the recyclerView?
How can I store Date and Time in Room please Reply....... By the way thanks for TypeConverter Video
thanks
- 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"
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)
Is it efficient to store images in a db? I always stored them in app storage and saved the uris in the database
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.
@@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
It is helped me
val recyclerView = findViewById(R.id.recyclerView)
recyclerView.adapter = adapter
recyclerView.layoutManager = LinearLayoutManager(this)
Bro can i get your firebase course for free plz.....