This is the model for my RealmObject
class :
public class ARDatabase extends RealmObject
{
@PrimaryKey
private String uid;
priv
Doing the search in Realm will always be faster since you can execute the entire search inside the C++ core. Doing the search yourself will mean you occur the overhead of going back and forth between Java and C++.
The only requirement for doing fast searching for single elements is that you have an @Index
annotation on the field, but in your case you already have @PrimaryKey
which automatically applies the @Index
annotation as well.
So your query is as fast as it can be. Besides, for 10-100 objects, no matter what you do, it will probably appear instantaneous to the user.