私は今までCloudant-syncアンドロイド最新リリースを使用しています:2.0.2、Android api 21+をターゲットにしています。
私のサーバーデータベースはCouchDB 2.1.0ですReplicator/ReplicatorBuilderはURI資格情報を無視します
私はアンドロイドアプリからレプリケーションプルをトリガーしてローカルデータベースを更新しようとしています。 "https:// user:password @ databaseurl/db_name" (ここではhttps://github.com/cloudant/sync-android/blob/master/doc/replication.mdとなります) のように、レプリケータのソースURIを指定していますが、生成されたレプリケータオブジェクトでは、 "replicator.strategy"を検査します。 sourceDb https」のデシベルのURIは単に である 『://からDatabaseUrl/DB_NAME』ので、私はunhautorized取得(私は、データベース・サーバー上のセキュリティチェックを無効にする場合、それは正常に動作します)
これは私のランニングコードです:
public ReplicationListener pullAllAsync(Databases db_name) {
try {
URI uri = db_name.getServerURI();
DocumentStore ds = DocumentStore.getInstance(new File(db_name.getMobilePath(), db_name.toString()));
Replicator replicator = ReplicatorBuilder.pull().from(uri).to(ds).build();
ReplicationListener listener = new ReplicationListener(replicator);
replicator.getEventBus().register(listener);
replicator.start();
return listener;
} catch (Exception e) {
e.printStackTrace();
LogRepository.getInstance().escribirLog(LogRepository.TipoLog.ERROR, null, e, true);
return null;
}
}
私は何か間違っていますか?
ありがとうございます!
ここにコードを貼り付けてください。それのイメージではありません。 –
申し訳ありませんが、私はすでに編集しています。ありがとう –