Android working with Realm Database

A realm is an open source database that can be used to store data locally in android.Realm Mobile Database is an alternative to SQLite and Core Data in your Android projects.

The realm runs directly inside phones, tablets. It’s lightweight database in Mobile Development, realm takes very less memory space compared to SQLite.

Realm also allows us to write data in UI thread. it’s Support Cross-platform (Use the same database for all your apps, on any major platform. like Android, objective c, JavaScript, Swift, Xamarin).

  • Realm

    is our equivalent of a database, Realm is not a table. Realm not stores Data in Table and column. But a Realm can contain multiple kinds of objects, and map to one file on disk.

  • Realm

    has Support JSON Data or Object.

  • Realm supports the following field types: boolean, byte, short, int, long, float, double, String, Date. Moreover, subclasses of RealmObject and RealmList<? extends RealmObject> support model relationships.

  • it’s a NoSQL database.

  • Realm supports easy thread-safety, relationships & encryption.

Prerequisites :

  • Realm

    is supported in Android only, not available for Java at the moment.

  • Android Studio version 0.8.6

  • JDK version 7

  • Android API Level minimum 9 (Android 2.3 Gingerbread).

Adding Realm to a Project:

Go to project level build.gradle file and add the following line under dependencies section.

Tagged , , , , , ,

2 thoughts on “Android working with Realm Database

Leave a Reply

Your email address will not be published. Required fields are marked *