Integrating xamarin, CouchBaseLite, MVVMCross and SyncGateway such that View changes with database - xamarin

I am working on a xamarin project where i use CouchBase Lite as my Local database. I also want to use MVVMCross library. Could anyone specify where should i include couchbase-Lite library, MVVMCross - hot tuna library(like class library or portable class library or platform specif project) such that view model gets notified about the changes in Couchdatabase.
Basically i want to change the view whenver there is a change in database i want to change the view with mvvmcross. Am using syncgateway to sync with server Couchbase bucket.
I am new to Xamarin, MVVM and CouchBaselite.
I couldnt find any concrete example for all this.
Thanks in advance.

I would perhaps just use the CouchBaseLite Xamarin Component. If you are wanting to access this in your PCL Core project you will probably have to create some sort of wrapper around the component and inject it properly into each platform. You can use the MvvmCross plugins wiki to get you started.

I know this is an old thread, but there's a new MvvmCross plugin for Couchbase, and basically does everything you want. It's in alpha, as of this writing on Nuget, and open source on Github. I was actually looking for the same, and happy to have found it! :)
https://www.nuget.org/packages/MvvX.Plugins.CouchBaseLite.ForestDB
https://github.com/mathieumack/MvvX.CouchBaseLite

Related

Xamarin Forms Customer Control Library

I need to create a reusable Xamarin Forms control that will be used in two separate projects. It does require custom renderers for IOS and Android. The problem is I cannot figure our what kind of project to use to create a reusable custom control library for Xamarin forms.
Every site seems to talk about creating customer controls that can be reusing in the same project. But I need it in a separate project for reuse.
Can someone please point me in the right direction.
Depending what are your needs regarding multi-targeting, using a solution with a shared project of type MSBuild.Sdk.Extras could be very helpful. You can then packed your shared project into a package that you can reference from your apps project and use locally.
Examples that might guide you and shows you the path are known nuget packages that are being used by app developers cross-platforms, just an example Xamarin.Forms.PancakeView.
Related to MSBuild.Sdk.Extras: How to use different base class in custom control depending on platform target?

Cannot add Judopay to Xamarin forms project

I am trying to include Judopay in my project, and I was able to add it to Android and iOS, but not to the Xamarin forms project. There is no NuGet to be included and I can't seem to add the component reference. Any idea on how can I add it? I cannot use any of these:
using JudoDotNetXamarin;
using JudoPayDotNet.Enums;
using JudoPayDotNet.Models;
Again, they only work on iOS or Android, but not Xam forms.
That is because they only provide platform implementations. You will need to tell your Forms app which implementation to use at what time.
The correct way to go about this is with some form of IoC, using dependency injection or service location. Luckily Xamarin Forms has this integrated:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/dependency-service/introduction/
Using the references from the Android or iOS projects in your shared code will likely not work completely or break things. Maybe not immediately but surely later on. (Except when there really is no platform-specific functionality, then you might get away with this.)

Xamarin Forms SignaturePad updated

I have tricky question about SignaturePad updated to Xamarin Forms 2.0, link to GitHub:
https://github.com/mrbelk/acr-xamarin-forms
I did manage to download repo and build it, however I have no idea how to produce proper DLLs that I could use in my project?
The main issue is that SignaturePadView is treated as Xamarin Forms View class instead of Android View, so there is different constructors, methods, etc.
Does smb know how to build these projects to produce proper dlls that iOS/Android solution will treat SignaturePadView as Android View and iOS UIView respectively?
Don't use acr.* any more if you want to save yourself some pain. I had to pull their camera implementation out of one of my apps due to no support for forms 2.0+.
Replace acr with supported NuGets like Plugin.Media and the others found here. For this particular issue no one has created a non-deprecated NuGet so there is this plugin as an option.
Apparently, it happens that we have actually used SignaturePad from https://components.xamarin.com/view/signature-pad but via acr.* nuget package.
What I found in my quick research that both acr.xamforms.SignaturePad and SignaturePad it self were in acr nuget package, and actually we were using components from SignaturePad, luckily. So I did remove this nuget from sln to get rid of acr.* components and add SignaturePad from xamarin components by hand.
Now we are able to use Xamarin Forms 2.0 without any problems.
Cheers,
G

Xamarin Forms + Parse: PCL vs Shared Asset Project

I been set the mission to look at Xamarin and its cross plaform / code resuse ability, I come from a iOS/Android background.
I want to aim for the holy grail of one universal front end (basic) and one reusable service layer.
I created my first project as a Xamarin Forms PLC, hit the issue it can not support compiler directives, which seem to be something your going to need. Also I was unable to add Parse package to the PLC. You need to reference it per platform / write code per platform?
I have now created Shared Asset Project, the default setup (new project). This does not allow me to add parse to the shared layer. Some of the examples I see add a new project called service, what type of project is this?
So, my question is, forgetting how many members are in a dev team, which one (PCL, SAP) lets me have a universal backend (parse).
I found a Github sample project that could help you. It can be found here: Sample Parse Project
The link to the xamarin component can be found here: Parse component This Xamarin Component should be able to be added into your project and it should get you started immediately. Also when you add the component to you project you should be able to view sample projects that come along with it.
I would start with the sample project and see what I can do with it, but it should become a lot easier by just adding the Parse component in. This would make it so you could probably use either type of project with some Dependency Injection.

Is there a good MVVM/MVP/MVC framework for JavaFX?

JavaFX with it's binding seems great technology for building UI layer, replacing PHP+AJAX, but are there any frameworks for building database forms applications with JavaFX, or it is meant to write everything from scratch?
You should give a try to some recent libraries :
JRebirth Application Framework to structure your whole application
http://www.jrebirth.org
FXForm to manage form
http://dooapp.github.com/FXForm2/
DataFX to manage complex tables etc..
http://www.javafxdata.org
You can find more tools at http://www.oracle.com/technetwork/java/javafx/community/3rd-party-1844355.html
Eric Bruno has a nice write up on JavaFX and Database using JavaFX Composer. See his articles at DrDobbs

Resources