I have an app developed in xamarin.android. Now I want to develop same app in xamarin.ios. So can I use any code (classes, methods written by me) that is written for xamarin.android app in xamarin.ios app.
Yes. Code that is not platform dependent (domain, models, services, data, etc) can be placed into a PCL or shared project and used by both apps. Code that is platform dependent (UI, other device interaction) will need to be written for each platform.
Related
I am a newbie working with Xamarin Forms in Visual studio 2019.
When I create a blank page for Mobile App(Xamarin.Forms) , I do not see a Xamarin.forms portable template app in my project solution.
There is no PCL anymore. PCL is outdated. Just use the Mobile App (Xamarin.Forms) template. It will create all you need.
The core project (that contains your shared code) will be a .net standard project.
.net standard is way better than PCL, because you don't have a artificially limited set of APIs.
this creates the following 3 projects
Your shared code should go into the App8 project
We currently have an app in Xamarin, which is Xamarin.Android and Xamarin.iOS with a shared PCL (no Xamarin.Forms). It currently is a very complicated app and we would like to remake screen by screen the app, and move away from Xamarin to a Swift and a Kotlin app in the meantime.
Is this possible? We don't have the time nor money to remake the app completely at once.
I have looked into making new screens as external libraries, and then bind that library, but I think that's making it a bit too complicated.
you can reuse the assets and resources only but not the code because you are using Xamarin.Forms not Xamarin.Android + Xamarin.iOS.
in your project you don't have any android XML design files and no iOS storyboard even the logic is different with the .cs files because you are not using the Android Java SDK or iOS SDK directly.
If you were use mono and mono touch directly without using the PCL (Xamarin.Forms) project then you can rewrite the code with minor changes with names of method, properties... etc.
I am wondering Xamarin carries Mono runtime with its all app package. In this case, if two Xamarin based app installed in a device which will be having two Mono runtime right. Is it a limitation with Xamarin?
On iOS each app has its copy of the runtime. iOS does not allow for sharing of between apps.
On Android you have the ability to select whether or not to use a shared runtime, but this is generally recommended only for debugging, not production.
Is there a way to create a Xamarin or Xamarin.Forms solution that targets Android and classic Windows to produce a Windows 7,8,8.1,10 executable (exe)?
I am not interested in UWP.
Xamarin.Forms will support WPF in the future so you will be able to deploy an EXE file to those platforms. Read more about it here on the blog.
Also, you can always share the business logic, data and other layers with any other .NET application so having an Android app, Windows app and a core project that doesn't depend on Xamarin is perfectly fine.
You can already take a look at the WPF branch of the Xamarin.Forms project on GitHub.
Our team would like to develop an application in Visual studio and Xamarin. The app needs to be supported in both Mac and Windows. We prefer Xamarin because the back end code can be shared. If possible, how to build and publish it so that it can be only installed in the machines. We are not planning to submit this app to the corresponding app stores.
You can write and Windows Application with C# using WinForms, WPF, WinRT (Windows Store apps).
Also you can write Mac application with C# using Xamarin.Mac.
To share the code between Windows App and Mac App, you just need to split your code into shareable Business Logic (part) and specific UI part.
To share the code, just use PCL libraries.
Yes.
The core business logic can be written in shared code usable on both platforms.
You have a couple of choices of how to develop the UI. You can use native or Xamarin Forms.
If you use native then I would suggest using the MVVM pattern with a framework like MvvmCross. You can then write the bulk of your app in shared code and just write the UI in platform-specific code, with the windows UI written as a standard windows WPF or UWP app, and the Mac app written using Xamarin.Mac using the native Mac API.
If you want to use Forms then you may have to compile the binaries yourself to get Mac support as it won't be available till roughly May 2017, but you could get started building a Forms app for UWP/Windows now and add the Mac project once it is available.