Sunday 24 February 2019

Creating Tabbar with icons in Xamarin android

In this blog we are going to learn about how to add a Tab Bar with icons in Xamarin Android

Solution and Steps
Here are the steps to add tabs with icons in Xamarin Android app :

Steps 1 :
Create a empty xamarin android project in visual studio.

Steps 2 :

Now open your main.axml layout file which is in the Resources -> layout folder, you can choose or create your own layout file, in my case i have used main.axml file and paste the code below :

Steps 3
Now add three more file in the layout folder and name it as 'Tablayout1.axml', 'Tablayout2.axml' and 'Tablayout3.axml' and paste the code below in three tab pages :
Tablayout1.axml
Tablayout2.axml
Tablayout3.axml

Steps 4 :
Now add three icons for the three different tabs :

Steps 5 :
Now create a folder called "Fragments" in the main root directory of the project and add three fragment in this folder called "TabFragment1.cs", "TabFragment2.cs" and "TabFragment3.cs" and add the below code in each of the fragments  cs file  :

TabFragment1.cs

TabFragment2.cs

TabFragment3.cs

Steps 6 :
Now go to MainActivity.cs file and add the following code :

Here you can see the following output screen :



Monday 25 September 2017

Code Sharing by Xamarin

Xamarin provides a code sharing technique throughout all the devices. You just need to write a code once and you can use that code throughout the project.
There are basically three types of code sharing technique provided the the Xamarin platform.

  1. Shared Code
  2. Portable Class Library

The goal of a code-sharing strategy is to support the architecture shown in this diagram, where a single codebase can be utilized by multiple platforms.



Sunday 24 September 2017

Basic reasons of using Xamarin

Xamarin is a  new emerging technology for the cross platform as well as the native mobile applications.It provides the native user interface by the use of C# language as provide by the android studio for android application using java and the XCode for ios and iphone application using objective C/swift language.

Why Xamarin

Today mobile application development has been growing exponentially because of the huge consumer reachability in mobility. This has created ocean full of opportunity for companies and developers to join this mobile revolution. We want to reach as many as possible consumer which means inclusion of these three platform at least: AndroidIOSWindows.
We all know the dominance and popularity of Native which highly overwhelm HTML apps. Developing native app for major three platforms will not be cost effective as it will require java developer for android, objective-c/swift developer for IOS and .NET developer for windows and respective QA and extra resources.

Saturday 23 September 2017

What is Xamarin

When considering how to build iOS and Android applications, many people think that the native languages, Objective-C, Swift, and Java, are the only choice. However, over the past few years, an entire new ecosystem of platforms for building mobile applications has emerged.
Xamarin is unique in this space by offering a single language – C#, class library, and runtime that works across all three mobile platforms of iOS, Android, and Windows Phone (Windows Phone’s native language is already C#), while still compiling native (non-interpreted) applications that are performant enough even for demanding games.
Each of these platforms has a different feature set and each varies in its ability to write native applications – that is, applications that compile down to native code and that interop fluently with the underlying Java subsystem. For example, some platforms only allow apps to be built in HTML and JavaScript, whereas some are very low-level and only allow C/C++ code. Some platforms don’t even utilize the native control toolkit.