I decided to use Realm for my project. I looked through the documentation and cannot figure out how to get all my phone contacts imported into my Realm database. Has anyone done this project before? Please, help.
I used Sugar ORM, which has a bulk insert option. Does the Kingdom have the same thing, or is there an alternative to this?
Here is what I have done so far:
package com.advisualinc.switchchat.Realm_DB;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
public class R_ContactDB extends RealmObject {
    private String name;
    @PrimaryKey
    private String phone;
    private boolean matchedWithRecent;
    private int status;
    public R_ContactDB(String name, String phone, boolean matchedWithRecent, int   status)
    {
        this.name = name;
        this.phone = phone;
        this.matchedWithRecent = matchedWithRecent;
        this.status = status;
    }
    public R_ContactDB()
    {
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public boolean isMatchedWithRecent() {
        return matchedWithRecent;
    }
    public void setMatchedWithRecent(boolean matchedWithRecent) {
        this.matchedWithRecent = matchedWithRecent;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
}
source
share