Is it possible to reference native code from a monotouch C# library? - xamarin.ios

I'm trying to refactor some of the code of my monotouch app into a library (so I can use it in another app). Some of the code I want to move into the library is native (google analytics and facebook api native libraries), but I can't seem to find a way to get this to work, as you cannot link native code to monotouch libraries.
ie, this is what I'm trying to achieve:
[iPhoneApp facebookLib.a facebookWrapper.dll] ->
[iPhoneApp] [SharedLibrary facebookLib.a facebookWrapper.dll]
Am I missing something or is this not possible?

It seems to be possible, but perhaps I don't understand what you are trying to accomplish.
http://monotouch.net/Documentation/Linking_Native_Libraries
and here
Monotouch and native iOS code

Related

PWA InkCanvas save strokes as svg in javascript

I need to use InkCanvas in my web application using javascript (angular), is it possible to save InkCanvas as a SVG using javascript (or convert InCanvas to canvas)? i see this, but it seems it works for C#, i need a way to do it in javascript!
I think InkCanvas is only supported in Universal Windows Platform (UWP) for Windows10. This is confirmed in this SO post.
You can use Webassembly to run C# code in web browser using some JS helpers. Here is a post explaining the same.
You can try this with the c# code that you are interested in. Compatibility depended. These are relatively new features and only way to know is to try.

Is there any library available in Xamarin forms for Token Input view?

I want multiple strings to be added and deleted in a view. I can achieve this by using native libraries.
Native iOS: CLTokenInputView-Swift-master
Native android: TokenAutoComplete-master
I want to implement this in Xamarin forms for both iOS and android. Is there any way to achieve this? Or any library files available?
I think what you are looking for is something like the TagEntryView. It may not do everything you want but it is open-source so maybe you could get the important parts out of there and customize it as you like.

Open new window in WinJS Universal App

I am trying to figure out how to open a new window from within my WinJS Universal Windows app.
I've found plenty of examples of how to do this in a XAML Universal App using Windows.ApplicationModel.Core.CoreApplication.CreateNewView, but I can't seem to find a reference to that method within the WinJS or Windows namespaces in my Javascript. According to code-hints when I am writing my Javascript, I am able to see that there is a Windows.ApplicationModel.Core namespace, but the only class that appears in it is AppListEntry. No CoreApplication or any of the other classes that the documentation suggests should be there.
I've been digging around trying to find out if this is possible. I haven't been able to find any resources that specifically say you can't perform this action in a WinJS app, but I haven't found any examples that show how to do this either.
I downloaded the Universal Windows App Samples, and they do have a MultipleViews project there, but it doesn't include a JS build.
Does anyone know if it is possible to open a new window from within a WinJS app?
What happens when you do:
window.open("http://www.w3schools.com");
Or set target as "_blank" as you would do for an HTML window?
Visit W3Schools
There is tool written for the Intel XDK (A Cordova product), which can work around some of the limitations of JS running on Windows. Here is a link: https://github.com/xmnboy/xdk-win8x-compat.js . It may resolve some of these issues.
When I was writing Win8 JS apps, I know that I could wrap a function in:
MSApp.execUnsafeLocalFunction(unsafeFunction);
(documentation), which would allow me to inject JS to the DOM. You may be able to write a function that creates a new window with that.

How can I create a cross platform library using xamarin?

I would like to create a SDK for mobile developers to embed my solution, but instead of writing it in Swift and Java, I would like to use Xamarin to write it once and then export to the selected target.
I'm not sure if it possible, I saw this answer : Is it possible to embed xamarin part into an existing native app?
but it was sometime ago so I wonder if things have changed or if there is a workaround, like writing a small native part just to create the bindings and export this as the sdk then...
AFAIK nothing has changed, still not possible.

Objective C interface and C# core

I am trying to port a C# window's application to ipad. I compiled everything on monotouch and it runs well. Now, I need to make an iPad user interface. If I implement the UI in Objective C, how hard is it to integrate it with my C# core? I saw monotouch can call objective C library, but I am doing the opposite direction. Any help is appreciate.
There's currently no support for you to execute the C# code from Objective-C. Your best bet is to just stay in MonoTouch and finish the iPad application with C#.
Working with UIKit in C# is at least as simple as it is with Obj-C, plus you get all the benefits of not having to deal with Memory allocation and the C# language and .NET framework. Developing UI code with lambda expressions and linq is a beatiful thing. Most obj-C sample code can be translated one-to-one to C# code, so almost every sample you find can be easily understood.
There is one possibility, you make your UI into a library, then you bind the library to C#, and then your C# code calls your Objective-C code to the UI, and this one in turn, calls back to C# for its business logic.
You are better off doing the UI directly in C# as well.

Resources