Realm Integration in Android

Posted By : Prince Bhardwaj | 30-Jun-2017

What is Realm?

 

The Realm Mobile Platform is a next-generation data layer for applications. Realm is reactive, concurrent and lightweight, allowss to work with live, native objects.

Like a database, data in realm can be queried and filtered, interconnected and persisted. Unlike a traditional database, objects in Realm are live and fully reactive. Realm synchronize seemlessly between devices and applications and can be accessed safely across threads.

 

Realm Mobile Database -

 

The Realm Mobile Database is built from ground up to run on mobile devices. Unlike a traditional database, objects in Realm are native objects. We don't have to copy objects out of the database, modify them and save them back. It means we are always working with the live real objects. If one thread or process modifies an object, other threads and processes are immediately notified. It means objects always stay in sync.

 

License -

 

The Realm Mobile database is an open source using the Apache license and cross platform, with libraries available for Android, ios, Xamarin and React native. Realm are fully interchangeble between platforms.

 

Integration -

 

In this blog, we only discussed how to integrate Realm in your Android application -

Realm is installed as gradle plugin -

 

1. Add the class path dependency to the project level buil.gradle file.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "io.realm:realm-gradle-plugin:3.4.0"
    }
}

2. Apply the realm - android plugin to the top of the android application level build.gradle file.

 

apply plugin: 'realm-android'

 

Once these two changes are done. Simply refresh your gradle dependencies. If you are upgrading from proir version, you need to clean your gradle project  to remove any lingering previous installations.

 

Proguard -

 

A Proguard configuration is part of Realm library. This means thet you don't need to add any specific rules to your proguard configuration. 

About Author

Author Image
Prince Bhardwaj

Prince Bhardwaj is having Talent as Application Developer, he is an enthusiastic team player in Oodles Technologies.

Request for Proposal

Name is required

Comment is required

Sending message..