Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to use Couchbase Lite in Xamarin.Forms PCL project?

MabuMabu USMember
edited April 2015 in Xamarin.Forms

I go through developer.couchbase.com/mobile/get-started/get-started-mobile/net-mobile/before-you-begin/index.html couchbase documentation. But i am not getting how to use couchbase in Xamarin.Forms PCL project. Can anyone explain how to use in Xamarin.Forms project..

Thanks,
Mahabaleshwar Hegde

Tagged:

Posts

  • DavidDancyDavidDancy AUMember ✭✭✭✭

    I don't think this is officially supported yet. However I think if you clone the source code for the Couchbase Mobile product from GitHub I seem to recall someone submitting a pull request that supported usage in PCLs, so you may be able to get it that way.
    An alternative route could be to create your PCL-based solution, then add the Couchbase Mobile product to a Shared Project within that solution and reference it from the PCL.

  • MabuMabu USMember

    @DavidDancy Thanks for your reply.Please let me provide resources or examples if any

  • AlecTucker.2208AlecTucker.2208 AUInsider, University, Developer Group Leader mod

    Mabu,

    You can use the Xamarin Forms DependencyService to call out from the PCL to code in your platform project to achieve this.

  • MabuMabu USMember

    @AlecTucker.1318 ,

    i have to install Couchbase lite nuget package in all platform. right?

  • DavidDancyDavidDancy AUMember ✭✭✭✭

    @Mabu I used the Xamarin Component Store to install Couchbase Lite. But I think you can achieve the same effect by using NuGet to install all the required packages.

  • MabuMabu USMember

    @DavidDancy thanks. I will check.

  • cezarf0910cezarf0910 PLMember

    couchbase.lite can only be used in 'don't link' Linker Behaviour.
    Does anyone know how to use this in 'Link framework sdks only' in Xamarin.froms?
    Thanks.

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    @Mabu Did you solve the problem of using CouchBase.lite in your PCL through DependencyService? Does this mean I have to write my own Wrapper aroung the Couchbase API?

  • @ThomasBurkhart - when I did this last year, I did need to write a wrapper class for the PCL. I chose not to actually do 1:1 wrapping, but created roughly 15 methods that provided the basic CRUD and sync functionality for CB - fairly specific to how I was using my application (unfortunately not a "generic" framework).

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Ok, so I will do the same. You can always add more methods if needed.

  • dinkualohadinkualoha INMember

    I am not able to finding couchbase lite client for Xamarin forms (UWP and Window 8.1). Got couchbase lite client for Android and IOS. What would be the best way to implement couchbase lite in xamarin forms's PCL, So it can be share between all the platforms ( i.e Android , IOS, UWP and Windows 8).

  • dinkualohadinkualoha INMember
    edited October 2016

    @DavidDancy

    "I don't think this is officially supported yet. However I think if you clone the source code for the Couchbase Mobile product from GitHub I seem to recall someone submitting a pull request that supported usage in PCLs, so you may be able to get it that way.
    An alternative route could be to create your PCL-based solution, then add the Couchbase Mobile product to a Shared Project within that solution and reference it from the PCL. "

    anything on it ? is it possible to do so ?

  • DavidDancyDavidDancy AUMember ✭✭✭✭

    @dinkualoha AFAIK there's no PCL-based version either available or in planning. However if you really want to know, you could raise an issue about it on the project at https://github.com/couchbase/couchbase-net-client.

  • AlbertoBonfiglioAlbertoBonfiglio USMember ✭✭

    I am playing around with it. What I did is turn my project into a netstandard 1.4 project and used the 2.0 beta. It compiles and seems to be working for basic stuff... Haven't done much testing though but it could be a start

  • SurbhiAroraaSurbhiAroraa Member ✭✭✭

    Any help on this? I need to include couchbase in PCL. How to achieve this? Any example.

Sign In or Register to comment.