I have the same problem. I have to set the master password for the first time in my application right after installation, and after the guardian just checks it. To do this, I must check the area database if such an object exists, if so, just confirm that the master pass password is still set. Since realm is a nosql database, so we need to check if an object exists instead of a table. Thus,
CustomObject custom = realm.where(CustomObject.class).findfirst(); if(custom == null){ //set master password } else { //verify master password }
works for me.
Aman srii
source share