<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Andrei Tarasevich &#8211; SaM Solutions</title>
	<atom:link href="https://sam-solutions.com/author/a-tarasevich/feed/" rel="self" type="application/rss+xml" />
	<link>https://sam-solutions.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Jul 2026 10:37:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>Mobile Development with .NET</title>
		<link>https://sam-solutions.com/blog/mobile-development-with-net/</link>
					<comments>https://sam-solutions.com/blog/mobile-development-with-net/#respond</comments>
		
		<dc:creator><![CDATA[Andrei Tarasevich]]></dc:creator>
		<pubDate>Mon, 11 Jul 2022 13:14:33 +0000</pubDate>
				<guid isPermaLink="false">https://sam-solutions.de/?post_type=article&#038;p=558</guid>

					<description><![CDATA[Microsoft’s flagship product .NET is a programming platform that gives users opportunities to undertake a wide range of tasks, from the creation of simple console applications to the end-to-end development of highly scalable web, desktop, mobile apps, IoT solutions, and more. In this article, we’ll discuss in detail the tools and methods .NET provides for [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Microsoft’s flagship product .NET is a programming platform that gives users opportunities to undertake a wide range of tasks, from the creation of simple console applications to the end-to-end development of highly scalable web, desktop, mobile apps, IoT solutions, and more.</p>



<p class="wp-block-paragraph">In this article, we’ll discuss in detail the tools and methods .NET provides for developing mobile applications. Let’s take a look.</p>



<span id="more-558"></span>




 
    
    <div class="editor-list-cta editor-list-cta_style_1 editor-list-cta_index_1">
        
    <div class="editor-list-cta__items">
                                    
                    			    			
    			    			                
                    			    			        
    			
                    			
                                
                <div class="editor-list-cta__item editor-list-cta__item_index_1">
                    <div class="editor-list-cta__item-inner">
            		                		                                <div class="editor-list-cta__item-left">
                                                                                                    <a href="/services/technologies/dot_net/#feedback?utm_source=blog&#038;utm_medium=post_ID_558&#038;utm_campaign=cta_post_content_3869" class="editor-list-cta__item-title"><p><strong>Backed by Microsoft partnership, SaM Solutions</strong> skilfully handles .NET development projects of any scale and complexity.</p>
</a>                                                	        </div>
            	        
            	                    	            <div class="editor-list-cta__item-right">
            	                                                                            	                                	                                                    <div class="editor-list-cta__item-image">
                        					<img decoding="async" class="editor-list-cta__item-img" src="https://sam-solutions.com/wp-content/uploads/net.svg"
                        						 width="193" height="193"
                        						 alt="Backed by Microsoft partnership, SaM Solutions skilfully handles .NET development projects of any scale and complexity.
">
                                         </div>
                                         
                    	            
            	            </div>
            	                	        </div>
                </div>
                        </div>
    </div>
    



<h2 class="wp-block-heading"><span style="color: initial; font-size: revert;">What Is .NET?</span></h2>



<p class="wp-block-paragraph">First let’s get a general idea of what <a href="/services/technologies/dot_net/">.NET</a> is. The traditional definition goes something like this: “.NET is an open-source and free framework by Microsoft used to develop various types of applications for various platforms and being an integral part of Windows OS.”</p>



<p class="wp-block-paragraph">Diving a bit deeper, we understand that .NET is a huge ecosystem of software products (languages, developer tools, libraries, runtime environments, etc.) for cross-platform development.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="1211" height="1201" src="https://sam-solutions.com/wp-content/uploads/NET-platform.png" alt="What is .NET?" class="wp-image-3417"/></figure>
</div>


<p class="wp-block-paragraph">The following are the key components.</p>



<ul class="wp-block-list">
<li><b>.NET Framework</b> — the initial product released in 2002, which aimed to develop applications and services on Windows only.</li>



<li><b>.NET Core</b> — the platform-agnostic framework appeared in 2016 and enabled cross-platform development.</li>



<li><b><a href="/services/technologies/xamarin-development-services/">Xamarin</a></b> — the framework for developing <a href="/services/mobile-and-web-app/cross-platform-app-development/">cross-platform mobile applications</a>. It was created by the Mono project and then purchased by Microsoft and integrated into .NET.</li>



<li><b><a href="/services/technologies/xamarin-development-services/">MAUI (Multiplatform App UI)</a> </b>— the next evolutionary step of Xamarin, which will support Android, iOS, macOS and Windows.</li>



<li><b><a href="/services/technologies/c-sharp-development-services/">C#</a>, F#, Visual Basic</b> — most popular programming languages used in .NET.</li>



<li><b>Visual Studio</b> — the basic development environment for .NET projects. Options include Visual Studio Code and Visual Studio for Mac.</li>



<li><b>Command line interface (CLI)</b> — a toolchain for creating, running and publishing cross-platform applications.</li>



<li><b>.NET Standard</b> — a common set of APIs, ensuring unification within the ecosystem. &nbsp;Starting with .NET 5, this approach to unification has become obsolete.</li>



<li><b>Common Language Runtime (CLR)</b> — the environment used to manage the execution of software components written in various languages.</li>



<li><b>.NET 5</b> — a step forward to a single platform, taking the best of .NET Framework and .NET Core and enabling the development of applications for all devices from a single place. Released in 2020.</li>



<li><b>.NET 6</b> — a unified development platform allowing you to create desktop, web, mobile, <a href="/services/software-engineering/cloud-software-development/">cloud</a>, IoT, gaming and AI applications. Released in 2021.</li>
</ul>



<p class="wp-block-paragraph"><b>Note!</b> If there were still separate products in .NET 5 (.NET Framework, .NET Core), they have now merged under one name — .NET 6. So, you can launch this single version and create any types of solutions. All the previous products now have common libraries, <a href="/services/software-engineering/api-development-services/">APIs</a> and infrastructure components.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1211" height="931" src="https://sam-solutions.com/wp-content/uploads/NET-6-platform.png" alt=".NET is a unified development platform " class="wp-image-3419"/></figure>
</div>


<p class="wp-block-paragraph">As you can see, the .NET ecosystem is highly diverse, given that we’ve mentioned only some major components. The list can be complemented by numerous libraries, runtimes and other tools.</p>



<h2 class="wp-block-heading">What Is the Use of the .NET Framework?</h2>



<p class="wp-block-paragraph">According to <a href="https://www.statista.com/statistics/793840/worldwide-developer-survey-most-used-frameworks/" target="_blank" rel="noreferrer noopener nofollow">Statista</a>, .NET Framework was the most used framework among developers worldwide in 2021, with .NET Core/.NET 5 in the top three as well. This fact proves that the platform has a broad scope of application, including:</p>



<ul class="wp-block-list">
<li>desktop applications</li>



<li><a href="/services/web-app-development-services/">web applications</a></li>



<li>mobile applications</li>



<li><a href="/services/software-engineering/enterprise-software-development-services/">enterprise systems</a></li>



<li>IoT solutions</li>



<li>games.</li>
</ul>



<p class="wp-block-paragraph">The following hints suggest when the various .NET products should be used.</p>



<ul class="wp-block-list">
<li>Use <b>.NET Framework</b> if you need a desktop or server-based application running on Windows OS only.</li>



<li>Use <b>.NET Core</b> if you need a cross-platform web app (should run on Windows, <a href="/services/embedded/linux-drivers-development/">Linux</a>, macOS) — if you need a high-performance and scalable solution based on the microservices architecture and Docker containers.</li>



<li>Use <b>Xamarin</b> if you need cross-platform, hybrid or native applications for mobile operating systems (iOS, Android).</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1211" height="631" src="https://sam-solutions.com/wp-content/uploads/When-to-use-.NET_.png" alt="When to use .NET products" class="wp-image-3422"/></figure>
</div>


<h2 class="wp-block-heading">Frontend Mobile Development in .NET</h2>



<p class="wp-block-paragraph">The frontend of mobile applications is the part that users see and interact with. Frontend developers and web designers work together to implement the logic and its visual representation. In .NET, there are several tools for frontend development.</p>



<h3 class="wp-block-heading">Xamarin</h3>



<p class="wp-block-paragraph">Xamarin is the most popular open-source frontend framework in the .NET family. It enables cross-platform development — i.e., the project has several target platforms at once (Android, iOS). With Xamarin, you can create mobile applications in two different ways.</p>




 
    
    <div class="editor-list-cta editor-list-cta_style_1 editor-list-cta_index_2">
        
    <div class="editor-list-cta__items">
                                    
                    			    				<style>
    					.editor-list-cta_index_2 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-button {
            				            					color: #000000;
            				            				
            				    					}
    				</style>
    			    			
    			    			    				<style>
    					.editor-list-cta_index_2 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left {
    					    padding-left: 10px;
    					}
    					
    					.editor-list-cta_index_2 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left:before {
    					    left: 0;
    					    top: 50%;
    					    width: 3px;
    					    content: '';
    					    position: absolute;
    					    margin-left: -10px;
    					    height: calc(100% + 10px);
    					    transform: translateY(-50%);

            				            					    							    background: linear-gradient(45deg, #6dc7ff, #e6abff);
    							            				    					}
    					
    					@media (max-width: 475px) {
    					    .editor-list-cta_index_2 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left:before {
    					        width: 2px;
                                margin-left: -3.5px;
    					    }
    					}
    				</style>
    			                
                    			    			        			        <style>
        					.editor-list-cta_index_2 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-inner {
        					            						    background: #166dbd;
        						        					}
        				</style>
    			        
    			
                    			
                                
                <div class="editor-list-cta__item editor-list-cta__item_index_1">
                    <div class="editor-list-cta__item-inner">
            		                		                                <div class="editor-list-cta__item-left">
                                                                                                    <div class="editor-list-cta__item-title"><p><strong>Empower Your Business with a Xamarin App</strong> Boost engagement, increase productivity, and reach a wider audience with our Xamarin development services.</p>
</div>
                                                	        </div>
            	        
            	                    	            <div class="editor-list-cta__item-right">
            	                                    	                                	                                                
            	            </div>
            	                	        </div>
                </div>
                        </div>
    </div>
    



<p class="wp-block-paragraph"><b>First development option </b><b>— a separate UI for each platform&nbsp;</b></p>



<p class="wp-block-paragraph">Using Xamarin Native, you can develop Android and <a href="/services/mobile-and-web-app/ios-application-development-services/">iOS apps</a> independently. This means that you will have to write unique code for each solution with the help of native features (XML files, storyboards) provided by Xamarin.iOS and Xamarin.Android libraries. At the same time, the backend of such solutions can be shared.</p>



<p class="wp-block-paragraph">As an example, I want to show you the Android layout file for one of our company’s internal applications:</p>



<p class="wp-block-paragraph">And this is the resulting screen:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="693" height="1289" src="https://sam-solutions.com/wp-content/uploads/MeetApp-en@2x-min.png" alt="screen" class="wp-image-3424" style="width:347px;height:645px"/></figure>
</div>


<p class="wp-block-paragraph">The main advantage of this approach is that, though coding for different platforms, you use one language, C# (instead of <a href="/services/technologies/swift-development-services/">Swift</a>, Java, and others). You can also incorporate third-party SDKs specific for both platforms due to bindings that Xamarin provides. This is very convenient as you get everything in one place.</p>



<p class="wp-block-paragraph"><b>Second development option </b><b>— a single UI for all platforms</b></p>



<p class="wp-block-paragraph">Using Xamarin.Forms, you can write a sharable UI code for all platforms. Of course, you will need some minor code adjustments for each target platform, but this is much quicker than having to develop separate solutions.</p>



<p class="wp-block-paragraph">Take a look at this example of a UI layout based on Xamarin.Forms:</p>



<p class="wp-block-paragraph">The output of this code is exactly the same screen as in the screenshot above.</p>



<p class="wp-block-paragraph">Moreover, Xamarin supports other platforms such as Windows, Mac, Linux (GTK) and Tizen, so you can develop an application that will run on a wider range of mobile devices. Thus, Xamarin is rightly considered to be a comprehensive mobile app platform that frontend developers can leverage for cross-platform projects.</p>



<h3 class="wp-block-heading">MonoGame and Unity</h3>



<p class="wp-block-paragraph">The two other options for mobile frontend development in .NET are Unity and MonoGame. While Xamarin is used for general-purpose mobile solutions, these frameworks focus on the development of mobile gaming applications for iOS and Android (but they also support other platforms).</p>



<p class="wp-block-paragraph"><b>MonoGame</b> is a free framework used to create games for mobile devices, consoles and desktop computers. This is the successor to the Microsoft XNA framework that was used to develop games for Windows a decade ago. The code in MonoGame is written in C# and targets the iOS and <a href="/services/mobile-and-web-app/android-development-services/">Android mobile</a> platforms, as well as other platforms that run games, including Windows, macOS, Linux, PS4, PS Vita, Xbox One and Nintendo Switch.</p>



<p class="wp-block-paragraph">MonoGame is a less powerful tool than Unity. However, it provides a range of features that enable 2D and 3D rendering, the management of sounds, and images and states in the game.</p>



<p class="wp-block-paragraph"><a href="https://unity.com/" target="_blank" rel="nofollow noopener"><b>Unity</b></a> is a fully featured platform offering real-time 3D experiences not only for game development but also for creating films, <a href="/industries/automotive/">automotive</a> solutions, architectural projects and more. With built-in VR/AR capabilities, Unity can be a great tool for any application that requires realistic visualization.</p>



<p class="wp-block-paragraph">Unity provides a simple-to-use editor where you create objects and then implement their logic with the help of .NET technologies.</p>



<p class="wp-block-paragraph">Here’s an example of the Unity script:</p>



<p class="wp-block-paragraph">Platforms supported by Unity include:</p>



<ul class="wp-block-list">
<li>mobile — iOS, Android, tvOS</li>



<li>desktop — Windows (UWP), Mac, Linux</li>



<li>web — WebGL</li>



<li>console — PlayStation, Xbox, Nintendo Switch, Stadia.</li>
</ul>



<p class="wp-block-paragraph">As you can see, gaming engines like Unity provide advanced capabilities for mobile development, which is highly valued by modern users. However, when considering the tool for frontend mobile development, keep in mind all the technical requirements. Frameworks like Unity with VR/AR/3D capabilities can cause certain difficulties to mobile solutions because mobile devices have limited resources (battery life, processing power, etc.) and&nbsp; might not be able to perform tasks as quickly as required. At the same time, script writing based on Xamarin is lightweight.</p>



<h3 class="wp-block-heading">How to Build and Run Mobile Applications?</h3>



<p class="wp-block-paragraph">The process of building and running mobile apps differs from that for desktop or web apps, because with mobile, you focus on a wide range of devices instead of a general-purpose PC. Hence, you can’t use a “traditional” computer; you need either a physical mobile device or an emulator that imitates the performance of such devices.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td colspan="2">                                                                       <strong>Build and run</strong></td></tr><tr><td><strong><p style="text-align: center;"><b><a href="/services/mobile-and-web-app/ios-application-development-services/">Android apps</a></b></p></strong></td><td><strong><p style="text-align: center;"><b><a href="/services/mobile-and-web-app/ios-application-development-services/">iOS apps</a></b></p></strong></td></tr><tr><td><ul><li>on a computer running any operating system</li></ul></td><td><ul><li>on a computer running macOS only</li></ul></td></tr></tbody></table></figure>



<p class="wp-block-paragraph">With applications for Android, it’s simple: you can work on a computer with any operating system, use Visual Studio to select either a virtual device (emulator) or a connected physical device, and run your application.</p>



<p class="wp-block-paragraph">With iOS solutions, you can work only on a computer running macOS. The good news is that Xamarin provides the Remoted iOS Simulator for Windows, so you can test your iOS apps in their target simulator and display it on your Windows machine.</p>



<h2 class="wp-block-heading">Backend Mobile Development in .NET</h2>



<p class="wp-block-paragraph">The backend part of a mobile solution “lives” at the server side and out of the user’s sight. Of course, there are simple mobile applications such as a calculator or voice recorder that don’t need a backend, since they don’t have to store and process data. But to create large solutions with complicated business logic, the backend development team has to work hard in order to make the magic happen under the hood.</p>



<h3 class="wp-block-heading">ASP.NET Core and ASP.NET Web API</h3>



<p class="wp-block-paragraph">It should be noted that backend development for mobile applications is the same as for web apps. Thus, if you need to develop several mobile and web solutions with the same functionality, you can share the backend service, which is super convenient and time- and cost-efficient.</p>



<p class="wp-block-paragraph">To develop the web service infrastructure for your mobile application, you need to create a REST API serving as a mediator between the mobile frontend and backend. For this purpose, you can use ASP.NET Core, selecting a web API project template in the .NET Core infrastructure. Then, you’ll need to add a database context, apply CRUD methods, configure URL paths, routing, return values, etc.</p>



<h3 class="wp-block-heading">Visual Studio App Center</h3>



<p class="wp-block-paragraph">In case you need to go beyond the backend development process and integrate it with the system administration, virtualization, security management, continuous integration/continuous deployment (CI/CD) and other practices, you should focus on the <a href="/services/software-engineering/devops-as-a-service/">DevOps</a> tools.</p>



<p class="wp-block-paragraph">Visual Studio App Center is a web portal designed to enable DevOps practices in mobile app development. It provides integrated development services for automating the life cycle of applications for iOS, Android, Windows and macOS. Using Visual Studio App Center, you can:</p>



<ul class="wp-block-list">
<li>connect a repository</li>



<li>build a project in the cloud</li>



<li>test your application on thousands of devices at once</li>



<li>distribute apps to beta testers and app stores</li>



<li>monitor performance in real time</li>



<li>track crash reports and <a href="/services/data-analytics-services/">analytics</a>.</li>
</ul>



<p class="wp-block-paragraph">As a result, you can build your application, monitor its performance and stability, and address reported errors from a single cloud-based platform.</p>



<h3 class="wp-block-heading">Azure Mobile Apps</h3>



<p class="wp-block-paragraph">One more option for building and hosting the backend for .NET-based mobile solutions is Azure Mobile Apps. The technology offers a range of capabilities for cross-platform and native applications:</p>



<ul class="wp-block-list">
<li>On-premises or cloud data storage</li>



<li>Customer authentication</li>



<li>Offline data synchronization</li>



<li>Personalized push notifications</li>



<li>Built-in autoscale</li>
</ul>



<p class="wp-block-paragraph">If you compare Visual Studio App Center and Azure Mobile Apps, both tools are popular among .NET developers. However, the former has a wider range of DevOps services and is more actively developed at the moment. Hence, the choice of the most appropriate tool should be based on the project goals, tech needs and <a href="/industries/financial-software-development/">financial</a> capabilities.</p>



<h2 class="wp-block-heading">Why Consider .NET as an Excellent Option?</h2>



<p class="wp-block-paragraph">.NET has been on the market for so long that it has become a recognized brand. Today, there is an extended ecosystem of software products, libraries and tools that are written specifically for the .NET Framework. This provides incredible flexibility in terms of solutions you can develop with .NET.</p>



<p class="wp-block-paragraph">We’ve compiled a list of the best reasons why you should consider .NET for mobile development.</p>



<ul class="wp-block-list">
<li><b>Sharable code</b> — you can create a single codebase for several platforms, which reduces development time and expenses.</li>



<li><b>Single technological stack</b> — all the tools you need for mobile app development, including IDE, SDK, testing and analytical tools, are available in one place.</li>



<li><b>Security and reliability</b> — Microsoft contributes to the reliable operation of its servers and continuously improves the security features of its products. You can therefore be sure that you’ll produce secure and reliable solutions if you develop them with .NET.</li>



<li><b>Support</b> — .NET is an open-source technology with strong corporate support by Microsoft. Its global community brings together millions of developers who contribute to the platform’s further development and who would be glad to help you address any issues that may arise with your project.</li>
</ul>



<p class="wp-block-paragraph">As you can see, over the years of its existence, .NET has become the most profitable development environment for a wide range of platforms, including Android, Linux, macOS and iOS.</p>



<p class="wp-block-paragraph">SaM Solutions is a certified Microsoft partner with the following competencies:</p>



<ul class="wp-block-list">
<li>Gold Application Development</li>



<li>Gold Collaboration and Content</li>



<li>Silver DevOps</li>



<li>Silver Cloud Platform</li>
</ul>



<p class="wp-block-paragraph">Our team of experienced and motivated .NET developers have successfully implemented numerous projects and earned the praise of many satisfied customers over the years. We will gladly transform your ideas into efficient mobile (or other) solutions, so don’t hesitate to contact us.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sam-solutions.com/blog/mobile-development-with-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Why Use Xamarin for Cross-Platform Development</title>
		<link>https://sam-solutions.com/blog/xamarin-cross-platform-development/</link>
					<comments>https://sam-solutions.com/blog/xamarin-cross-platform-development/#respond</comments>
		
		<dc:creator><![CDATA[Andrei Tarasevich]]></dc:creator>
		<pubDate>Mon, 23 May 2022 13:24:30 +0000</pubDate>
				<guid isPermaLink="false">https://sam-solutions.de/?post_type=article&#038;p=687</guid>

					<description><![CDATA[A mobile strategy has become a must for businesses striving for online success because an increasing number of users access the internet via smartphones. Today, going mobile means creating a solution compatible with several mobile platforms, mainly Android and iOS. That’s why it&#8217;s important to know how to create cross-platform mobile apps and what tools [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">A mobile strategy has become a must for businesses striving for online success because an increasing number of users access the internet via smartphones. Today, going mobile means creating a solution compatible with several mobile platforms, mainly <a href="/services/mobile-and-web-app/android-development-services/">Android</a> and iOS. That’s why it&#8217;s important to know how to create cross-platform mobile apps and what tools are best to use.</p>



<p class="wp-block-paragraph">This article provides a detailed overview of a popular <a href="/services/mobile-and-web-app/cross-platform-app-development/">cross-platform development</a> tool — <strong>Xamarin</strong>.</p>



<span id="more-687"></span>



<h2 class="wp-block-heading">Mobile Market Penetration in Figures</h2>



<p class="wp-block-paragraph">The statistics are a core indicator in evaluating the significance of mobile devices in today’s life. Let’s take a look at the market as of 2022:</p>



<ul class="wp-block-list">
<li>According to <a href="https://www.statista.com/statistics/330695/number-of-smartphone-users-worldwide/" target="_blank" rel="noreferrer noopener nofollow">Statista</a>, the number of smartphone users today surpasses <b>6.5 billion people</b>, which is over 83% of the world’s population.</li>



<li>There are <b>4.32 billion </b>unique mobile internet users in 2021.</li>



<li>Mobile internet traffic accounts for<b> 56.89%</b> of the global web traffic.</li>



<li>The market share of different mobile operating systems is estimated as follows: <b>Android — 71.6%, </b><b>iOS</b><b> — 27.68%</b>, with other players such as Samsung, KaiOS, Windows Phone, etc. taking less than 1% each.</li>



<li>The survey by <a href="https://www.jetbrains.com/lp/devecosystem-2021/miscellaneous/" target="_blank" rel="noreferrer noopener nofollow">JetBrains</a> revealed that <b>53% </b>of developers use cross-platform technologies and frameworks for creating mobile apps.</li>
</ul>



<p class="wp-block-paragraph">This data proves that mobile solutions have become an integral part of our life and will significantly impact all spheres in the years to come. Therefore, <a href="/services/mobile-and-web-app/">mobile app development services</a> will be in high demand.</p>




 
    
    <div class="editor-list-cta editor-list-cta_style_1 editor-list-cta_index_3">
        
    <div class="editor-list-cta__items">
                                    
                    			    				<style>
    					.editor-list-cta_index_3 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-button {
            				            					color: #000000;
            				            				
            				    					}
    				</style>
    			    			
    			    			    				<style>
    					.editor-list-cta_index_3 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left {
    					    padding-left: 10px;
    					}
    					
    					.editor-list-cta_index_3 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left:before {
    					    left: 0;
    					    top: 50%;
    					    width: 3px;
    					    content: '';
    					    position: absolute;
    					    margin-left: -10px;
    					    height: calc(100% + 10px);
    					    transform: translateY(-50%);

            				            					    							    background: linear-gradient(45deg, #6dc7ff, #e6abff);
    							            				    					}
    					
    					@media (max-width: 475px) {
    					    .editor-list-cta_index_3 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-left:before {
    					        width: 2px;
                                margin-left: -3.5px;
    					    }
    					}
    				</style>
    			                
                    			    			        			        <style>
        					.editor-list-cta_index_3 .editor-list-cta__item.editor-list-cta__item_index_1 .editor-list-cta__item-inner {
        					            						    background: #166dbd;
        						        					}
        				</style>
    			        
    			
                    			
                                
                <div class="editor-list-cta__item editor-list-cta__item_index_1">
                    <div class="editor-list-cta__item-inner">
            		                		                                <div class="editor-list-cta__item-left">
                                                                                                    <div class="editor-list-cta__item-title"><p><strong>Enjoy the advantages of a mobile presence with SaM Solutions&#8217;</strong> cross-platform mobile development services.</p>
</div>
                                                	        </div>
            	        
            	                    	            <div class="editor-list-cta__item-right">
            	                                    	                                	                                	            <div class="editor-list-cta__item-event">
                    	                <div class="editor-list-cta__item-button button button_style_1">
                                            <a class="button__inner" href="/services/mobile-and-web-app/?utm_source=blog&#038;utm_medium=post_ID_687&#038;utm_campaign=cta_post_content_4024">                                                <div class="button__name">View offer</div>
                                            </a>                                        </div>
                                    </div>    
                                                                        
            	            </div>
            	                	        </div>
                </div>
                        </div>
    </div>
    



<p class="wp-block-paragraph">What’s more, mobile frameworks for cross-platform coding are growing in popularity because applications compatible with several platforms offer a more flexible and complete customer experience.</p>



<p class="wp-block-paragraph">Let’s move on to give you a comprehensive overview of <a href="/services/technologies/xamarin-development-services/">Xamarin</a>, a popular tool for cross-platform development.</p>



<h2 class="wp-block-heading">What Is Xamarin?</h2>



<p class="wp-block-paragraph">Microsoft acquired Xamarin, which had been initially based on the Mono project, in 2016 and integrated it into the .NET platform.</p>



<p class="wp-block-paragraph">Today, this is a popular open-source framework for developing cross-platform mobile applications. A single technology stack of Xamarin, C# and .NET, together with the reuse of up to 95 percent of the code, enables the quick and easy creation of mobile apps for Android, <a href="/services/mobile-and-web-app/ios-application-development-services/">iOS</a> and Windows operating systems.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><b>Xamarin</b> is a software company that created the Common Language Infrastructure (CLI) implementations and was purchased by Microsoft in 2016.</p>



<p class="wp-block-paragraph"><b>Xamarin</b> is a development platform that aims to create mobile applications for iOS, Android and Windows.</p>
</blockquote>



<p class="wp-block-paragraph">How good is Xamarin? Judging by the statistics, Xamarin’s products are quite popular around the world. According to the company’s reports, more than 15,000 organizations and about 1.4 million developers are using them in 120 countries. Among the most renowned customers are Bosch, Siemens, Slack, Pinterest, and others. The fact that several industry leaders have based their solutions on this platform proves its reliability and efficiency.</p>



<p class="wp-block-paragraph">Statista also proves the popularity of Xamarin by including it in the list of the most used frameworks among software engineers, preceded by <a href="/services/technologies/flutter-development-services/">Flutter</a>, <a href="/services/technologies/react-native-development-services/">React Native</a>, Cordova and Ionic.</p>



<p class="has-text-align-center wp-block-paragraph"><b>Cross-platform mobile frameworks used by software developers worldwide from 2019 to 2021</b></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1101" height="685" src="https://sam-solutions.com/wp-content/uploads/xamarin-market-share-1.png" alt="Xamarin for cross-platform development" class="wp-image-3451"/></figure>
</div>


<h2 class="wp-block-heading">Platforms Supported by Xamarin</h2>



<p class="wp-block-paragraph">Currently, Xamarin supports the creation of reusable code for the following platforms:</p>



<ul class="wp-block-list">
<li><b>Android</b> (including the Android Wear version for developing software for wearable devices)</li>



<li><b>iOS</b> (including watchOS for Apple Watch and tvOS for Apple TV)</li>



<li><b>Windows</b> (UWP and WPF)</li>
</ul>



<p class="wp-block-paragraph"><b>Note!</b> Windows Phone is not supported as of Xamarin 3.x</p>



<ul class="wp-block-list">
<li><b><a href="/services/embedded/linux-drivers-development/">Linux</a></b> (GTK)</li>



<li><b>Mac</b></li>



<li><b>Tizen</b></li>
</ul>



<h2 class="wp-block-heading">How Xamarin Works</h2>



<p class="wp-block-paragraph">The basic principle of Xamarin work is code sharing. In simple words, software developers write the code once and then apply it to various platforms with slight modifications, instead of writing the platform-specific code for an Android project and an iOS project from scratch.</p>



<p class="wp-block-paragraph">.NET, as the foundation of Xamarin, performs memory allocation, the automatic garbage collection, and other tasks.</p>



<h3 class="wp-block-heading">Xamarin Development Approaches</h3>



<p class="wp-block-paragraph">There are two ways of developing <a href="/services/mobile-and-web-app/cross-platform-app-development/">cross-platform</a> applications using Xamarin.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1211" height="1501" src="https://sam-solutions.com/wp-content/uploads/Xamarin-Forms-vs-Xamarin-Native.png" alt="Xamarin cross-platform development" class="wp-image-3458"/></figure>
</div>


<ol class="wp-block-list">
<li><b>Xamarin.Forms technology </b>allows you to design a visual user interface once, attach some C# logic to it and share this codebase across Android, iOS and Windows platforms with some minor code changes. In this case, the UI code and the backend are pulled together for all solutions. This approach ensures a faster development time, and it’s cheaper. However, the application performance is not ideal.</li>



<li><b>Xamarin Native </b>includes Xamarin.iOS, Xamarin.Android and Xamarin.Mac libraries that allow you to design separate UI applications for each platform. In this case, the UI code is unique for each solution, but the backend is shared, just as with Xamarin.Forms. With this approach, the development process is slower and more expensive, but it ensures perfect native behavior by apps.</li>
</ol>



<h2 class="wp-block-heading">Xamarin Cross-Platform Development Features</h2>



<ul class="wp-block-list">
<li><b>Base Class Library (BCL)</b> — a standard .NET library of classes with powerful features that Xamarin can access and make use of, such as serialization, XML, networking, etc.</li>



<li><b>Visual Studio</b> — an integrated development environment (IDE) that Xamarin uses to build apps. It provides essential features such as code autocomplete, integrated source control, and more.</li>



<li><b>Interoperation with </b><b>programming languages</b> — Xamarin can invoke libraries written in C, C++, Java and Objective-C, which significantly expands code-writing opportunities.</li>



<li><b>Xamarin Component Store</b> — a built-in collection of free and paid third-party components (services, libraries, UI controls).</li>



<li><b>Backend integrations</b> — you can integrate your Xamarin-based applications with powerful backend platforms, including SAP, Azure, and Parse.</li>
</ul>



<h2 class="wp-block-heading">Building Cross-Platform Apps with Xamarin: Advantages</h2>



<p class="wp-block-paragraph">Cross-platform mobile development is becoming widespread as it has certain advantages over native development. Why use Xamarin for creating cross-platform solutions? In short, because this is a developer’s dream tool — they can create code once and use it across various platforms, without impairing the app’s performance, maintainability, or user experience.</p>



<p class="wp-block-paragraph">Xamarin is a universal tool that allows you to create a single application logic using C# and <a href="/services/technologies/dot_net/">.NET</a> for three mobile platforms at once.</p>



<p class="wp-block-paragraph">Let’s discuss in more detail the reasons to use Xamarin for cross-platform mobile development.</p>



<h3 class="wp-block-heading">1. Single Technological Stack</h3>



<p class="wp-block-paragraph">One of the main pros of Xamarin is that a single language, C#, creates all kinds of solutions. Moreover, there’s no need to switch between environments — you can do everything in Visual Studio. This is convenient and time-effective because developers perform the same process using one language instead of two different languages. Hence, Xamarin is easy to learn.</p>



<h3 class="wp-block-heading">2. Native User Experience</h3>



<p class="wp-block-paragraph">Xamarin has full access to native <a href="/services/software-engineering/api-development-services/">APIs</a> and toolkits used on Android, iOS and Windows platforms. Consequently, it can provide native (or near-native) design and performance for every application.</p>



<p class="wp-block-paragraph">The nativeness is possible due to the usage of platform-specific elements and technologies available in C# and Visual Studio:</p>



<ul class="wp-block-list">
<li>Xamarin.Android and Xamarin.iOS give .NET developers access to complete Android and iOS SDKs.</li>



<li>Xamarin.Essentials library provides access to core overlapping native APIs.</li>



<li>Xamarin.Forms exposes a user interface (UI) toolkit for all mobile platforms.</li>
</ul>



<p class="wp-block-paragraph">Thus, you can take advantage of all the unique elements in one place and create a single solution with platform-specific interfaces.</p>



<h3 class="wp-block-heading">3. Shareable Code</h3>



<p class="wp-block-paragraph">Xamarin is often referred to as a “write once, use everywhere” development platform because it creates code that’s 60–95% reusable. A single codebase can run on various platforms, providing native performance, and may require slight changes only.</p>



<h3 class="wp-block-heading">4. Time and Costs Saving</h3>



<p class="wp-block-paragraph">A shareable codebase and a single technological stack save time spent on the development cycle. You code once and can then reuse most of this code for other solutions, making only slight adjustments and not spending time on the same procedure. This means you can release your product faster.</p>



<p class="wp-block-paragraph">Since everything is written in C# and within the .NET framework, there is no need for separate teams to work on the app. The development, testing and deployment are significantly streamlined when performed by a single team. This eliminates additional expenses and ensures quick time to market.</p>



<p class="wp-block-paragraph">It is especially beneficial for companies with limited human and hardware resources.</p>



<h3 class="wp-block-heading">4. Testing</h3>



<p class="wp-block-paragraph">The platform offers comprehensive solutions to test and monitor application user interface and performance — Xamarin Test Cloud and Xamarin Test Recorder. These tools allow you to run automated tests on multiple real devices in the cloud and find performance issues before the release.</p>



<h3 class="wp-block-heading">5. Simplified Maintenance</h3>



<p class="wp-block-paragraph">It is remarkably easy to maintain apps developed with Xamarin.Forms as they share code. If you need to update applications and address some issues, just do it in the source code, and all changes will be automatically applied to other solutions. Again, it saves time, developer involvement and <a href="/industries/financial-software-development/">finances</a>.</p>



<p class="wp-block-paragraph">What’s more, the Xamarin community deserves respect for providing comprehensive customer support backed with well-organized documentation and training opportunities.</p>



<h3 class="wp-block-heading">6. Technical Support by Microsoft</h3>



<p class="wp-block-paragraph">The framework guarantees stability, continuous technical backing and fast issue resolution because it’s supported by Microsoft — one of the world’s leading tech software companies.</p>



<p class="wp-block-paragraph">Moreover, Microsoft provides access to robust educational opportunities, including Xamarin courses, which can be self-paced, and comprehensive tech documents on the official Microsoft Learn platform. This means that developers are not working in a vacuum and can receive support while improving their expertise.</p>



<h2 class="wp-block-heading">Building Cross-Platform Apps with Xamarin: Challenges</h2>



<p class="wp-block-paragraph">Like any other software product, Xamarin is not a perfect fit for all projects. Here are some challenges that may prevent you from using this cross-platform development tool.</p>



<h3 class="wp-block-heading">1. Heavy Applications</h3>



<p class="wp-block-paragraph">Xamarin-based solutions can be twice as big as native files and require extra adjustments because they use numerous core libraries and functionality. A couple of additional megabytes may be critical for some projects.</p>



<h3 class="wp-block-heading">2. No Complicated Graphics</h3>



<p class="wp-block-paragraph">It’s tough to build appealing Xamarin solutions loaded with complex graphic elements or animation. Hence, this platform is not the best choice for creating apps with advanced visualization or gaming apps.</p>



<p class="wp-block-paragraph">However, nothing is impossible: the open-source platform allows developers to create new APIs and plugins to expand the capacity and add new possibilities.</p>



<h3 class="wp-block-heading">3. Updating Lag</h3>



<p class="wp-block-paragraph">When updates for Android, iOS and Windows are released, Xamarin developers can’t use them immediately. They need some time to properly integrate new features into the ecosystem, which causes an updating delay (of one or two days) and may affect the company’s reputation.</p>



<h3 class="wp-block-heading">4. Performance</h3>



<p class="wp-block-paragraph">Though Xamarin-based applications provide near-native performance, they are still slower than native solutions. If performance is critical for a client company, Xamarin may not be the best fit.</p>



<h2 class="wp-block-heading">Xamarin Integrated Development Environment (IDE)</h2>



<p class="wp-block-paragraph">You can use several IDEs for developing Xamarin-based applications.</p>



<p class="wp-block-paragraph">Initially, there was <b>Xamarin Studio</b>, a proprietary environment for Mac and Windows app development (later only for Mac apps). This tool is now obsolete and has been replaced by <b>Visual Studio for Mac</b>.</p>



<p class="wp-block-paragraph">Currently, <b>Visual Studio </b>is the basic environment for working with Xamarin. It has four versions:</p>



<ul class="wp-block-list">
<li><b>Visual Studio Community </b>— an option for small teams, students and open-source projects.</li>



<li><b>Visual Studio Professional</b> — a set of powerful tools for code-writing for small teams of professional developers.</li>



<li><b>Visual Studio Enterprise</b> — an environment for large, complex projects.</li>



<li><b>Visual Studio Code (VS Code) </b>— not a full-featured IDE, but a lightweight code editor providing basic tools for creating simple applications.</li>
</ul>



<h2 class="wp-block-heading">Latest News: .NET MAUI</h2>



<p class="wp-block-paragraph">Xamarin is not standing still. The next milestone in platform development is the release of <b><a href="/services/technologies/dot-net-maui-development-services/">.NET MAUI</a></b>, scheduled for Q2 2022. MAUI stands for Multiplatform App UI, and will be a merger of .NET and Xamarin.Forms.</p>



<p class="wp-block-paragraph">The new product will feature the improved Xamarin.Forms architecture and low-code elements, and will provide access to all native APIs. Xamarin.Native will become part of the .NET 6 platform.</p>



<p class="wp-block-paragraph">Microsoft will still support Xamarin for some time, but they won’t release new versions.</p>



<p class="wp-block-paragraph">Developers are looking forward to getting acquainted with MAUI and leveraging its capabilities for new projects. We at SaM Solutions stay tuned for updates and will guarantee the smooth migration of our existing Xamarin-based apps to the new platform.</p>



<h2 class="wp-block-heading">Our Experience with Xamarin</h2>



<p class="wp-block-paragraph">Xamarin experts at SaM Solutions have been providing services for more than eight years and have successfully completed more than ten projects.</p>



<p class="wp-block-paragraph"><b>Our Xamarin competencies include:</b></p>



<ul class="wp-block-list">
<li>Business needs and requirements analysis</li>



<li>App development</li>



<li><a href="/services/software-engineering/maintenance-and-modernization/">Support and maintenance</a></li>



<li>UI/UX design</li>



<li>Legacy native mobile app improvement and performance optimization</li>



<li>Mobile testing services</li>
</ul>



<p class="wp-block-paragraph">One of our clients needed a solution with two separate mobile apps for two specific user groups to collaborate. Developing different apps for iOS and Android would have been time-consuming and would have resulted in high expenses along the way. That’s why the client opted for Xamarin cross-platform development.</p>



<p class="wp-block-paragraph">As a result, the cross-platform solution was developed and successfully launched on iOS and Android. Our team was involved in the following stages of product creation:</p>



<ul class="wp-block-list">
<li>Requirement definition</li>



<li>Application development</li>



<li>Testing</li>



<li>Design</li>



<li>Execution</li>



<li>Support and maintenance</li>
</ul>



<p class="wp-block-paragraph">In another project, the challenge was to develop a mobile application for both iOS and Android platforms that would control electronic locks in <a href="/case-studies/smart-home-management-concept/">smart home</a> systems.</p>



<p class="wp-block-paragraph">Our Xamarin team was responsible for the system architecture design, development, quality assurance and automated testing. They successfully created and launched the IoT mobile application.</p>



<h2 class="wp-block-heading">Making a Mobile Choice</h2>



<p class="wp-block-paragraph">Developing mobile applications with Xamarin makes programming more efficient and cost-effective while maintaining all native apps’ features. But this is not a “one size fits all” solution.</p>



<p class="wp-block-paragraph">In many cases, we have found Xamarin to be a successful tool that dramatically cuts both creation- and maintenance-related costs due to a sharable codebase without compromising quality. So, we see it as a potential game-changer for many.</p>



<p class="wp-block-paragraph">Still, Android and iOS continue to rule the mobile industry, and you have to weigh the pros and cons of native vs. cross-platform development when choosing the fastest, cheapest and most efficient way to build your solution.</p>



<p class="wp-block-paragraph">Specialists at SaM Solutions have in-depth experience in creating both native and cross-platform mobile apps. We are a reliable partner, so don’t hesitate to contact us for a detailed discussion of your future project.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sam-solutions.com/blog/xamarin-cross-platform-development/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[TechSpeak] Azure Pipelines: Using It for Xamarin Apps and Configuring a Local Agent</title>
		<link>https://sam-solutions.com/blog/azure-pipelines-using-it-for-xamarin-apps-and-configuring-a-local-agent/</link>
					<comments>https://sam-solutions.com/blog/azure-pipelines-using-it-for-xamarin-apps-and-configuring-a-local-agent/#respond</comments>
		
		<dc:creator><![CDATA[Andrei Tarasevich]]></dc:creator>
		<pubDate>Thu, 18 Jul 2019 14:26:08 +0000</pubDate>
				<guid isPermaLink="false">https://sam-solutions.de/?post_type=article&#038;p=431</guid>

					<description><![CDATA[Creating a Xamarin app implies the development of a common logic for several platforms, which is quite convenient, but may cause some troubles as well. In this article, I will tell you how you can easily configure a part of continuous integration and continuous delivery (CI/CD)&#160;while engaged in cross-platform development with the help of Azure [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Creating a Xamarin app implies the development of a common logic for several platforms, which is quite convenient, but may cause some troubles as well.</p>



<p class="wp-block-paragraph">In this article, I will tell you how you can easily configure a part of continuous integration and continuous delivery (CI/CD)&nbsp;while engaged in <a href="/services/mobile-and-web-app/cross-platform-app-development/">cross-platform development</a> with the help of Azure Pipelines. You will also learn how to build projects on your local machines instead of Microsoft-hosted agents.</p>



<span id="more-431"></span>



<div class="cta">
<p>Start building your brand’s mobile app today with our expert-level mobile engineering team</p>
<p><a class="cta-button" href="/contacts/?utm_source=cta_blog&amp;utm_medium=cta_banner&amp;utm_campaign=cta&amp;utm_term=post">Contact us</a></p>
</div>



<h2 class="wp-block-heading">Why Build a Xamarin App with Azure Pipelines?</h2>



<p class="wp-block-paragraph"><a href="https://docs.microsoft.com/en-us/xamarin/" target="_blank" rel="nofollow noopener noreferrer">Xamarin</a> is a framework for cross-platform <a href="/services/mobile-and-web-app/" target="_blank" rel="noreferrer noopener">mobile app development</a> that targets Android, iOS and Windows using C#, <a href="/services/technologies/dot_net/">.NET</a> and Visual Studio. Xamarin allows a large portion of code to be shared between platforms, with only a small percentage that needs to be platform-specific.</p>



<div style="background-color: #cbe5f7;width: 97.8921%;padding: 5px;padding-bottom: 8px">
<p style="width: 100%"><strong>Read also: <a href="/blog/xamarin-cross-platform-development/" target="_blank" rel="noopener noreferrer">Why Use Xamarin for Cross-Platform Development</a></strong></p>
</div>



<p class="wp-block-paragraph">Imagine this situation: you’ve implemented some changes for the <a href="/services/mobile-and-web-app/ios-application-development-services/">iOS</a> part, but they have disrupted something in the <a href="/services/mobile-and-web-app/android-development-services/">Android</a> part, and you can’t even launch it. Of course, separate compilation and testing of several solutions are possible, but it would be time-consuming.</p>



<p class="wp-block-paragraph">So, the best way out is to use <a href="https://azure.microsoft.com/en-us/services/devops/pipelines/" target="_blank" rel="nofollow noopener noreferrer">Azure Pipelines</a> — a cloud service that allows you to automatically build and test several jobs in parallel and make them available to other users. This option is quick, easy and safe.</p>



<p class="wp-block-paragraph">In simple words, I push changes to the branch and then observe in Azure how the builds are compiling. If I see that the build for iOS is done, and the build for Android failed (a red icon), I understand that there is an issue and can immediately fix it.</p>



<h2 class="wp-block-heading">Instruction for Azure Pipelines Configuration</h2>



<p class="wp-block-paragraph">To use Azure Pipelines, you need to have:</p>



<ul class="wp-block-list">
<li>A Microsoft account</li>



<li>An organization in Azure <a href="/services/software-engineering/devops-as-a-service/">DevOps</a></li>



<li>Your source code stored in a version control system</li>
</ul>



<p class="wp-block-paragraph">For the first step, sign in to your Azure DevOps organization and navigate to your project. From the left menu select <i>Pipelines</i>, then click <i>New</i> button and select <i>New build pipeline</i>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="555" height="510" src="https://sam-solutions.com/wp-content/uploads/Image1.png" alt="Azure-pipelines-photo" class="wp-image-7256"/></figure>
</div>


<p class="wp-block-paragraph">Select the <i>Version control system</i> and the necessary repository.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="574" height="467" src="https://sam-solutions.com/wp-content/uploads/Image-2.png" alt="Azure-Pipelines-Xamarin-photo" class="wp-image-7258"/></figure>
</div>


<p class="wp-block-paragraph">On the <i>Configure </i>step, you can select <i>Starter pipeline </i>(to start with a minimal pipeline) or <i>Xamarin.Android\Xamarin.iOS</i> (to start with minimal logic of building a Xamarin Android\iOS project). Let’s choose <i>Xamarin.Android.</i> It generates the following YAML file:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: powershell; title: ; notranslate">
#Xamarin.Android
#Build a Xamarin.Android project.
#Add steps that test, sign, and distribute an app, save build artifacts, and more:
#https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin

trigger:
master

pool:
vmImage: &#039;macos-latest&#039;

variables:
buildConfiguration: &#039;Release&#039;
outputDirectory: &#039;$(build.binariesDirectory)/$(buildConfiguration)&#039;

steps:
- task: NuGetToolInstaller@0

- task: NuGetCommand@2
inputs:
restoreSolution: &#039;**/*.sln&#039;

- task: XamarinAndroid@1
inputs:
projectFile: &#039;**/*droid*.csproj&#039;
outputDirectory: &#039;$(outputDirectory)&#039;
configuration: &#039;$(buildConfiguration)&#039;
</pre></div>


<p class="wp-block-paragraph">Let’s briefly take a look at it and fix some lines:</p>



<ul class="wp-block-list">
<li>Trigger (as the name suggests) works on a push to specific branches. In the code above, the build will start only when we push something to the master branch.</li>



<li>Pool is an agent pool on which build will run; by default, it uses Azure Agents Pool. (Later in the article I will describe how to configure your own pool on your local machine).</li>



<li>Next, we can pass some variables. For example, build configuration and output directory.</li>



<li>In the section <i>steps</i>, we start working with our project. We install NuGet (NuGetToolInstaller@0), install and update packages (NuGetCommand@2) and Build Xamarin Android project (XamarinAndroid@1).</li>
</ul>



<p class="wp-block-paragraph">After some changes the file looks like this:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: powershell; title: ; notranslate">
#https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin

pool:
vmImage: &#039;macos-latest&#039;
variables:
 buildConfiguration: &#039;Release&#039;
outputDirectory: &#039;$(build.binariesDirectory)/$(buildConfiguration)&#039;
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
 inputs:
restoreSolution: &#039;**/HelloWorld.Droid.sln&#039;
- task: XamarinAndroid@1
 inputs:
projectFile: &#039;**/HelloWorld.Droid.csproj&#039;
outputDirectory: &#039;$(outputDirectory)&#039;
configuration: &#039;$(buildConfiguration)&#039;
</pre></div>


<p class="wp-block-paragraph">Click <i>Save</i> and <i>Run</i>. The build pipeline is created and automatically starts building.</p>



<p class="wp-block-paragraph">You can find more information about the Android part <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/xamarin-android?view=azure-devops" rel="nofollow noopener" target="_blank">here</a>.</p>



<p class="wp-block-paragraph">Now we need to create an iOS build. There are two possible approaches:</p>



<ul class="wp-block-list">
<li>Create a separate build pipeline</li>



<li>Add another job inside the current pipeline</li>
</ul>



<p class="wp-block-paragraph">The difference is that if we have two separate builds, we can run them in parallel. But for the first variant, we need another agent. Just repeat steps described above, but choose Xamarin.iOS on the Configure step.</p>



<p class="wp-block-paragraph">For the second variant (another job in one pipeline file), edit our Azure Pipeline file according to the screenshot below:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: powershell; title: ; notranslate">
jobs:
- job: Android
 pool:
vmImage: &#039;vs2017-win2016&#039;
 variables:
buildConfiguration: &#039;Release&#039;
outputDirectory: &#039;$(build.binariesDirectory)/$(buildConfiguration)&#039;
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: &#039;**/HelloWorld.Droid.sln&#039;
- task: XamarinAndroid@1
inputs:
projectFile: &#039;**/HelloWorld.Droid.csproj&#039;
outputDirectory: &#039;$(outputDirectory)&#039;
configuration: &#039;$(buildConfiguration)&#039;

- job: iOS
 pool:
 vmImage: &#039;macos-latest&#039;
 variables:
 buildConfiguration: &#039;Release&#039;
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: &#039;4.3.0&#039;
- task: NuGetCommand@2
inputs:
restoreSolution: &#039;**/HelloWorld.iOS.sln&#039;
- task: XamariniOS@2
inputs:
solutionFile: &#039;**/HelloWorld.iOS.csproj&#039;
configuration: &#039;$(buildConfiguration)&#039;
buildForSimulator: true
packageApp: false
</pre></div>


<p class="wp-block-paragraph">You can find more information about the iOS part <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/xamarin-ios?view=azure-devops" rel="nofollow noopener" target="_blank">here</a>.</p>



<p class="wp-block-paragraph">Click <i>Save </i>and go to Pipelines &#8211; Builds. It’s automatically started. Now we can see the building process of our solution. It’s separate for two jobs (Android and iOS). If the job has a red status, it means that something has gone wrong. You can click on the failed job and expand the failed step to see full information about it. In my example, everything goes well and I can see the <i>Succeed</i> status.</p>



<figure class="wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img decoding="async" width="1619" height="462" data-id="7261" src="https://sam-solutions.com/wp-content/uploads/image3.png" alt="Azure-Pipelines-with-Xamarin-photo" class="wp-image-7261"/></figure>
</figure>



<h2 class="wp-block-heading">Steps to Configure the Local Agent on a Mac</h2>



<p class="wp-block-paragraph">If you want to run builds on your local machine or run two builds in parallel or save the results of your program (.ipa and .apk files for example), the best solution for you is to create your own self-hosted agent. Below, I described steps you should take to configure it yourself on your local machine.</p>



<h3 class="wp-block-heading">STEP 1</h3>



<p class="wp-block-paragraph">First of all, you need to generate a PAT (Personal Access Token). For this, go to <i>Azure DevOps</i> and click on your profile (in the upper right corner of the screen), then click on <i>Security</i>:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="603" height="375" src="https://sam-solutions.com/wp-content/uploads/image4.png" alt="Azure-Pipelines-for-Xamarin-photo" class="wp-image-7263"/></figure>
</div>


<p class="wp-block-paragraph">Create a personal access token by clicking the <i>New Token</i> button. Enter the name, select expiration, for the scope select <i>Agent Pools</i> (read, manage) and make sure all the other boxes are cleared. Click <i>Create</i> and copy the token. You&#8217;ll use this token when you configure the agent.</p>



<h3 class="wp-block-heading">STEP 2</h3>



<p class="wp-block-paragraph">Now we should create the Agent Pool. For this, click <i>project settings</i> (in the lower left corner of the screen), select <i>Agent pools</i> and click the <i>Add pool</i> button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="622" height="337" src="https://sam-solutions.com/wp-content/uploads/Image5.png" alt="Xamarin-apps-with-Azure-Pipelines-photo" class="wp-image-7265"/></figure>
</div>


<p class="wp-block-paragraph">In the window that appears, enter a name and click <i>Create</i>. The Agent Pool is created. Now we should download and configure the agent on the machine.</p>



<div class="cta">
<p>Full-cycle mobile app development across all platforms, devices, and operating systems</p>
<p><a class="cta-button" href="/services/mobile-and-web-app/?utm_source=cta_blog&amp;utm_medium=cta_banner&amp;utm_campaign=cta&amp;utm_term=post">LEARN MORE</a></p>
</div>



<h3 class="wp-block-heading">STEP 3</h3>



<p class="wp-block-paragraph">To download the agent, select the pool you’ve just created from the list, then click <i>New Agent. </i>In the modal window select your OS (on which the agent will be located) and click<i> Download the agent</i>. It starts downloading.</p>



<p class="wp-block-paragraph">Unpack the agent into the directory of your choice. Then run <i>config.cmd</i>.</p>



<ul class="wp-block-list">
<li>When setup asks for your server URL, for Azure DevOps Services, answer <span style="color: #0000ff">https://dev.azure.com/{your-organization}.</span></li>



<li>When setup asks for your authentication type, click <i>Enter</i> (it will choose PAT). Then paste the PAT token you created into the command prompt window.</li>



<li>And finally, choose <i>run the agent as a service</i>.</li>
</ul>



<p class="wp-block-paragraph">After you finish configuring the agent, the console is closed automatically. To run the agent, open <i>run.cmd.&nbsp;</i></p>



<p class="wp-block-paragraph">To check your agent status, do the following:</p>



<ul class="wp-block-list">
<li>Go to your Azure DevOps portal</li>



<li>Then go to project settings</li>



<li>Select agent pools list</li>



<li>Select your pool</li>



<li>Finally, go to Agents tab</li>
</ul>



<p class="wp-block-paragraph">Our agent should be shown there and the status should be online.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="528" height="642" src="https://sam-solutions.com/wp-content/uploads/image6.png" alt="Xamarin-and-Azure-Pipelines-photo" class="wp-image-7267"/></figure>
</div>


<p class="wp-block-paragraph">Build should run automatically on your local machine when you push something to your repository.</p>



<p class="wp-block-paragraph">That’s all. Hope, this information is useful for your work.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sam-solutions.com/blog/azure-pipelines-using-it-for-xamarin-apps-and-configuring-a-local-agent/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
