This is a migrated thread and some comments may be shown as answers.

Xamarin for iOS and Android - anyone use it?

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Olympiapeter
Top achievements
Rank 1
Olympiapeter asked on 07 Jul 2019, 05:45 PM
Hello everyone,
I'm currently in the design stages of a new app for iOS and Android. I currently have a predecessor version of this new app for iOS on market, but am looking to revamp it.
I've been looking at Xamarin, because it does offer cross-platform coding. But I'm more confused about how it works.
From what I've gathered - I create a core business logic project in Xamarin, which I then compile into a seperate library, imported into Android Studio and Xcode projects. From there, I use the native development tools to tie the UI interface into the business logic layer, and viola - app is finished.
Granted, this is a very basic way of describing of how things are done - but is it accurate? I wager that all of the models I create in the core business project - to ship between the presentation controllers and logic layer - will be easily accessible and can be directly referenced in the UI project as well?

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 08 Jul 2019, 01:10 PM
Hello Olympiapeter,

Telerik UI for Xamarin is primarily for Xamarin Forms. Although you could use the native control wrappers, but you would miss out on all the new development we've introduced in the past few years as most of the new features and controls are Xamarin.Forms-based.


Xamarin.Forms

If you build your UI in Xamarin.Forms, you would not have to do double or triple the work for the same benefit. You still get native UI because Xamarin.Forms renders the native control on each platform, but you only need to write the UI layer code once. Although this video is about 2 years old, it is very good at explaining the structure: Xamarin University - Building your First Xamarin.Forms App.

For example, this XAML markup code in Xamarin.Forms will produce the native Android button, the native iOS button and the native Windows 10 button.

<Button Text="Click Me" />

Additionally, because Xamarin.Forms uses C#, you can have your business logic inside the same project alongside the Xamarin.Forms code (i.e. in the ViewModels). Here's a quick mock-up to explain at a high level:



You do not use Android Studio or XCode for any of this, you use Visual Studio 2019 (the free VS2019 Community one supports Xamarin) which does everything for you in one spot. Yes, you'll need a Mac to compile the iOS application, but Visual Studio connects to it over your network. You can even render the iOS emulator on the PC through that connection, so you never need to bounce between different machines.

Xamarin.iOS and Xamarin.Android

Whereas if you wanted to build the UI on the native platforms using Xamarin.Android or Xamarin.iOS, you'd need to write the code three separate times, using each platform's very specific way of doing it (axml in Android, ViewController in iOS and XAML for UWP). It's more than just three times the work because the native platform paradigms are vastly different (lifecycle, navigation, etc)






Further Resources

This forum is specifically for the Telerik controls. We do not have any general Xamarin or Xamarin.Forms development help resources. It is expected that you are already familiar with, and have Xamarin tools installed before you can use the Telerik Xamarin controls.

That being said, I can point you to some Microsoft resources to help you understand how it works and to get started.

Q&A Help

StackOverflow and the Xamarin Forums are the best places to get general Xamarin and IDE help.

Tutorials

I recommend walking through this documentation. It takes you though everything, step by step to build your first small app. Once you get to the 50% mark (the "Single page quickstart" article), you are then ready to add Telerik UI for Xamarin in your application.



Microsoft Learn

Finally, I highly recommend the new Microsoft Learn portal. It has replaced Microsoft Virtual Academy as the go-to source for learning Microsoft Technologies.

here you will learn the fundamentals is an easy to follow set of courses.

- Here's all the Xamarin courses - https://docs.microsoft.com/en-us/learn/browse/?roles=developer&products=xamarin 
- Once you have the tools installed, try this module Create a mobile app with Xamarin.Forms and build a phone number translator app.


Wrapping Up

I hope you come to love Xamarin.Forms as much as I do and see just how productive you can be with XAML and C# to quickly build rich, robust and immersive cross platform applications.

Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Olympiapeter
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or