The Manager constructor has been changed from:

public Manager(File dir, ManagerOptions options) throws IOException

to:

public Manager(Context context, ManagerOptions options) throws IOException

in order to be able to implement Network Aware
sync<https://github.com/couchbase/couchbase-lite-android/issues/8>
.

Note that the Context object passed in is a com.couchbase.lite.Context,
which wraps an android.content.Context, and certain calls are simply
proxied down to the wrapped android.content.Context.

The normal way to create a Manager instance now is as follows:

        AndroidContext androidContext = new
AndroidContext(getApplicationContext());

        manager = new Manager(androidContext, Manager.DEFAULT_OPTIONS);

However, you can also customize the AndroidContext, for example you can
call setNetworkReachabilityManager() to have it use your own implementation
if you want to fine-tune how it reacts to Android network reachability
events, or possibly disable it completely.

An example of doing that:


        AndroidContext androidContext = new
AndroidContext(getApplicationContext());
        androidContext.setNetworkReachabilityManager(new
NetworkReachabilityManager() {
            @Override
            public void startListening() {
                // do nothing
            }

            @Override
            public void stopListening() {
                // do nothing
            }
        });
        manager = new Manager(androidContext, Manager.DEFAULT_OPTIONS);


This has recently been pushed to the master branch, let me know if you run
into problems.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/CACSSHCGBWp_NPX6R5riz65cda4Xj02DGc%2BTx8EL05PHxSSxbEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to