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.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Prince Bhardwaj
Prince Bhardwaj is having Talent as Application Developer, he is an enthusiastic team player in Oodles Technologies.