Giter Club home page Giter Club logo

realm-kotlin-samples's Introduction

Realm-Kotlin Samples

This repository contains a set of projects to help you learn about using Realm-Kotlin SDK Each sample demonstrates different use cases.

๐Ÿ’ป Requirements

To try out these sample apps, clone the repository then import each project as an existing Android Studio project. Samples are based on Kotlin 1.8.20.

๐Ÿงฌ Samples

Project
Intro:
This is a simple example based on the official KMM Sample
Bookshelf:
A more elaborate example using a shared business logic in Ktor, Kotlinx.Serialization and Realm, combined with a platform specific UI using Jetpack Compose and SwiftUI
Kotlin Multiplatform Demo:
Kotlin Multiplatform demo running on Android/iOS/macOS and JVM with Compose Desktop.
JVM Console Application:
Simple Java Console Application using Realm-Kotlin.
App Services usage samples:
Atlas App Services usage samples with Realm-Kotlin.
Java-Kotlin-Maven Interop Demo:
Sample project showing how Realm Kotlin can be consumed by a Java project using Maven.
External Project
FantasyPremierLeague:
Kotlin Multiplatform project with Jetpack Compose and SwiftUI by @joreilly
Screenshot 2021-10-22 at 10 59 37

realm-kotlin-samples's People

Contributors

clementetb avatar cmelchior avatar edualonso avatar elle-j avatar jacoboscargunnarsson avatar joreilly avatar nhachicha avatar rorbech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realm-kotlin-samples's Issues

Add Migration example

Could you add some migration example on how to do it with multiplatform?Also if possible, is there any way that we can do auto migration using realm without manual steps?

Native Distribution

After creating native distribution, installed apps not working. I tried Mac and Linux desktops with dmg and deb files. Adding working examples to samples would be great.

Crashes when minify enabled on Android

This sample app, when minify is set to true in the android build.gradle.kts crashes on startup with the following error:

/Users/realm/workspace-realm-kotlin/releases/packages/cinterop/src/jvm/jni/java_class.cpp:49: [realm-core-11.15.0] Assertion failed: cls with (class_name) = ["io/realm/internal/interop/sync/NetworkTransport"]

subclasses of RealmObject and EmbeddedRealmObject are not allowed

declaration:
id("io.realm.kotlin") version "1.11.0" apply false
implementation ("io.realm.kotlin:library-base:1.11.0")
AGP: 8.2.2

classes used

class AppData : RealmObject {
    @PrimaryKey var packageName : String = ""
    var name:String = ""
    val joinedGroups: RealmResults<GroupData> by backlinks(GroupData::apps)
}
class GroupData : RealmObject {
    var _id: ObjectId = ObjectId()
    var name: String = ""
    var iconKey: String = ""
    var apps: RealmSet<AppsData> = realmSetOf()
}

class MyApplication: Application() {

    companion object{
        lateinit var realm: Realm
    }

    override fun onCreate() {
        super.onCreate()
        realm = Realm.open(
            configuration = RealmConfiguration.create(
                schema = setOf(
                    AppData::class,
                    GroupData::class,
                )
            )
        )
    }
}

ERROR:
Caused by: java.lang.IllegalArgumentException: Only subclasses of RealmObject and EmbeddedRealmObject are allowed in the schema. Found: com.dhruv.angular_launcher.apps_data.model.AppData. If com.dhruv.angular_launcher.apps_data.model.AppData is a valid subclass: This class has not been modified by the Realm Compiler Plugin. Has the Realm Gradle Plugin been applied to the project with this model class?

I don't know what the problem is, I read a thread on this issue which states to resolve the issue update to AGP:7.3.0 but i can't downgrade AGP from 8.2.2.

please help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.