Xamarin: Can I do in a cross platform project the "Android part" and do IOS when the rest is finish? - xamarin

I have a project in Android Studio (on a pc), and as far as I know now Microsoft owns Xamarin and its free once you have a Visual Studio license, then you can develop apps using C#(Already know that I have to port the JAVA code) and then compile in a MAC the IOS app.
My 2 concerns are:
When you can't compile, will the IDE show the IOS related errors?
There is a clear implementation of "cross platform code" vs "specific code"?
How Xamarin manage it?
In addition, our plan is to finish the app for Android which is our primary target and then manage the IOS, besides the other questions, what I need to know is if that is possible.

Yes, the VS IDE will show you build errors from the iOS build server.
Yes, you can build an Android app using Xamarin and later extend it to build an iOS app also. This is easiest if you use Xamarin Forms, but it also possible with native Android/iOS UI, but will be much more dependent on how you architect your applications.

Related

Xamarin iOS GUI

We've been developing a cross-platform app in Xamarin on Windows and now we are moving to make GUI for iOS counterpart.
If I'm understanding correctly we need to switch to Visual Studio for MAC, on a MAC machine, and continue our GUI development there.
Is it possible to develop everything on Windows and just publish an app on the MAC machine?
How do we include the logic and everything from the android app?
You can use Xamarin.Forms to develop UI for both Android and iOS.
But if its already native then you can still continue developing it in Windows.
For the build and testing you definitely need a MAC, if you don't want to use a VM then you can build it on the cloud using a https://www.macincloud.com/ or other party that uses the same service, and use a simulator on windows.
If its cross platform then I assume you're using a .NET Standard for the shared codebase. So there would be no problem using the same logic for both the Android and iOS.
It is up to you. Many apps will work by just publishing on the Mac. Of those many will have some artifacts that shouldn't be in the end version.
To simplify it is like asking whether you should publish the app without testing and fixing. In 99% no, but sometimes it may work.

Can xamarin apps be built for Windows, MacOS with same source code?

Given an app written in C# for Xamarin, can it be built to run on all the supported platforms with minimal changes, including Android, iOS, MacOS, Windows?
I realize that Xamarin claims 90% of the code is shareable across platforms (and 10% needs to be customized), and I'm referring to that "90%".
What I don't understand is whether that 90% is shareable across the different Xamarin tools,e.g. Xamarin.Forms and Xamarin.Mac or if those are substantially different tools with different APIs, etc.
For example, I see that with Xamarin.Forms I can build for iOS, Android, and Windows. But not MacOS. So, on a Mac, can I install Xamarin.Mac and then build the same app for MacOS ?
You can add a MacOS target for your Xamarin.Forms-based UI, of course, this is done via Visual Studio for Mac:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/other/mac
There are items within Forms that are not feature complete on MacOS and thus it is still in a "Preview" release and those are listed on the "Platform Support macOS Status" wiki:
https://github.com/xamarin/Xamarin.Forms/wiki/Platform-Support-macOS-Status
Xamarin.Forms is the framework that allows you to create cross-platform apps between Android, iOS and UWP. In my experience, a lot of the features of Xamarin.Forms do not transfer over to Xamarin.Android. In fact, a big chunk of the way things are done for UI Xamarin.Forms will not transfer over to the Xamarin.iOS and Xamarin.Android. Most of the times when I find a solution that works in Xamarin.Forms and I try to do the same thing in Xamarin.Android I end up just figuring out the problem myself in Xamarin.Android from scratch.
When they say that 90% is shared, they mean that within Xamarin.Forms... 90% of the work on your models and code behind can be shared between the projects (within that Xamarin.Forms solution) and 10% will have to be custom tailored for each platform (UWP, Android, iOS)
EDIT: Just for clarification in the future, you need an iOS device or an iOS virtual machine to compile the code on iOS
To build Xamarin.iOS apps with Visual Studio 2019 on Windows, you will
need:
A Windows machine with Visual Studio 2019 installed.
This can be a physical or a virtual machine.
Windows system requirements
A network-accessible Mac set up with Apple's build tools and Xamarin.iOS.
Visual Studio 2019 accesses this machine over a network
connection to use Apple's build tools, which are required for
compiling native iOS applications.
Mac system requirements
source: https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/?pivots=windows
As long as you use .Net code and Xamarin.Forms it is 100% portable/sharable across every single project. Xamarin.Forms are currently in beta for macOS and Windows WPF (but for UWP it is not beta), and for macOS particularly they don't have the true native look.
Xamarin does support using the native interfaces and native APIs and whenever you do that, it is not portable.
So there is nothing like 90% sharable, it may be some estimate for some cases. It can be 100% sharable or it can be only 10% sharable depending on your project and how much you stick to the sharable APIs.

