How can I create a cross platform library using xamarin? - xamarin.ios

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.

Related

Azure Function Webhook Templates

I'm starting to research and learn Azure Functions. Specifically I need to learn about webooks.
This video uses a template; https://azure.microsoft.com/en-us/resources/videos/create-a-web-hook-or-api-azure-function/
I have seen this in other tutorials/post on setting up an Azure Function to handle a Github webhooks.
When I create a new function I do not have any of these templates show up. I'm assuming they may need to be uploaded but I have searched and not found any information of where they may be located and how to import them.
Are these still available to use?
Thanks!
I believe that video is quite old. You can find the latest documentation which contains quite a few quickstarts and tutorials to get you started.
Also, while you can create functions from the portal, most of the development can be done locally which is usually preferred by most. Depending on your preference, you could develop using
Visual Studio Code
Visual Studio
CLI (along with any editor of your choice :D)
Also, there are a couple of supported languages from which you can choose from to develop for.

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.

Xamarin.Forms or Xamarin.Android/Xamarin.IOS

I am new to Xamarin and not sure if chose Xamarin.Forms to create a application for ios and android platform has a problem or not.
The application has some features below:
The application will be able to running some code in background without launching application by user.
The application can be launched by a href link or a notification.
The application is able to launch a builtin Camera application, and receive picture data from Camera application.
Thanks,
Bo
The features you are mentioning can be done with both. Actually, anything you can do on Xamarin.iOS and Xamarin.Android can be done with Forms. Because Forms is only an abstraction layer for the UI which is installed by a NuGet package.
Now, having that said when to use Forms or when to use iOS/Android? It is mostly about UI. Are you going to do some advanced or platform specific stuff is is easier to implement that with the platform specific project.
If you UI will be the same in both platforms and mostly consists of some lists and input fields, then that is a very good candidate for a Forms project.
Notice how I said it is easier to do in the platform specific projects. Again here, you can do anything in Forms as well by the means of Custom Renderers, it is just a bit harder to do.
Ideally try it out yourself and see what suits you best.
In regard with your need to execute code in the background. This will be tricky and is very dependent on the platform that you're on. You will definitely have to write platform specific code for that for which you can use the DependencyService to abstract it to your shared code.
However like AlancLui mentioned executing code in the background isn't something that is easy to do on mobile. On iOS it is restricted to accessing location data or playing music, but still your app needs to be running (in the background). Android has something called Services for this, which makes it a bit easier.

Convert Objective C project to Xamarin

We have an app written in Objective C. It uses CoreData, RestKit, about 10 viewcontrollers.
We would like to migrate it to Xamarin (so we can target Android and Windows).
I was hoping there was a way to bind the current code to a Xamarin solution and kind of rewrite features step by step within Xamarin (eg: replacing a viewcontroller at a time, and at the end replacing RestKit+CoreData, by SQLite + ServiceStack).
I am aware of the binding to Objective C option that they provide, however, it doesn't look to be the appropriate fit for this (way too complex, probably easier to rewrite the app from scratch).
Is there a way to migrate our current project to Xamarin so we can convert? or do we start from scratch?
Thanks.
Options:
Migrate full project - no;
Automatically create binding for libraries, rewrite business-code, UI-code - yes;
Rewrite from scratch using .Net/Mono classes - yes.
If code size is relatively small, you should rewrite the whole app. Moreover, thus you could have a chance to separate business-logic from UI code and tools libraries (RestKit, CoreData). In perspective, that code will be more reliable and cross-platformish.
This tool can help. It does Obj-c to C# translation (some manual cleanup required):
Automagical
Quite probably, a re-write, from scratch. One thing to keep in mind, if your back-end is .net.. and you are using DTO's.. like with AutoMapper from Entity Framework objects.. you'll be able to re-use those DTO objects on your mobile side with Xamarin. If you are using OData, I'm not sure if this is still a problem, but Xamarin studio wasn't generating OData service clients. So you had to generate them in Visual Studio, then take the generated client code and throw them into your Mobile projects.
sqllite-net is awesome. I've never had any problems with it.
https://github.com/praeclarum/sqlite-net
I currently have a project, with DTO Objects from an Azure WCF service, that I push directly down into SQLLite objects on IOS and Android with Xamarin. I use RestSharp, rather than Service Stack. I should probably go learn the difference.
If you are looking to use SQLCipher from the Component store, to encrypt your sqllite db locally on your device (Good advice to do so), you should be aware that there is an issue in android.. going to 2.2 or 2.3 with SQLCipher. Works for ICS and above though, if I remember right.
Just be careful on your security implementation for allowing clients to connect. I want to say.. don't take too much advice.. and don't take too little either. : )

Is it possible to reference native code from a monotouch C# library?

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

Resources