realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
889 stars 52 forks source link

[Realm] Unsupported type for RealmList: 'android.graphics.Bitmap' #1597

Open akardas16 opened 7 months ago

akardas16 commented 7 months ago

Problem

I want to store images in Bitmap in list but realm is not supporting Bitmap

class ImageData : RealmObject {
    @PrimaryKey
    var _id: ObjectId = ObjectId.invoke()

    var timestamp: RealmInstant = RealmInstant.now()
    var bitmapList: RealmList<Bitmap> = realmListOf()
}

Solution

No response

Alternatives

No response

How important is this improvement for you?

Fairly niche but nice to have anyway

Feature would mainly be used with

Local Database only

clementetb commented 7 months ago

Hi @akardas16. Yes, Bitmap is not supported; as a workaround, you can use a delegated property to add support for it, see this post.