Visual Studio App Center Build for iOS

I know that all iOS apps must be built on a Mac before they can be submitted to the App store but I've noticed that Visual Studio App center provides build services - even for iOS.
Can this be used for beta testing purposes or do I still need a Mac to do the build even for beta testing purposes?
BTW, the app is an enterprise Xamarin Forms app for internal use.
Yes, you also need Mac for Beta testing.
But I use https://www.macincloud.com for testing rather then buying Expensive hardware.
It has built in Support for Xamarin and it very cheap.
iOS not like Android you also ned Apple Developer Lic. for distribute your app.
you can purchase your Lic. as your Requirement from hear : https://developer.apple.com/support/compare-memberships/
(if you just want to check how look your app in Device you can use Xamarin Live )

Xamarin or Xamarin.Forms for Android and classic Windows?

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.

Xamarin IDE and visualstudio for windows +Mvvmcross

I have some confusions About the IDE to use for MvvmCross
a) VisualStudio (VS) uses Xamrarin.iOS and Xamarin.Android plugin for iOS and Android development. But can we also use PCL(Portable Class libraries) and MVVMCross/Monocross frameworks in VS? I see the PCL option on VS but, i don't see the support for Android & iOS. Do i need to install additional plugin for PCL to support these two platforms as well?
b) Xamarin IDE supports Android and iOS development on Mac but, is it true that Xamarin doesn't support Mono.iOS on windows? Isn't it strange that Visual studio can use the network mac for iOS development but why not Xamarin Studio?
Thank You for your time.
Regards,
Saurav
a) VisualStudio (VS) uses Xamrarin.iOS and Xamarin.Android plugin for iOS and Android development. But can we also use PCL(Portable Class libraries) and MVVMCross/Monocross frameworks in VS? I see the PCL option on VS but, i don't see the support for Android & iOS. Do i need to install additional plugin for PCL to support these two platforms as well?
MvvmCross currently uses Profile104 for Portable Class Library development. You can easily develop for this profile without installing Android and iOS. The mapping of PCL profile to platforms is, however, quite confusing (it's not exactly obvious) so the easiest way I find to create a Profile104 PCL is:
to create any PCL
then to manually edit the csproj file to say Profile104 - look for a line like: https://github.com/slodge/MvvmCross-Tutorials/blob/master/Babel/Babel.Core/Babel.Core.csproj#L14 in the csproj
I have customers who develop in medium size teams where only some people have the Xamarin tools installed - most people have just Windows tools and work on the PCLs using Unit Tests and using WindowsPhone/Store user interfaces.
b) Xamarin IDE supports Android and iOS development on Mac but, is it true that Xamarin doesn't support Mono.iOS on windows?
Yes, this is true.
Isn't it strange that Visual studio can use the network mac for iOS development but why not Xamarin Studio?
This may feel strange, but I believe this is actually this is Xamarin listening to their customers.
I believe, that the reason customers wanted Windows support for iOS was because they wanted to use Visual Studio and they wanted to use plugins like Resharper. Xamarin provided this in their 2.0 release.
It is true that they could also have added iOS functionality to XamarinStudio for Windows as well - but this (I believe) wasn't what any of their customers were asking for - so adding it would have created more work (both in creating and maintaining it) without adding any significant benefit (IMO)

Resources