I’m currently using CouchbaseLite on and Android app and I just started using the replication feature to synce to a couchdb database(Which I’m new to).
Heres the problem I’ve followed all the steps outlinedhere
My Replication object sends me an idle status. But I have no data in the specific couchdb database I pointed it to. Could there be anything I’m missing?
URL url = new URL("http://192.168.1.100:5984/data/");
push = database.createPushReplication(url);
pull = database.createPullReplication(url);
pull.setContinuous(true);
push.setContinuous(true);
BasicAuthenticator authenticator = new BasicAuthenticator("olabode", "couch");
pull.setAuthenticator(authenticator);
push.setAuthenticator(authenticator);
pull.addChangeListener(this);
push.addChangeListener(this);
push.setFilter("addStoreNameFilter");
pull.setFilter("pullCurrentStoreFilter");
// Start
push.start();
pull.start();
Here are my filters
database.setFilter("addStoreNameFilter", new ReplicationFilter() {
@Override
public boolean filter(SavedRevision savedRevision, Map<String, Object> map) {
map.put(Dao.STORE_ID, storeId);
return true;
}
});
database.setFilter("pullCurrentStoreFilter", new ReplicationFilter() {
@Override
public boolean filter(SavedRevision savedRevision, Map<String, Object> map) {
String currentStoreId = (String) map.get(Dao.STORE_ID);
if (currentStoreId == storeId)
return true;
return false;
}
});
Any help please