Xamarin is a popular cross platform framework that is used for developing Android, iOS, OS X and Windows applications. This framework uses Visual Studio and C#. As it helps to save a lot of time and efforts, it is a trusted choice of several developers and enterprises all over the world. Developers can share the code between Android and iOS apps and compile it into native code. It offers the benefits of native UI and native performance.
In order to build a cross platform app with Xamarin, you would need some tools. We have compiled the list of essential tools required for Xamarin development:
By using Xamarin.Mac combined with Xamarin.iOS and Xamarin.Android, developers can share up to 90 percent of native code across Android, iOS, and Mac OS. Furthermore, Xamarin.Mac integrates with Xcode, so a developer can use the Xcode’s Interface Builder to create an app’s user interfaces. Xamarin.Mac exposes the complete macOS SDK for.NET developers to build native Mac applications using C#. First step: Add a Cocoa App project. Right now, Xamarin.Forms template doesn’t have a Cocoa App initially. So, what you would do is to start Visual Studio for Mac or Xamarin Studio and open your existing Xamarin.Forms solution. Then, add a project into the solution by right-clicking the solution and selecting Add Add New Existing Project.
Xamarin-Supported IDEs
While most of the code is self-explanatory, a couple of core pieces work to bootstrap the Mac app. Notice how the AppDelegate inherits off FormsApplicationDelegate - this is a construct from Xamarin.Form's MacOS support with a few overrides that allow injecting Xamarin content within a custom Mac app window.NSWindow is the Mac app frame and CoreGraphics is being used to create the rectangle.
Visual Studio:
This is Microsoft’s modern and sophisticated IDE with a lot of features for building mobile, web, and desktop applications. Visual Studio is used for developing mobile apps with .Net, .Net core applications, cross platform Unity games, and ASP.Net core web apps. Visual Studio Code helps the developers create cloud and web applications easily. It is a one stop tool for develop apps, manage small and large teams, and build services. As it has a rich editor, debugging, and source control, it facilitates app development across different platforms. It makes continuous integration for different platforms and speeds up the development process.
Developed by: Microsoft Corporation
Platform: Windows, Mac
Release date: February 1997
Written in: C++, C#
Pricing: Free for students and individual developers. Professional or Enterprise annual subscriptions start at $ 1,199 or $ 5,999, while cloud subscriptions start at $ 539 yearly.
Platform: Windows, Mac
Release date: February 1997
Written in: C++, C#
Pricing: Free for students and individual developers. Professional or Enterprise annual subscriptions start at $ 1,199 or $ 5,999, while cloud subscriptions start at $ 539 yearly.
![App App](https://i.ebayimg.com/images/g/ZIAAAOSwogVfClxN/s-l640.jpg)
XCode:
XCode is a comprehensive development environment for building apps for iPhone, iPad, Mac, Apple Watch, and Apple TV. If you want to build iOS applications with Xamarin on Visual Studio on a Windows system, you require a Mac computer for remote compilation and debugging.
Developed by: Apple
Platform: Mac
Release date: 2003
Pricing: Free
Platform: Mac
Release date: 2003
Pricing: Free
Xamarin Development Tools
NuGet:
This is an important tool for developing any modern apps. It offers a unique mechanism by which programmers can create and share useful code for app development. Usually, the code is bundled into packages with compiled code with the other content required in the projects.
NuGet has a central repository of more than 100,000 unique packages that can be used by .Net developers for building different types of apps. https://ixtrjfe.weebly.com/blog/sling-app-on-mac. Developers can host packages privately in the cloud or private network. The programmers can also make packages available to a specific group of users.
Developed by: Microsoft Corporation, .NET Foundation
Platform: .NET Framework
Release date: October 5th, 2010
Written in: C#
Pricing: Free, open source
Platform: .NET Framework
Release date: October 5th, 2010
Written in: C#
Pricing: Free, open source
Prism:
This is a great framework for developing loosely coupled, yet maintainable XAML applications in Xamarin Forms and Windows 10 UWP. It offers a wide collection of design patterns that are used in writing well-structured applications.
Developed by: .NET Foundation
Pricing: Free, open source
Pricing: Free, open source
MFractor:
It contains XAML IntelliSence, and image tooling to simplify Xamarin app development. MFractor provides an enhanced XAML editor for supercharging your Xamarin.Forms development. It also helps the developers find code issues immediately and fix them with a few clicks. It adds the missing elements such as image import wizard, mobile-specific navigation shortcuts, and localization assistance. MFractor can be customized according to your specific project requirements with a rich configuration engine.
Xamarin Studio Download
Developed by: Matthew Robbins, Tom Bowers
Platform: Mac
Pricing: Free. Professional version at $300.
Platform: Mac
Pricing: Free. Professional version at $300.
Resharper:
It is a Visual Studio extension for .Net programmers to offer on-the-fly code quality analysis. You would get to know instantly if your code requires improvement. Resharper warns the users about the problems in the code, and also provides the quick fixes to solve the issues automatically. Developers can choose the best quick fix from the range of options provided.
Developed by: JetBrains
Platform: Windows
Pricing: Plans start at $129 per year
Platform: Windows
Pricing: Plans start at $129 per year
With so many tools for Xamarin development, you can leverage the features and build an outstanding cost effective application that works on multiple platforms offering a native feel. i-Verve has a team of expert Xamarin developers for hire who understand the clients’ exact business requirements and offers custom Xamarin solutions.
Back in .NET Conf 2017 The Xamarin team already shared what’s going to be new with Xamarin Forms 3.0 and it actually surprised me. I was expecting some performance improvements, bug fixing and a big upgrade on XAML. But, what they announced focuses on enabling the usage of Xamarin.Forms in more ways and on more platforms. I was really hoping for XAML improvements, maybe add some cascading styling like how CSS works. Maybe sometime in the future, we’ll get it. For now, I’ll just use the XAMLCss by warapa. Anyway if you want to watch all sessions from .NET Conf 2017, you can check it out on Channel9. Going back, I really didn’t expect these new features, but definitely, I love it and really excited to try it out!
That’s why right now, I’m going to show to you one of the exciting features added to the Xamarin.Forms 3.0 that I think you’ll also love. How to add chrome to allow apps on mac. I’m talking about Xamarin.Form’s macOS support.
One of the Xamarin team’s plan is to reach more platforms. That means UWP, iOS and Android are not only platform the Xamarin.Forms will be able to target from now on, they are also bringing macOS, GTK#, Linux and WPF!
You might think that it will be hard and will take a lot of time to integrate your Xamarin.Forms solution into the macOS project, but it’s not. Not at all. You’ll be able to create a native macOS application using your Xamarin.Forms solution using Visual Studio for Mac or Xamarin Studio in just 3 quick steps!
First step: Add a Cocoa App project
Right now, Xamarin.Forms template doesn’t have a Cocoa App initially. So, what you would do is to start Visual Studio for Mac or Xamarin Studio and open your existing Xamarin.Forms solution. Then, add a project into the solution by right-clicking the solution and selecting Add > Add New Existing Project.
You can then select Mac > App > Cocoa App and name it whatever you want, but ideally, the name has a suffix of .macOs.
Second Step: Add the Xamarin.Forms NuGet Package
You will have to add the Xamarin.Forms’ latest pre-release nuget package or specifically 2.4.0.282. To do this, right click the Cocoa App project that you just created and select Add > Add Nuget Packages.
Then, search for ‘Xamarin.Forms’ and make sure that the ‘Show pre-release packages’ is ticked. Click ‘Add’ to add Xamarin.Forms nuget package. Install app from unidentified developer mac high sierra.
You will also need to update the Xamarin.Forms on your shared project and the version should be the same with what the Cocoa app have. File synchronization mac app.
Third Step: Configure the Cocoa App Project
The first thing that you should do with your Cocoa app project is to add the shared project into your Cocoa app as a reference.
Then, open the Info.plist and remove the ‘Main storyboard file base name’ entry (Opened with XCode)
Or just open the Info.plist inside Visual Studio or Xamarin Studio by clicking it and leave the Main Interface blank.
The next one is to update your Main.cs’ Main method to initialize the AppDelegate:
Lastly, update the AppDelegate by changing the NSApplicationDelegate to FormsApplicationDelegate:
Initialize the Cocoa app window within the constructor:
Then inside the DidFinishLaunching method, initialize Xamarin.Forms and load the application:
You can now set your project as the startup project and run your macOS!
Again, in just 3 quick steps, it’s done!
C# Xamarin Android
This is just a basic walkthrough since this is still on preview. Expect that there are still bugs and not ready for production. Not all nuget packages are compatible and surely, there are lots of UI features still not implemented, but this is a good start. For now, you can send your issues and problems that you encounter in this forum discussion: https://forums.xamarin.com/discussion/93585/preview-xamarin-forms-for-macos/p1