max max - 1 year ago 82
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;

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download