How to view the content of an Encrypted Realm file using Sthetho-Realm

in #utopian-io6 years ago (edited)

sthetho_Edited.png

Repository

https://github.com/facebook/stetho

What Will I Learn?

  • You will learn how to create Realm Objects from JSON file.
  • You will learn how to use RealmRecyclerViewAdapter.
  • You will learrn how to view Encrypted Realm file using sthetho-realm.

Requirements

System Requirements

  • An Integrated Development Environment(IDE) for building Android Application(e.g Android Studio, IntelliJ)
  • Android Device/Virtual Device.
  • Google Chrome browser installed (Windows/Mac).

Required Knowledge

  • Little Experience in working with Realm Java.
  • Java Programming Experience.
  • Little or no Experience working with Room
  • Of course, willingness to learn

Resources

Difficulty

  • Intermediate

Tutorial Content

Introduction

Stetho is a sophisticated debug bridge for Android applications. When enabled, developers have access to the Chrome Developer Tools feature natively part of the Chrome desktop browser.
source

In today's tutorial, we are going to learn how we can use sthetho-realm - a Realm module for Stetho to view an encrypted realm database file.

An encrypted realm as the name implies is a realm that is encrypted using a particular key (64byte key)

We develop an Android application that displays a list of Realm Objects and then we use the Sthetho-realm module to view the encrypted realm file stored on the android device.

The source code of this tutorial can be found here

Time Frame

  • Tutorial Introduction - 00:00 - 00:34
  • Dependencies Used - 00:37 - 02:46
  • Setting up Realm Database and custom RealmRecyclerViewAdapter - 02:48 - 07:49
  • Setting up our layout file - 07:50 - 09:35
  • Linking Everything together - 11:52 - 16:59
  • Viewing Encrypted Realm file using Sthetho in Google Chrome Browser - 17:00 - 18:58

Overview

  • Tutorial Introduction: In this part of the tutorial, an introduction to Stetho and Stetho realm is done.
  • Dependencies Used: In this part the used dependencies in the tutorial are being shown here, dependencies such as - butterknife (Used for view injection), Lombok library (Used for reduction of Boilerplate code), Realm(Used for storing realm objects), Realm Adapter(Used to create custom RealmRecyclerViewAdapter) Sthetho,
  • Setting up Realm Database and custom RealmRecyclerViewAdapter - In this session of the tutorial, we set up the Realm Database, creating the RealmObject class file (Countries.java), Creating a JSON file from which we will be populating our Realm Database from (countries.json), we then create our RealmRecyclerViewAdapter which is a custom RecyclerViewAdapter.
  • Setting up our layout file (activity_main.xml) : This part of the tutorial, we set up the main activity layout file where we add a TextView and then add a RecyclerView element and also create the sample layout file for each RecyclerView objects.
  • Linking Everything Together - In this part, we link all the earlier created components of the Application which includes creating an Application class file where we initialize our Realm for the application, set up our Stetho object indicating the encryption key and also the name of the encrypted Realm file, creating the Realm Objects from the JSON file, Initializing the RecyclerView and it's adapter.
  • Viewing Encrypted Realm file using Sthetho in Google Chrome Browser - Finally here, we used the Google Chrome Dev tools to view the content of our encrypted realm file.

Video Tutorial

Sort:  

Thank you for your contribution.

I like the way you took an project and you showed the process from beginning to end. Through that process I suggest that you explain the processes and choices you made more for learners. You can show learners that there are more than one single way to complete a task and perhaps from time to time give them alternate ways to do so.

I also appreciate that you are using text titles to show learners what they are about to learn. Keep doing this please.

The audio was an issue in the video tutorial. The sound, especially in the last 5 minutes or so was extremely poor. It was almost impossible to understand what you are saying at times. For future videos I suggest you spend more time making sure that your sound quality is as good as possible. This also includes making sure that you are speaking very clearly.

Lastly, consider the content you are teaching. There are examples on the Internet of similar topics as yours being taught. Try and find concepts which would bring new information and ideas to the Open Source community.

Thank you for your contribution,
@buckydurddle

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks @buckydurddle for taking time out to moderate my post.

Corrections have been taken and improvements will be seen on subsequent contributions.

Hey @edetebenezer
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!