Continuous Replication Issues

180 views
Skip to first unread message

Srinivas Tirumala

unread,
Jan 20, 2014, 6:55:05 AM1/20/14
to mobile-c...@googlegroups.com
Hi ,

Is there any listners or methods which will notify us the data changed in Couchbase server so that we can update on UI.
For example i changed project name from abc to abcd ,to update ui is there any listners which will listen for database changes.


Thanks,
srinivas

Andrew Reslan

unread,
Jan 20, 2014, 8:22:09 AM1/20/14
to mobile-c...@googlegroups.com
If you are running continuous replication from Couchbase Lite on iOS, there is a CBLDatabaseChangeNotification that is exposed publicly.

There are some details in this issue and in this commit.

Andy




Jens Alfke

unread,
Jan 20, 2014, 12:55:10 PM1/20/14
to mobile-c...@googlegroups.com

On Jan 20, 2014, at 3:55 AM, Srinivas Tirumala <srini...@gmail.com> wrote:

Is there any listners or methods which will notify us the data changed in Couchbase server so that we can update on UI.
For example i changed project name from abc to abcd ,to update ui is there any listners which will listen for database changes.

There are quite a few ways:

  • Observe kCBLDatabaseChangeNotification, as Andrew points out; or
  • If you have a CBLDocument instance, observe kCBLDocumentChangeNotification posted by it; or
  • If you have a CBLModel instance on a document, use KVO to observe property changes; or
  • Start a CBLLiveQuery and use KVO to observe changes to its .rows property

—Jens

PRASASNNA KUMAR

unread,
Jan 20, 2014, 1:23:12 PM1/20/14
to mobile-c...@googlegroups.com
Hi
    We need solution for android

Thank's

Traun Leyden

unread,
Jan 20, 2014, 1:27:53 PM1/20/14
to mobile-c...@googlegroups.com

On Android you can add ChangeListener's on the following objects:

* Database
* Document
* LiveQuery

which will be called back when these objects change due to underlying changes in the database.


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/5a149c62-706e-48e9-a869-800b6be41f68%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

PRASASNNA KUMAR

unread,
Jan 20, 2014, 11:29:25 PM1/20/14
to mobile-c...@googlegroups.com
Hello,

      Is it possibility to do by using old  GrocerySync project.
      I mean Which project Contain class like

      CBLServer
      CBLDatabase
      CouchDbInstance
      CouchDbConnector
      ViewQuery

Thank's

Scott Ahten

unread,
Jan 21, 2014, 11:26:15 AM1/21/14
to mobile-c...@googlegroups.com


On Monday, January 20, 2014 12:55:10 PM UTC-5, Jens Alfke wrote:
  • Start a CBLLiveQuery and use KVO to observe changes to its .rows property

After updating the latest version of CBL, I've noticed the .rows property is showing up as deprecated. What is the replacement property to observe? 

Jens Alfke

unread,
Jan 21, 2014, 11:34:30 AM1/21/14
to mobile-c...@googlegroups.com

On Jan 21, 2014, at 8:26 AM, Scott Ahten <lightand...@gmail.com> wrote:

After updating the latest version of CBL, I've noticed the .rows property is showing up as deprecated. What is the replacement property to observe? 

It's only deprecated on CBLQuery, in favor of -run:. It's still valid on CBLLiveQuery, where it really does behave as an observable property, since CBLLiveQuery caches the rows.

—Jens

Traun Leyden

unread,
Jan 21, 2014, 1:00:59 PM1/21/14
to mobile-c...@googlegroups.com
Looks like you are using Ektorp, and in that case I believe the way to do it would be:



PRASASNNA KUMAR

unread,
Jan 21, 2014, 1:16:39 PM1/21/14
to mobile-c...@googlegroups.com
Thank's for reply
                   Is there any possibility  to do couhcdb on android continuous replication with out using Ektorp reference documention....

Traun Leyden

unread,
Jan 21, 2014, 2:19:51 PM1/21/14
to mobile-c...@googlegroups.com
Yes the recommended approach is to use the latest code on the master branch:


in which case you can use the native api and call Database.addChangeListener( .. )


Ajith

unread,
Jan 22, 2014, 2:30:54 PM1/22/14
to mobile-c...@googlegroups.com
Hello Traun, 

We've been eagerly waiting for beta 2 of Couchbase-lite Android. We need our iOS app(which uses CBL-iOS)  to be shipped as soon as possible in Android too. Repo milestones says beta 2 is past 5 days.  So, can we expect an official release anytime soon? Or github tag/release from which we can build it ourselves. This will help us to interact with our Android customers. We are expecting the CBL-Android equivalent to CBL-iOS (including helloWorld/API/tutorial documentations here).

TIA
Ajith
p.s we know you have been doing a great job trying to match up with iOS. Happy coding!

Traun Leyden

unread,
Jan 22, 2014, 2:53:38 PM1/22/14
to mobile-c...@googlegroups.com

Hi Ajith,

Yes, you can expect that very soon, we are targeting this Friday (Jan 24), and it will include a HelloWorld demo app, API documentations, and tutorial docs.

Currently all of the last minute release related changes are happening on the stable branch, which will get merged back into master very soon.

Thanks for the kind words!  


Ajith

unread,
Jan 22, 2014, 3:03:40 PM1/22/14
to mobile-c...@googlegroups.com
Awesome! Looking forward :)

Thanks again,
Ajith

PRASASNNA KUMAR

unread,
Jan 30, 2014, 9:53:35 AM1/30/14
to mobile-c...@googlegroups.com
Hello Traun,

 In Android couchdb beta 2version, how we can retrive the an atchaments images from document and how to set to the an Image View.I could not found any such methods in new api.

Thank's
prasanna

Jens Alfke

unread,
Jan 30, 2014, 2:59:02 PM1/30/14
to mobile-c...@googlegroups.com

On Jan 30, 2014, at 6:53 AM, PRASASNNA KUMAR <prasannak...@gmail.com> wrote:

 In Android couchdb beta 2version, how we can retrive the an atchaments images from document and how to set to the an Image View.I could not found any such methods in new api.

PLEASE do not hijack an existing thread to ask an unrelated question. Instead create a new thread (by composing a new email instead of hitting Reply.)

—Jens

Traun Leyden

unread,
Feb 3, 2014, 12:28:36 PM2/3/14
to mobile-c...@googlegroups.com

To retrieve an attachment from a document, try document.getCurrentRevision().getAttachment(attachmentName).
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/11a287d4-a081-4f21-a5f8-5f957738e15e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages