I tried to use the Xamarin.Android namespace in my crossplatform Xamarin project. When i now build the .iOS Project, i get the notification, that this namespace is, obviously, not existing for iOS.
How can i write platform specific Code, where i use platform specific libraries ?
I already checked the Microsoft Docs but i did not find any information that could solve my problem.
PS: This is my first contribution to Stack Overflow, so feel free to ask for more detailed information.
Welcome to stack overflow.
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction
Above is a link to DependencyService documentation. DependencyService allows you as a developer to call platform-specific code from your Xamarin.Forms shared code.
Related
I'm just starting with Uno. I'm an experienced UWP developer and have done some Mac development (With Xamarin Native).
I've created an Uno solution, and have removed the WASM, WPF and Mobile target projects (only interested in UWP and MacOS)
Now I want to use SQLite in my Uno solution, and not sure how that's achieved. I cant add nuget packages to the shared project, so Im guessing that I need to create an interface class to declare the data access requirements, and then implement that interface separately in the UWP and MacOS projects.
Is this how it's done, or have I got this wrong ?
Does anyone know where on the Uno docs I can find out how to do this
Thanks
OK, I was mostly right. After reading the docs again it seems that rather than interfaces, you need to use partial classes to implement the required class across the platforms you need.
I found out how to do it here:
https://platform.uno/docs/articles/platform-specific-csharp.html
I'm currently developing a little project, i've bought a "smart lock" with works with Bluetooth and uses an open platform called TTLock. The resources are here: https://open.ttlock.com/doc/userGuide
The idea is to create my own App to control this "smart lock" using the methods created by TTLock.
The web page gives SDK resources for Android and IOS, but i want to program my App in Xamarin.Forms. My question is, can I "add" the Android SDK and the IOS SDK to my Xamarin.Forms solution and work with that methods, or i have to program first in Android Studio and later in an IOS IDE?
Thank you so much for your time and your responses. I'm learning about programming APPs on IDE, so all knowledge will be appreciated.
My question is, can I "add" the Android SDK and the IOS SDK to my Xamarin.Forms solution and work with that methods,
The answer of the first question is Yes. You could refer to Binding a .JAR document to use it in Android, and refer to Binding iOS Libraries document to use it in iOS.
or i have to program first in Android Studio and later in an IOS IDE?
The second question is depends on you. You will not need to use native IDE to do that.
For Android, there are two ways to get the native library:
Using Android Studio to download it
Going to Source repository website to download it
First method, I think you already know that, from the document you will find the sample steps:
The Second method, the shared document is chineses language. Therefore, you could find the source repository website here: https://maven.aliyun.com/mvn/search, and search by typing tongtonglock you will see the navtive libraries as follows. Then you can pick one to download.
For iOS, you could refer to its sample link to get the framework.
Is Xamarin.Forms considered a simple sum of Xamarin.Android and Xamarin.IoS with a shared code library wrapper? or is there more under the hood than meets the eye?
I am not talking about the shared code library because I realize it is specific to Xamarin.Forms but rather (for example) if I am to compare a Xamarin.Droid project to an android codebase of a Xamarin.Forms solution, will I find any considerable differences? Will I find any differences. Same goes for IoS & Windows...
Just to provide context; I am interested in utilizing some tools which were originally designed for Xamarin.android however my projects are Xamarin.forms solutions and it would be cool to know in advance if I am running into a rathole.
Thanks in advance you fine people.
Xamarin Forms, in the end, is a wrapper over the native API's so if you have something in Xamarin Forms you can of course port it to Xamarin Android, iOS or Windows.
Is Xamarin.Forms considered a simple sum of Xamarin.Android and Xamarin.IoS with a shared code library wrapper? or is there more under the hood than meets the eye?
At its simplest, Xamarin.Forms is a mobile application framework for building user interfaces. The definition from Xamarin's website is:
Xamarin.Forms is a cross-platform UI toolkit that allows developers to easily create native user interface layouts that can be shared across Android, iOS, and Windows Phone.
But don't simply focus on the term "UI" in that definition and think only on-screen controls. Instead, focus on the word "toolkit" as Xamarin. Forms offer so much more in addition to user interface controls that work across platforms.
Xamarin.Forms will emit a 100% native iOS, Android or UWP app – in fact the starting point of any Xamarin.Forms app is within one of those platform projects. However, that's as far as the platform-specific code needs to go. The rest of the code can all be written in one of the layers that are shared amongst all the applications.
if I am to compare a Xamarin.Droid project to an android codebase of a Xamarin.Forms solution, will I find any considerable differences? Will I find any differences. Same goes for IoS & Windows...
Just Basic API differences, which are different between forms and native
You shoud see Xamarin.Forms as the abstraction of the UI over the actual platform. Xamarin.Forms (XF) renders the UI in native platforms controls, but they are created using XF XAML.
Coding against XF is like coding for a different platform with a different set of tools, at the UI level!
You can, if needed go deep in platform specific details if needs be via interface implementation and injection.
Though this is a duplicate question, it would be really great if someone can help me in integrating a DICOM image viewer in my iOS application. Basically we are building a health application, where we have a requirement to showcase .DCM images. Any solutions ?
I'd tried with this and this too. But no luck :(
Imebra (c++) can be compiled for OS-X and iOS.
It comes with few objective-c helpers that convert images to UIImage or NSImage and std::string objects to/from NSString.
The documentation contains a section dedicated to building the library for Apple OSes.
Disclosure: I'm the author of Imebra
I am currently the primary maintainer of fo-dicom, which is a C# based cross-platform DICOM toolkit, available on .NET Framework, but also on Xamarin iOS, Xamarin Android as well as other platforms.
If you are considering developing in C#, fo-dicom might be a sufficient alternative.
I am trying to build a simple app using tidesdk , but unfortunately as stated here :
https://stackoverflow.com/a/14207566/1724929
that currently there is no way to protect the source code which is visible to the app users.
but after taking a look at wunderlist for Windows which is built using tidesdk and .net framework , i saw that the source code is not visible also i searched if it were hidden somewhere but i found nothing , so any one have an idea how they protect the source code from being visible . is there any tool or something to achive that ?
Latest version of Wunderlist is not built using TideSDK. They have re-implemented all different versions pure natively on each platform they are supporting.
TideSDK currently does not support Code hiding however the Developers of TideSDK are developing TideKit which is releasing soon with a new CLI, app and will provide platform builds. It will also provide Code Hiding. You can follow recent developments at http://www.tidekit.com. The video of what is coming is here: http://youtu.be/aE7gN-d0GhU. This will give you modern tools to use where the experience of creating and your projects is much better.