Image for post
Image for post

Today we are going save some data in Realm database and fetch to show that in recycler view.

I have posted how to use recycler view with fewer lines of code. (anyone need can find that here)

This guide is intended for newbies. Realm is cross-platform. Much faster than SQLite. blah blah blah. so I don't want to waste your time by explaining about Relam.we can dive into code.

For simplicity, I ignored the layout files. You can find the entire code in my Github repo.

Initial Setup:

Add the following line in respective Gradle files.

In build.gradle classpath "io.realm:realm-gradle-plugin:6.0.2"

and in top app.gradle add apply plugin…

About

Vignesh Theagarajan

android developer. Decently chubby guy. Wears glasses. Has a beard. Thinks he’s funny. Loves food a lot more than he should. http://vigneshtheagarajan.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store