Mobile Development with Microsoft Technology (Xamarin) Part - 1


Hello Guys,
Today, I am going to discuss and share my experience of working with XamarinA powerful Microsoft’s Mobile Development platform. Microsoft making lives of .Net developers easy by continuously giving platforms where we can write fast, robust and scalable mobile, web and desktop applications.
INTRODUCTION
Xamarin is a mobile app development platform which gives you privilege to write the native mobile apps for iOS, Android and Windows Phone using .Net framework. The look and feel of Xamarin apps are native because Xamarin uses Native User Interfaces, Native API Access and Native Performance. The power of Xamarin is anything you can do in Objective-C, Swift or Java, you can do in C#. Here, in Xamarin we can create two types of apps:

  • Xamarin.Forms (cross-platform UI toolkit with shared code for iOS, Android & Windows Phone app).
  • Xamarin.iOS (native platform in which all the native UI toolkit, native libraries will be used).
  • Xamarin.Android (same as above).


LET’S START
Let’s dive into the world of mobile development with Xamarin. Today, I am going to start with Xamarin.iOS. Because, before this we have Apache Cordova mobile app for iphone, if you guys familiar with Cordova you know these type of apps are not native and are build on HTML5 and user-experience of these HTML5 apps on iOS or on Android is not very much native. You will find some lag in touch or gestures and are some limitations in utilization of mobile resources. So, we decided to go with native iOS app. But, the problem was for native iOS app was we need to deal with Objective-C, Swift and X-Code. Thanks to Microsoft, that it provided us a very powerful mobile app development platform i.e. Xamarin using the .NET framework.
HOW IT WORKS
The prerequisites to get started with Xamarin.iOS. We need have Visual Studio 2017 because Xamarin project templates are already there in the VS2017. After that for Xamarin.iOS development Apple restricts us to design the UI of app with Storyboard should use from X-Code (IDE for Apple’s app development just like Visual Studio but only available in Mac OS). Here, we have choice either go with VS for windows and remotely connect the VS with Mac terminal or do the development for iOS in Mac machine. I go with the second option. So, in Mac VS2017 is also available and the experience of native iOS app development with Xamarin is also very good.
Create Project
First, we go to Mac and run the VS2017, if you don’t have you need to get it from App store. Once, you have VS2017, create a new project selecting iOS Single View App template. Please, see the screen below:
CreateProject
Next, you need to give the project name and configure it.
ProjectName.png
Give a name to your project. Keeping it simple, I gave name to my project “SingleViewApp”.
ConfigureiOSApp.png
Here, you need to configure your iOS app by giving it name, you need to mention Organization identifier, team account name, an Apple developer account. Select you target iOS version also select devices on which your app will run. I am selecting only iPhone because, I am targeting the iPhone only right now.
Once your project has been created, you will see several files in you solution explorer. Please, see the screen below:
SolutionExplorer.png
There are some files which we need to understand the purpose of them.
1. Assets.xcassets (for setting the App icons)
AssetsFile.png
2. AppDelegate.cs 
This file is used to handle the App level events. You can register or handle existing events of the App.
AppDelegate.png
3. Entitlements.plist
Entitlement.png
4. Info.plist

Infoplist.png
5. LaunchScreen.storyboard
LaunchScreen.png
6. Main.storyboard
Storyboard.png
Main.storyboard is a designer for iOS app where you can design the story of your app or you can say the UI part of the app can be design here.
In the next part of this blog, I will create an app for you discuss what are the components available in Xamarin.iOS and how we can use to create a iOS app.
Thanks for your time and interest.

To be continued…

Comments

Post a Comment

Popular posts from this blog

Import General Journal Lines using SysOperation Framework in AX 2012

Purchase Order Chat-bot application with OData endpoints using WebApi in D365 for Operations