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

I see there's a Couchbase.Lite-PCL in nuget which has been published recently. Is this capable of running in the PCL? Anyone knows how to make it work? I couldn't find any documentation on this.

It is not an official NuGet package, so your milage may vary.
It does have the dll's in a portable folder, and the dll's are added fine to a PCL and the project seems to build.
Try it it, it might work fine, but don't expect any direct support from the couchbase people.
Alternatively you could implement an Interface in your PCL, which you implement per platform with the methods you need from the official couchbase nuget. Then inject that platform specific implementation at runtime through the IoC container Xamarin.Forms provide.

Related

Importing KMM library in multiple iOS modules via Cocoapods results in "... implemented in both ..."

I have been maintaining a shared library built with Kotlin Multiplatform for our Android and iOS native apps for quite some time now. Was working great until I decided to split the iOS app into multiple modules (frameworks). For starters I have one iOS app project and two dynamic frameworks, which are used by the app project. All 3 projects are using Cocoapods for 3rd party dependency management. Own modules are imported via framework embedding. No Cocoapods for the own modules needed, because we don't plan to make them available to other projects.
So the issue I am facing now is that whenever I import the KMM framework into more than one of the modules via Cocoapods, the build succeeds, but I receive errors at runtime like
Class MyClassInKMMProject is implemented in both
/Users/{user}/Library/Developer/Xcode/DerivedData/MyApp-hcbcxlfmsfiiqaccahedgcclxmiq/Build/Products/Debug-iphonesimulator/Common.framework/Common
(0x1189318d0) and
/Users/{user}/Library/Developer/Xcode/DerivedData/MyApp-hcbcxlfmsfiiqaccahedgcclxmiq/Build/Products/Debug-iphonesimulator/Core.framework/Core
(0x112a77ea8). One of the two will be used. Which one is undefined.
Since I need the shared KMM library basically in every module, I am stuck right now with this issue.
In some community I remember that someone mentioned static libraries can be imported only once when using multiple modules. But as far as I understand KMM generated frameworks and not static libraries.
I also tried using XCFrameworks instead of Frameworks, but it didn't change anything.
Anyone here knows how I can fix this?
Tried to find a solution for several days, but just found it after writing this question.
Adding isStatic=false to Gradle was the solution, which I got from this post: https://stackoverflow.com/a/65420364/390542

Is #CEntryPoint supported in Quarkus?

I'm working on a Quarkus project, and am enjoying how much quicker it is to develop, compared to normal Java.
I'm interested to know whether all GraalVm and Substrate features are available, and in particular if the #CEntryPoint annotation is available and usable?
I recently read a blog article about how to make Java code usable in c++ using Graal and this annotation.
If this is possible it would open up a lot of possibilities, such as creating python modules, that call a Quarkus or Graal shared object.
This should just work, this is a Graal VM feature so should not require any specific support in Quarkus.

Is there a WebSocket client library for iOS when using Kotlin?

I am looking for a WebSocket library that I can use in a Kotlin Multiplatform project for my iOS implementation. This project is currently in IntelliJ and I am using Gradle to manage dependencies.
I have not been able to find a library that supports iOS and that I can specifically pull into my project via Gradle.
The likes of Starscream, Socket.io, SocketRocket etc seem to only have a means of importing dependencies within Xcode/CocaoPods and nothing via Gradle for my IntelliJ project.
To give some more context I have the following for my project
Kotlin Common code for all my common functionality for the project
Platform specific code for my WebSocket implementations for Java, JavaScript and iOS/Swift
The reason for the platform specific implementations is because I have not found a common library that supports WebSockets for all platforms.
Ktor comes close, but from what I see in their documentation their WebSocket client does not support iOS while their Http client supports all platforms.
If anyone has any recommendations that would be really helpful.
The guys from ktor said that they are working on bringing Websockets to iOS but it's still a few months from release.
I haven't tried it yet but you can import cocoapods to an multiplatform project so maybe you can use it that way, but note that it will only compile in xcode.
Also you should join kotlinlang on slack, the guys from jetbrains are really active there and will usually have an answer in a day.

How to create custom library with gradle `compile` support in AndroidStudio?

I'd like to create my own gradle library, that can be compiled into other projects using gradle compile statement.
Example from Picasso's README:
Download the latest JAR or grab via Gradle:
compile 'com.squareup.picasso:picasso:2.5.2'
I'm developing few applications that share common source: fragments, views, some logic... Sometimes I extend these sources while I'm developing app A, sometimes while I'm developing app B,... And I feel that copy-paste of packages/classes in Android Library Module is not an proper solution.
So I would like to setup my own library, that:
it could be easily deployed to as gradle library that could be used by compile.
I can easily develop/extend it together with currently developed application
Disclaimer: I had been googling it a lot, but without luck.
If you want to reuse a library across completely separate projects then you'll want to publish your library to repository. Assuming this is open source and you don't mind sharing, you could use JCenter, which is already added as a repository to Android projects by default.
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/

is it possible to use the .java extension files in Xcode?

can I call the java extension files in the Xcode?.i.e Can I create the Object for that class.
Thanks in advance
I think it is not possible as far as my knowledge
Xcode used to have some support for Java (e.g. you could have java projects).
now, you would have to setup custom build phases for your Java sources. so, it could function as a tool, but i think most of the functionality has been pulled by now - you'd actually have better luck using older versions of Xcode, which included project and target templates for Java stuffs.
on osx, Idea or Eclipse (or others) is better suited for Java.

Resources