max max - 5 months ago 18
Android Question

Create RealmQuery programmatically in android

Is it possible to create "realmquery" in android dynamically and pass it to realm database?

something like this

RealmQuery<RealmModel> query;
public Model equalTo(String fildName,String value){

return (Model) this;


I believe you can do yourself it by wrapping your queries in utility classes, define your table names and columns as string constants and constructing your queries with the builder pattern, I suggest something like this:


This way you can encapsulate Realm string queries and deal with strong types.