See example here:
http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/manager/index.html#creating-a-manager
public class Application extends android.app.Application {
private Manager manager;
private static Context mContext;
...
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
try {
/*
* In Java the Manager instance and all the objects descending
* from it may be used on any thread.
*/
manager = new Manager(new AndroidContext(mContext),
Manager.DEFAULT_OPTIONS);
} catch (IOException e) {
Log.e(TAG, "Cannot create Manager instance", e);
return;
}
}
}
On Wed, Oct 29, 2014 at 11:36 AM, Zumo <[email protected]> wrote:
>
> Hi Everyone,
>
> I am writing an app using the Phonegap Couchlite plugin and I need to
> access the Manager instance from another in house plugin.
> When on IOS I use :
> CBLManager *manager = [CBLManager sharedInstance];
> And it works OK
>
> On Android I am trying :
> Manager manager = Manager.getSharedInstance();
>
> As a result I am getting an Exception :
>
> - e =
> {java.lang.UnsupportedOperationException@831704908064}"java.lang.UnsupportedOperationException:
> getSharedInstance() is not a valid API call on Android. Pure java version
> coming soon"
>
>
> What is the recommended approach in Android to get access to the Couchlite
> Manager if getSharedInstance is not supported ?
>
> Thanks a lot for your help
> Christian
>
> --
> 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/e6a424b4-06ad-40cc-9025-afb1085cf93d%40googlegroups.com
> <https://groups.google.com/d/msgid/mobile-couchbase/e6a424b4-06ad-40cc-9025-afb1085cf93d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CACSSHCEJ3DFk-27Kpk0%3DETQyymDCPKObZ6r3qJo6WcALT8AWpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.