<?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/"
	>

<channel>
	<title>Marcofolio.net</title>
	<atom:link href="http://marcofolio.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://marcofolio.net/</link>
	<description></description>
	<lastBuildDate>Sat, 13 Jul 2024 08:05:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://marcofolio.net/wp-content/uploads/2017/07/cropped-dark-512-32x32.png</url>
	<title>Marcofolio.net</title>
	<link>https://marcofolio.net/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Presentation: Sustainable Software: May the Green Code Be with You [TEQnation]</title>
		<link>https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/</link>
					<comments>https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/#respond</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Sat, 13 Jul 2024 08:05:06 +0000</pubDate>
				<category><![CDATA[Green Software]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[green code]]></category>
		<category><![CDATA[green software]]></category>
		<category><![CDATA[sustainability]]></category>
		<category><![CDATA[sustainable software]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=738</guid>

					<description><![CDATA[<p>I&#8217;m thrilled to announce that the recording of my presentation at TEQnation is now available for you to watch! In this talk, I delve into the crucial and innovative field of Green Software Development, exploring how we can build more sustainable and eco-friendly software solutions. Here&#8217;s a glimpse of what you&#8217;ll learn: CSRD (Corporate Sustainability Reporting Directive): Understand the implications of CSRD and how it drives organizations towards more transparent and sustainable practices. The Green Software Foundation: Learn about the foundation&#8217;s mission and initiatives aimed at promoting greener software development across the industry. Energy Efficiency: Discover techniques to optimize software to consume less energy, thereby reducing its environmental footprint. Hardware Efficiency: Explore strategies to enhance hardware utilization, extending the life of devices and reducing electronic waste. Carbon Awareness: Gain insights into the importance of being carbon-aware in your software projects and the impact it has on our planet. Temporal Shifting: Learn about this innovative approach to scheduling computational tasks at times when renewable energy is more available. Demand Shifting: Understand how to manage and shift software demand to align with sustainable energy supply. GreenUX: Discover how user experience design can contribute to energy efficiency and sustainability. Measuring Carbon: Learn practical<a href="https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/">Presentation: Sustainable Software: May the Green Code Be with You [TEQnation]</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><iframe title="TEQnation 2024: Sustainable Software: May the Green Code Be with You - Marco Kuiper" width="960" height="540" src="https://www.youtube.com/embed/r8kKOuJ_oI0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>I&#8217;m thrilled to announce that the recording of my presentation at TEQnation is now available for you to watch! In this talk, I delve into the crucial and innovative field of Green Software Development, exploring how we can build more sustainable and eco-friendly software solutions.</p>
<p>Here&#8217;s a glimpse of what you&#8217;ll learn:</p>
<ul>
<li><strong>CSRD (Corporate Sustainability Reporting Directive)</strong>: Understand the implications of CSRD and how it drives organizations towards more transparent and sustainable practices.</li>
<li><strong><a href="https://greensoftware.foundation/" title="The Green Software Foundation">The Green Software Foundation</a></strong>: Learn about the foundation&#8217;s mission and initiatives aimed at promoting greener software development across the industry.</li>
<li><strong>Energy Efficiency</strong>: Discover techniques to optimize software to consume less energy, thereby reducing its environmental footprint.</li>
<li><strong>Hardware Efficiency</strong>: Explore strategies to enhance hardware utilization, extending the life of devices and reducing electronic waste.</li>
<li><strong>Carbon Awareness</strong>: Gain insights into the importance of being carbon-aware in your software projects and the impact it has on our planet.</li>
<li><strong>Temporal Shifting</strong>: Learn about this innovative approach to scheduling computational tasks at times when renewable energy is more available.</li>
<li><strong>Demand Shifting</strong>: Understand how to manage and shift software demand to align with sustainable energy supply.</li>
<li><strong>GreenUX</strong>: Discover how user experience design can contribute to energy efficiency and sustainability.</li>
<li><strong>Measuring Carbon</strong>: Learn practical methods for measuring the carbon footprint of your software to track and reduce its environmental impact.</li>
</ul>
<p>This presentation is packed with actionable insights and practical examples that will inspire you to integrate sustainability into your software development practices. Whether you&#8217;re a developer, designer, or a tech enthusiast, there&#8217;s something valuable for everyone.</p>
<h3>Slides</h3>
<div style="text-align: center;"><iframe style="border: 1px solid #CCC; border-width: 1px; margin-bottom: 5px; max-width: 100%;" src="https://www.slideshare.net/slideshow/embed_code/key/6RIjjwUecZNXU" width="641" height="534" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"> </iframe></div>
<p>Join me in exploring the future of Green Software Development and let&#8217;s work together towards a more sustainable digital world! Tell me what you think through <a title="Follow Marcofolio on X" href="http://x.com/marcofolio">X</a> or leave a comment below!</p>
<p>The post <a href="https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/">Presentation: Sustainable Software: May the Green Code Be with You [TEQnation]</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/teqnation-presentation-sustainable-software-green-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Fill Text with Images in Xamarin.Forms</title>
		<link>https://marcofolio.net/image-text-xamarin-forms/</link>
					<comments>https://marcofolio.net/image-text-xamarin-forms/#comments</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Tue, 07 Jul 2020 16:07:50 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[shapes]]></category>
		<category><![CDATA[xamarin.forms]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=711</guid>

					<description><![CDATA[<p>Filling text with images seems like an easy thing to do with tools like Photoshop, but can be a tedious task when developing it for mobile apps. I wanted to see if this was possible and got it working using the Experimental Xamarin.Forms Shapes. Read the steps below to learn how to fill text with images in Xamarin.Forms, or dive directly in the demo code on Github. The demo that I created is fully inspired by some retro games, can you name them all? I&#8217;ll give you a hint: they were part of the Pixels-movie as well. Answers can be found at the bottom of this post! Draw text from a Path First we&#8217;ll need to get the Path data from the font that we want to use. The Google font to SVG path converter is an excellent source to convert any Google Font to Path data. I selected the Press Start 2P-font since it has that retro vibe and is thick enough to keep the image visible. Simply fill in the text that you want to convert to Path data and the tool will generate it for you. Copy this data into your Xamarin.Forms application and use the Path-shape<a href="https://marcofolio.net/image-text-xamarin-forms/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/image-text-xamarin-forms/">How to Fill Text with Images in Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Filling text with images seems like an easy thing to do with tools like Photoshop, but can be a tedious task when developing it for mobile apps. I wanted to see if this was possible and got it working using the <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/internals/experimental-flags">Experimental</a> <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/"><strong>Xamarin.Forms Shapes</strong></a>. Read the steps below to learn how to fill text with images in Xamarin.Forms, or dive directly in the demo code on <a class="btn_post" title="Fill Text with Images in Xamarin.Forms" href="https://github.com/marcofolio/Arcade">Github</a>.</p>



<p>The demo that I created is fully inspired by some <a href="https://en.wikipedia.org/wiki/Retrogaming">retro games</a>, can you name them all? I&#8217;ll give you a hint: they were part of the <a href="https://www.imdb.com/title/tt2120120/">Pixels</a>-movie as well. Answers can be found at the bottom of this post!</p>



<h3 class="wp-block-heading">Draw text from a Path</h3>



<p>First we&#8217;ll need to get the Path data from the font that we want to use. The <strong><a href="https://danmarshall.github.io/google-font-to-svg-path/">Google font to SVG path converter</a></strong> is an excellent source to convert any <a href="https://fonts.google.com/">Google Font</a> to Path data. I selected the <a href="https://fonts.google.com/specimen/Press+Start+2P">Press Start 2P-font</a> since it has that retro vibe and is thick enough to keep the image visible.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="711" height="569" src="https://marcofolio.net/wp-content/uploads/2020/07/font.jpg" alt="" class="wp-image-721" srcset="https://marcofolio.net/wp-content/uploads/2020/07/font.jpg 711w, https://marcofolio.net/wp-content/uploads/2020/07/font-300x240.jpg 300w, https://marcofolio.net/wp-content/uploads/2020/07/font-500x400.jpg 500w" sizes="(max-width: 711px) 100vw, 711px" /></figure></div>



<p>Simply fill in the text that you want to convert to Path data and the tool will generate it for you. Copy this data into your Xamarin.Forms application and use the <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/path">Path-shape</a> do draw the character.</p>



<pre><code>
&lt;Path Fill=&quot;Black&quot;
    Data=&quot;M 25 87.5 L 0 87.5 L 0 62.5 L 12.5 62.5 L 12.5 50 L 25 50 L 25 37.5 L 12.5 37.5 L 12.5 25 L 0 25 L 0 0 L 25 0 L 25 25 L 37.5 25 L 37.5 37.5 L 50 37.5 L 50 25 L 62.5 25 L 62.5 0 L 87.5 0 L 87.5 25 L 75 25 L 75 37.5 L 62.5 37.5 L 62.5 50 L 75 50 L 75 62.5 L 87.5 62.5 L 87.5 87.5 L 62.5 87.5 L 62.5 62.5 L 50 62.5 L 50 50 L 37.5 50 L 37.5 62.5 L 25 62.5 L 25 87.5 Z&quot; /&gt;
</code></pre>



<p>This code will give you the following result:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="472" height="286" src="https://marcofolio.net/wp-content/uploads/2020/07/01-path.png" alt="" class="wp-image-719" srcset="https://marcofolio.net/wp-content/uploads/2020/07/01-path.png 472w, https://marcofolio.net/wp-content/uploads/2020/07/01-path-300x182.png 300w" sizes="auto, (max-width: 472px) 100vw, 472px" /></figure></div>



<p>You can repeat this process with all the other characters and change the font to your needs.</p>



<h3 class="wp-block-heading">Clip an Image using the Path</h3>



<p>Having a black background is pretty boring and you could easily use <a href="https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/">Embedded Fonts</a> if this is the goal that you want to achieve. We&#8217;ll spice it up by applying an image to this character. Or, in other words, get an image and only keep the Path data that represents the character.</p>



<p>We can achieve this by using the <a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.visualelement.clip">Clip property</a> of an Image. Passing along the Path data clips away the rest, resulting in text that has a background image!</p>



<pre><code>
&lt;Image HeightRequest=&quot;100&quot;
    Source=&quot;https://raw.githubusercontent.com/marcofolio/Arcade/master/_img/03-pacman.jpg&quot;
    Clip=&quot;M 25 87.5 L 0 87.5 L 0 62.5 L 12.5 62.5 L 12.5 50 L 25 50 L 25 37.5 L 12.5 37.5 L 12.5 25 L 0 25 L 0 0 L 25 0 L 25 25 L 37.5 25 L 37.5 37.5 L 50 37.5 L 50 25 L 62.5 25 L 62.5 0 L 87.5 0 L 87.5 25 L 75 25 L 75 37.5 L 62.5 37.5 L 62.5 50 L 75 50 L 75 62.5 L 87.5 62.5 L 87.5 87.5 L 62.5 87.5 L 62.5 62.5 L 50 62.5 L 50 50 L 37.5 50 L 37.5 62.5 L 25 62.5 L 25 87.5 Z&quot; /&gt;
</code></pre>



<p>The code above will produce the following output:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="472" height="286" src="https://marcofolio.net/wp-content/uploads/2020/07/02-clip.png" alt="" class="wp-image-718" srcset="https://marcofolio.net/wp-content/uploads/2020/07/02-clip.png 472w, https://marcofolio.net/wp-content/uploads/2020/07/02-clip-300x182.png 300w" sizes="auto, (max-width: 472px) 100vw, 472px" /></figure></div>



<h3 class="wp-block-heading">Bring it all together</h3>



<p>Now that we have that first character, we already got the core of this technique. We&#8217;ll need to add more characters for the complete text and I also added a Path behind the text to give it a little bit of a shadow.</p>



<pre><code>
&lt;!-- X --&gt;
&lt;AbsoluteLayout&gt;
    &lt;Path Fill=&quot;Black&quot; Margin=&quot;5, 5, 0, 0&quot;
            Data=&quot;M 25 87.5 L 0 87.5 L 0 62.5 L 12.5 62.5 L 12.5 50 L 25 50 L 25 37.5 L 12.5 37.5 L 12.5 25 L 0 25 L 0 0 L 25 0 L 25 25 L 37.5 25 L 37.5 37.5 L 50 37.5 L 50 25 L 62.5 25 L 62.5 0 L 87.5 0 L 87.5 25 L 75 25 L 75 37.5 L 62.5 37.5 L 62.5 50 L 75 50 L 75 62.5 L 87.5 62.5 L 87.5 87.5 L 62.5 87.5 L 62.5 62.5 L 50 62.5 L 50 50 L 37.5 50 L 37.5 62.5 L 25 62.5 L 25 87.5 Z&quot; /&gt;

    &lt;Image HeightRequest=&quot;100&quot;
            Clip=&quot;M 25 87.5 L 0 87.5 L 0 62.5 L 12.5 62.5 L 12.5 50 L 25 50 L 25 37.5 L 12.5 37.5 L 12.5 25 L 0 25 L 0 0 L 25 0 L 25 25 L 37.5 25 L 37.5 37.5 L 50 37.5 L 50 25 L 62.5 25 L 62.5 0 L 87.5 0 L 87.5 25 L 75 25 L 75 37.5 L 62.5 37.5 L 62.5 50 L 75 50 L 75 62.5 L 87.5 62.5 L 87.5 87.5 L 62.5 87.5 L 62.5 62.5 L 50 62.5 L 50 50 L 37.5 50 L 37.5 62.5 L 25 62.5 L 25 87.5 Z&quot;
            Source=&quot;https://raw.githubusercontent.com/marcofolio/Arcade/master/_img/03-pacman.jpg&quot; /&gt;
&lt;/AbsoluteLayout&gt;
</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="472" height="286" src="https://marcofolio.net/wp-content/uploads/2020/07/03-shadow.png" alt="" class="wp-image-717" srcset="https://marcofolio.net/wp-content/uploads/2020/07/03-shadow.png 472w, https://marcofolio.net/wp-content/uploads/2020/07/03-shadow-300x182.png 300w" sizes="auto, (max-width: 472px) 100vw, 472px" /></figure></div>



<p>Now repeat this process for all the characters, add a <a href="https://wallpapersafari.com/w/vPGKkM">fancy background</a> and make it look good. The complete result can be viewed in the <a href="https://github.com/marcofolio/Arcade/blob/master/Arcade/MainPage.xaml"><code>MainPage.xaml</code></a> . Since we&#8217;re working with Xamarin.Forms, the end-result will look pretty on both iOS &amp; Android!</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="417" height="547" src="https://marcofolio.net/wp-content/uploads/2020/07/image-text-android.jpg" alt="" class="wp-image-715" srcset="https://marcofolio.net/wp-content/uploads/2020/07/image-text-android.jpg 417w, https://marcofolio.net/wp-content/uploads/2020/07/image-text-android-229x300.jpg 229w, https://marcofolio.net/wp-content/uploads/2020/07/image-text-android-305x400.jpg 305w" sizes="auto, (max-width: 417px) 100vw, 417px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="472" height="582" src="https://marcofolio.net/wp-content/uploads/2020/07/image-text-ios.jpg" alt="" class="wp-image-716" srcset="https://marcofolio.net/wp-content/uploads/2020/07/image-text-ios.jpg 472w, https://marcofolio.net/wp-content/uploads/2020/07/image-text-ios-243x300.jpg 243w, https://marcofolio.net/wp-content/uploads/2020/07/image-text-ios-324x400.jpg 324w" sizes="auto, (max-width: 472px) 100vw, 472px" /></figure>
</div>
</div>



<h3 class="wp-block-heading">Conclusion &amp; Download</h3>



<p>Although the result might look pretty good, it does feel a bit like a hacky solution. Since the text isn&#8217;t real text, but rather images that are clipped down, screen readers won&#8217;t work. Another downside is that not all fonts can be used, where Xamarin.Forms gives Exceptions due to not being to able to parse all the data.</p>



<p>Just like the <a href="https://marcofolio.net/geometric-xamarin-forms-shapes/">Colorful Geometric Background sample</a>, I would not recommend to use this in production right now, but there might be prettier solutions in the future. Feel free to poke around in the code on <a class="btn_post" title="Fill Text with Images in Xamarin.Forms" href="https://github.com/marcofolio/Arcade">Github</a> and send me a PR if you have one! What do you think?</p>



<p>The following games were used in the demo. How many did you guess correctly?</p>



<ul class="wp-block-list"><li><a href="https://en.wikipedia.org/wiki/Tetris">Tetris</a></li><li><a href="https://en.wikipedia.org/wiki/Dig_Dug">Dig Dug</a></li><li><a href="https://en.wikipedia.org/wiki/Pac-Man">Pac-Man</a></li><li><a href="https://en.wikipedia.org/wiki/Donkey_Kong_(character)">Donkey Kong</a></li><li><a href="https://en.wikipedia.org/wiki/Mario">Mario</a></li><li><a href="https://en.wikipedia.org/wiki/Q*bert">Q*bert</a></li><li><a href="https://en.wikipedia.org/wiki/Breakout_(video_game)">Breakout</a></li></ul>



<p><em>All product names, logos, and brands are property of their respective owners.</em></p>
<p>The post <a href="https://marcofolio.net/image-text-xamarin-forms/">How to Fill Text with Images in Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/image-text-xamarin-forms/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Colorful Geometric Background using Xamarin.Forms Shapes</title>
		<link>https://marcofolio.net/geometric-xamarin-forms-shapes/</link>
					<comments>https://marcofolio.net/geometric-xamarin-forms-shapes/#respond</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Mon, 29 Jun 2020 05:39:42 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[shapes]]></category>
		<category><![CDATA[xamarin.forms]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=688</guid>

					<description><![CDATA[<p>Xamarin recently added new functionality for developers to build mobile apps: Xamarin.Forms Shapes. As the name suggest, it allows developers to create shapes without being restricted to rectangles or ellipses. At this time, this power is only unleashed when setting the &#8220;Shapes_Experimental&#8220;-flag but it has some great potential. I wanted to build something using Shapes and went looking for some design inspiration. Luckily, an old friend of mine helped me out without knowing it! The design is completely inspired by Chris Spooner from SpoonGraphics. His article &#8220;How to Create a Colourful Geometric Pattern in Illustrator&#8221; made me think &#8220;Hey, I can code this!&#8220;. I was lucky enough to interview this talented creative back in 2009 and I would still recommend you to follow him if you want the highest quality design tutorials and resources out there. Let&#8217;s get to it! The result Let&#8217;s start with the result in mind. The colorful geometric background will look like the sample you see on the left. Xamarin.Forms Shapes makes building this easy &#38; cross-platform usable without using any images! You can view the complete result on Github. All this background is, is a collection of triangles. Four of them make a square or<a href="https://marcofolio.net/geometric-xamarin-forms-shapes/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/geometric-xamarin-forms-shapes/">Colorful Geometric Background using Xamarin.Forms Shapes</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Xamarin recently added new functionality for developers to build mobile apps: <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/"><strong>Xamarin.Forms Shapes</strong></a>. As the name suggest, it allows developers to create shapes without being restricted to rectangles or ellipses. At this time, this power is only unleashed when setting the <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/internals/experimental-flags">&#8220;<code>Shapes_Experimental</code>&#8220;-flag</a> but it has some great potential. I wanted to build something using Shapes and went looking for some design inspiration. Luckily, an old friend of mine helped me out without knowing it!</p>



<p>The design is completely inspired by <a href="https://twitter.com/chrisspooner">Chris Spooner</a> from <a href="https://blog.spoongraphics.co.uk/">SpoonGraphics</a>. His article &#8220;<strong><a href="https://blog.spoongraphics.co.uk/tutorials/how-to-create-a-colourful-geometric-pattern-in-illustrator">How to Create a Colourful Geometric Pattern in Illustrator</a></strong>&#8221; made me think &#8220;<em>Hey, I can code this!</em>&#8220;. I was lucky enough to interview this talented creative <a href="http://old.marcofolio.net/reviews/discussing_blueprints_with_chris_spooner.html">back in 2009</a> and I would still recommend you to follow him if you want the highest quality design tutorials and resources out there. Let&#8217;s get to it!</p>



<h3 class="wp-block-heading">The result</h3>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="944" height="741" src="https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-iphone.png" alt="" class="wp-image-692" srcset="https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-iphone.png 944w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-iphone-300x235.png 300w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-iphone-768x603.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-iphone-510x400.png 510w" sizes="auto, (max-width: 944px) 100vw, 944px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>Let&#8217;s start with the result in mind. The colorful geometric background will look like the sample you see on the left. Xamarin.Forms Shapes makes building this easy &amp; cross-platform usable without using any images! You can view the complete result on <a class="btn_post" title="Colorful Geometric Background using Xamarin.Forms Shapes" href="https://github.com/marcofolio/Geometric">Github</a>.</p>



<p>All this background is, is a collection of triangles. Four of them make a square or block and when rotating a block, it creates this neat pattern. Let&#8217;s start drawing Shapes!</p>
</div>
</div>



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



<p>A <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/shapes/polygon"><strong>polygon</strong></a> is a shape where you define points to create a series of connected lines that form closed shapes. In other words, perfect to draw a triangle! Consider the following XAML:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>Start by drawing one triangle:</p>



<p><code>&lt;Polygon Points="0,0 90,0 45,45"</code><br>   <code>Fill="#E8E9B7" /&gt;</code></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="216" height="130" src="https://marcofolio.net/wp-content/uploads/2020/06/01_triangle.png" alt="" class="wp-image-696"/></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>We can now copy &amp; rotate the triangle to create a block:</p>



<p><code>&lt;Polygon Points="0,0 90,0 45,45"</code><br>   <code>Fill="#E8E9B7" /&gt;</code><br><code>&lt;Polygon Points="90,0 90,90 45,45"</code><br>   <code>Fill="#B0BAA4" /&gt;</code><br><code>&lt;Polygon Points="0,90 45,45 90,90"</code><br>   <code>Fill="#7A8992" /&gt;</code><br><code>&lt;Polygon Points="0,0 45,45 0,90"</code><br>   <code>Fill="#6D657E" /&gt;</code></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="208" height="206" src="https://marcofolio.net/wp-content/uploads/2020/06/02_block.png" alt="" class="wp-image-697" srcset="https://marcofolio.net/wp-content/uploads/2020/06/02_block.png 208w, https://marcofolio.net/wp-content/uploads/2020/06/02_block-150x150.png 150w, https://marcofolio.net/wp-content/uploads/2020/06/02_block-50x50.png 50w" sizes="auto, (max-width: 208px) 100vw, 208px" /></figure>
</div>
</div>



<p>Multiple rotated blocks create the pattern. We don&#8217;t need to rotate the actual block, but only the colors of the block need to be rotated. Here&#8217;s a sample in XAML on how to create two rotated blocks to start the pattern.</p>



<pre><code>
&lt;AbsoluteLayout&gt;
    &lt;Polygon Points="0,0 90,0 45,45" Fill="#E8E9B7" /&gt;
    &lt;Polygon Points="90,0 90,90 45,45" Fill="#B0BAA4" /&gt;
    &lt;Polygon Points="0,90 45,45 90,90" Fill="#7A8992" /&gt;
    &lt;Polygon Points="0,0 45,45 0,90" Fill="#6D657E" /&gt;
&lt;/AbsoluteLayout&gt;
&lt;AbsoluteLayout Margin="90,0,0,0"&gt;
    &lt;Polygon Points="0,0 90,0 45,45" Fill="#B0BAA4" /&gt;
    &lt;Polygon Points="90,0 90,90 45,45" Fill="#7A8992" /&gt;
    &lt;Polygon Points="0,90 45,45 90,90" Fill="#6D657E" /&gt;
    &lt;Polygon Points="0,0 45,45 0,90" Fill="#E8E9B7" /&gt;
&lt;/AbsoluteLayout&gt;
</code></pre>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://marcofolio.net/wp-content/uploads/2020/06/03_pattern.png" alt="" class="wp-image-698" width="107" height="58" srcset="https://marcofolio.net/wp-content/uploads/2020/06/03_pattern.png 386w, https://marcofolio.net/wp-content/uploads/2020/06/03_pattern-300x163.png 300w" sizes="auto, (max-width: 107px) 100vw, 107px" /></figure></div>



<h3 class="wp-block-heading">Generating the pattern</h3>



<p>We could just copy &amp; paste this XAML to fill the entire background of the application, but since you don&#8217;t know the exact size of the screen that would be a complete waste. This led me to converting the XAML to C# and create a <a href="https://github.com/marcofolio/Geometric/blob/master/Geometric/Block.cs">Block-class</a> that represents the block with the four triangles. The generation of all the blocks and colours are handled in the <a href="https://github.com/marcofolio/Geometric/blob/master/Geometric/MainPage.xaml.cs">MainPage</a>. I used <a href="https://docs.microsoft.com/en-us/xamarin/essentials/">Xamarin.Essentials</a> to determine te screen size and generate the blocks accordingly. Since everything is Xamarin, the result looks pretty good on both iOS &amp; Android!</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="944" height="842" src="https://marcofolio.net/wp-content/uploads/2020/06/result-ios.png" alt="" class="wp-image-701" srcset="https://marcofolio.net/wp-content/uploads/2020/06/result-ios.png 944w, https://marcofolio.net/wp-content/uploads/2020/06/result-ios-300x268.png 300w, https://marcofolio.net/wp-content/uploads/2020/06/result-ios-768x685.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/result-ios-448x400.png 448w" sizes="auto, (max-width: 944px) 100vw, 944px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="858" height="869" src="https://marcofolio.net/wp-content/uploads/2020/06/result-android.png" alt="" class="wp-image-702" srcset="https://marcofolio.net/wp-content/uploads/2020/06/result-android.png 858w, https://marcofolio.net/wp-content/uploads/2020/06/result-android-296x300.png 296w, https://marcofolio.net/wp-content/uploads/2020/06/result-android-768x778.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/result-android-395x400.png 395w, https://marcofolio.net/wp-content/uploads/2020/06/result-android-50x50.png 50w" sizes="auto, (max-width: 858px) 100vw, 858px" /></figure>
</div>
</div>



<p>Feel free to poke around in the code on <a class="btn_post" title="Colorful Geometric Background using Xamarin.Forms Shapes" href="https://github.com/marcofolio/Geometric">Github</a> to learn, experiment or improve on the code.</p>



<h3 class="wp-block-heading">Closing thoughts</h3>



<p>Overall I&#8217;m pretty satisfied with the result! It gives a more vibrant feel to the application and using no images makes the app size a lot smaller. Having said that, I would not recommend using this technique right now in production apps. Xamarin.Forms Shapes is currently Experimental and I notice a performance hit when the background is being generated. Also, on iOS it looks like there are some issues with rounding numbers since you&#8217;ll see very thin white lines between some of the blocks.</p>



<p>What do you think? If you know a fix for those white lines feel free to create a PR and let me know your thoughts in the comments!</p>



<div class="wp-block-image is-style-rounded"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="438" src="https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-1024x438.png" alt="" class="wp-image-691" srcset="https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-1024x438.png 1024w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-300x128.png 300w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-768x329.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background-934x400.png 934w, https://marcofolio.net/wp-content/uploads/2020/06/geometric-background.png 1128w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>Learn more about Xamarin.Forms Shapes:</p>



<ul class="wp-block-list"><li><a href="https://devblogs.microsoft.com/xamarin/xamarin-forms-4-7/">Shapes &amp; Paths</a> on Xamarin Blog</li><li><a href="https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/ShapesDemos">Shapes Demo on GitHub</a></li></ul>
<p>The post <a href="https://marcofolio.net/geometric-xamarin-forms-shapes/">Colorful Geometric Background using Xamarin.Forms Shapes</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/geometric-xamarin-forms-shapes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Commonly used code in Xamarin.UITest</title>
		<link>https://marcofolio.net/snippets-xamarin-uitest/</link>
					<comments>https://marcofolio.net/snippets-xamarin-uitest/#respond</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Tue, 16 Jun 2020 05:07:57 +0000</pubDate>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[uitest]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=663</guid>

					<description><![CDATA[<p>If you&#8217;re trying to create automated tests for your Xamarin app, you must have stumbled across Xamarin.UITest. It&#8217;s a great way to bring the quality of your application to the next level. Just make sure to apply the best practices when using Xamarin.UITest (especially the Page Object Pattern) otherwise your code can get messy really fast. But when everything is set up properly, you can automatically test your application through the UI on over 1000 devices using Visual Studio App Center! When creating a new app in Visual Studio, simply select the checkbox &#8220;Add an automated UI Test project&#8221; to add an UITest to your application. Now let&#8217;s see what kind of code or functionality I use from Xamarin.UITest to create useful tests! In this sample I&#8217;ll be using the following XAML code to create a very simple Xamarin.Forms (or Maui?) application with an input field that validates if the input is using only digits. Take special note of the usage of AutomationId, since we&#8217;ll be using it later. &#60;StackLayout Margin="20"&#62; &#60;Label Text="Only enter digits" /&#62; &#60;Entry AutomationId="entryDigits" /&#62; &#60;Button Text="Validate" /&#62; &#60;Label AutomationId="lblResult" IsVisible="false" /&#62; &#60;/StackLayout&#62; Using this simple example, we can also cover the most commonly used actions<a href="https://marcofolio.net/snippets-xamarin-uitest/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/snippets-xamarin-uitest/">Commonly used code in Xamarin.UITest</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;re trying to create automated tests for your Xamarin app, you must have stumbled across <strong><a href="https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/">Xamarin.UITest</a></strong>. It&#8217;s a great way to bring <a href="https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/">the quality of your application</a> to the next level. Just make sure to apply the <a href="https://devblogs.microsoft.com/xamarin/best-practices-tips-xamarin-uitest/">best practices</a> when using Xamarin.UITest (especially the Page Object Pattern) otherwise your code can get messy really fast. But when everything is set up properly, you can automatically test your application through the UI on over 1000 devices using <a href="https://appcenter.ms/">Visual Studio App Center</a>!</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:66.66%">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="653" src="https://marcofolio.net/wp-content/uploads/2020/06/new-app-1024x653.png" alt="" class="wp-image-669" srcset="https://marcofolio.net/wp-content/uploads/2020/06/new-app-1024x653.png 1024w, https://marcofolio.net/wp-content/uploads/2020/06/new-app-300x191.png 300w, https://marcofolio.net/wp-content/uploads/2020/06/new-app-768x490.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/new-app-627x400.png 627w, https://marcofolio.net/wp-content/uploads/2020/06/new-app.png 1182w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:33.33%">
<p>When creating a new app in Visual Studio, simply select the checkbox &#8220;<em>Add an automated UI Test project</em>&#8221; to add an UITest to your application. Now let&#8217;s see what kind of code or functionality I use from Xamarin.UITest to create useful tests!</p>
</div>
</div>



<p>In this sample I&#8217;ll be using the following XAML code to create a very simple Xamarin.Forms (or <a href="https://marcofolio.net/xamarin-maui/">Maui</a>?) application with an <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/entry">input field</a> that validates if the input is using only digits. Take special note of the usage of <code>AutomationId</code>, since we&#8217;ll be using it later.</p>



<pre><code>
&lt;StackLayout Margin="20"&gt;
    &lt;Label  Text="Only enter digits" /&gt;
    &lt;Entry  AutomationId="entryDigits" /&gt;
    &lt;Button Text="Validate" /&gt;
    &lt;Label  AutomationId="lblResult" IsVisible="false" /&gt;
&lt;/StackLayout&gt;
</code></pre>



<p>Using this simple example, we can also cover the most commonly used actions inside of many applications. These are:</p>



<ul class="wp-block-list"><li>Entering text in an Entry-field</li><li>Submitting a form using a Button</li><li>Validating results by checking the output</li></ul>



<p>Let&#8217;s see how these common tasks are handled in Xamarin.UITest!</p>



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



<p>First things first. We&#8217;ll need to learn about how Xamarin.UITest works with the <a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.queries.appquery.marked"><code>Marked</code></a>-method. This method allows us to search for elements in the UI that are Marked (hence the name) by passing on a <code>string</code>-value.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:33.33%">
<p>When we fire up the <a href="https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/working-with/repl">REPL</a> through <code>app.Repl()</code> and enter the <code>tree</code>-command, we can see how our simple application is built up. The <code>AutomationId</code> is translated to <code>label</code>, which we can use to automate. The <code>text</code>-value can also be used.</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:66.66%">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="690" height="365" src="https://marcofolio.net/wp-content/uploads/2020/06/repl.png" alt="" class="wp-image-675" srcset="https://marcofolio.net/wp-content/uploads/2020/06/repl.png 690w, https://marcofolio.net/wp-content/uploads/2020/06/repl-300x159.png 300w" sizes="auto, (max-width: 690px) 100vw, 690px" /></figure>



<p></p>
</div>
</div>



<p>We can simply pass along these values to the <code>Marked</code>-method to get the element that we want. For example, <code>"entryDigits"</code> would give us the input field while <code>"Validate"</code> would give us access to the Button. Sweet!</p>



<h4 class="wp-block-heading">Enter text</h4>



<p>We can now use the <a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.entertext"><code>EnterText</code></a>-method to add some text to the input field. The first parameter is the <code>Marked</code>-value and the second the value we&#8217;d like to add in the test.</p>



<pre><code>
var inputToValidate = "12345";
app.EnterText("entryDigits", inputToValidate);
</code></pre>



<p>Many times, I&#8217;d like to pair the <code>EnterText</code> with a <code><a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.cleartext">ClearText</a></code> up front to make sure the input field is empty.</p>



<h4 class="wp-block-heading">Press a button</h4>



<p>To press the button, we&#8217;ll be using the <a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.tap"><code>Tap</code></a>-method. The button can be accessed by the text so tapping it will be easy.</p>



<pre><code>
app.Tap("Validate");
</code></pre>



<h4 class="wp-block-heading">Validating results</h4>



<p>Now to validate the results. For this, I&#8217;d like to use the <a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.waitforelement"><code>WaitForElement</code></a>-method. Although we can manually check if the correct validation results are available, the <code>WaitForElement</code>-method allows us to pass along a timeout when the element doesn&#8217;t show up (for example, when network errors occur).</p>



<pre><code>
app.WaitForElement("lblResult", "Results didn't return");
var validationResult = app.Query("lblResult")[0].Text;
</code></pre>



<p>We can now use the <code>validationResult</code> in our test case to <code>Assert</code> the correct output value. These are the methods that I like to use most when testing Xamarin.Forms applications! Do you have others that you use often?</p>



<h3 class="wp-block-heading">Honorable mentions</h3>



<p>I didn&#8217;t want to finish the article without mentioning these methods that I use commonly, but not always.</p>



<ul class="wp-block-list"><li><a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.screenshot"><code>app.Screenshot</code></a> &#8211; Taking a screenshot of the current state of your application can be really useful, especially when using Visual Studio App Center.</li><li><a href="https://docs.microsoft.com/en-us/dotnet/api/xamarin.uitest.iapp.flash"><code>app.Flash</code></a> &#8211; Searching the right element in the UI can be hard. Inside the REPL, the Flash-method can help you validate if you have the correct element selected.</li><li><code><a href="https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/working-with/repl?tabs=vswin#using-the-copy-command">copy</a></code> &#8211; A command within the REPL to easily copy all the input in your terminal to your clipboard, for easy pasting back into the test.</li></ul>



<hr class="wp-block-separator"/>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="901" height="600" src="https://marcofolio.net/wp-content/uploads/2020/06/xamarin-month-code-snippets.png" alt="" class="wp-image-666" srcset="https://marcofolio.net/wp-content/uploads/2020/06/xamarin-month-code-snippets.png 901w, https://marcofolio.net/wp-content/uploads/2020/06/xamarin-month-code-snippets-300x200.png 300w, https://marcofolio.net/wp-content/uploads/2020/06/xamarin-month-code-snippets-768x511.png 768w, https://marcofolio.net/wp-content/uploads/2020/06/xamarin-month-code-snippets-601x400.png 601w" sizes="auto, (max-width: 901px) 100vw, 901px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>This post is my entry for <a href="https://luismts.com/code-snippetss-xamarin-month/"><strong>#XamarinMonth</strong></a>, an initiative by <a href="https://twitter.com/luismatosluna">Luis Matos</a>. The theme of this month is &#8220;<em>Xamarin Code Snippets</em>&#8220;, but since I&#8217;m not a fan of Snippets myself I focused on commonly used code you can turn in a snippet if you want to. Get more Xamarin Code Snippets by checking out the other entries too.</p>
</div>
</div>



<hr class="wp-block-separator"/>
<p>The post <a href="https://marcofolio.net/snippets-xamarin-uitest/">Commonly used code in Xamarin.UITest</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/snippets-xamarin-uitest/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Goodbye Xamarin, aloha Maui!</title>
		<link>https://marcofolio.net/xamarin-maui/</link>
					<comments>https://marcofolio.net/xamarin-maui/#comments</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Tue, 19 May 2020 20:35:34 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[maui]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=622</guid>

					<description><![CDATA[<p>The yearly Microsoft //Build/ conference is currently on its way and due to the current pandemic its being held as an Online conference. It&#8217;s the first time Microsoft held a conference of this size virtually and it&#8217;s great so far! The event made some interesting announcements today and I wanted to share my thoughts a personal big one: Xamarin will evolve and make place for Maui. Let&#8217;s first back up in time: just before the Xamarin Evolve conference took place in 2016, it was announced that Microsoft acquired Xamarin. This was a huge step forward for the Xamarin brand, but also raises the question on how Microsoft would adopt the platform. They promised the name would stay the same and for most of it, Microsoft has done a really good job at incorporating the people and tools into their ecosystem. Today, Microsoft announced their step forward towards the &#8220;Journey to one .NET&#8220;. One platform with all the tools developers need to build awesome software for all platforms. With that, .NET Multi-platform App UI is also introduced. The abbreviation for this framework is MAUI and will be used as Maui. Maui is essentially the next evolution of Xamarin.Forms but it&#8217;ll be<a href="https://marcofolio.net/xamarin-maui/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/xamarin-maui/">Goodbye Xamarin, aloha Maui!</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The yearly <a href="https://build.microsoft.com/">Microsoft //Build/</a> conference is currently on its way and due to the current pandemic its being held as an Online conference. It&#8217;s the first time Microsoft held a conference of this size virtually and it&#8217;s great so far! The event made some interesting announcements today and I wanted to share my thoughts a personal big one<strong>:</strong> Xamarin will evolve and make place for <strong>Maui</strong>.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="940" height="147" src="https://marcofolio.net/wp-content/uploads/2020/05/build-2020.jpg" alt="" class="wp-image-625" srcset="https://marcofolio.net/wp-content/uploads/2020/05/build-2020.jpg 940w, https://marcofolio.net/wp-content/uploads/2020/05/build-2020-300x47.jpg 300w, https://marcofolio.net/wp-content/uploads/2020/05/build-2020-768x120.jpg 768w" sizes="auto, (max-width: 940px) 100vw, 940px" /></figure>



<p>Let&#8217;s first back up in time: just before the Xamarin Evolve conference took place in 2016, it was announced that Microsoft acquired Xamarin. This was a huge step forward for the Xamarin brand, but also raises the question on how Microsoft would adopt the platform. They promised <a href="https://marcofolio.net/evolve-2016/">the name would stay</a> the same and for most of it, Microsoft has done a <em>really</em> good job at incorporating the people and tools into their ecosystem.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="300" height="300" src="https://marcofolio.net/wp-content/uploads/2020/05/dotnet-bot_branded.png" alt="" class="wp-image-643" srcset="https://marcofolio.net/wp-content/uploads/2020/05/dotnet-bot_branded.png 300w, https://marcofolio.net/wp-content/uploads/2020/05/dotnet-bot_branded-150x150.png 150w, https://marcofolio.net/wp-content/uploads/2020/05/dotnet-bot_branded-50x50.png 50w" sizes="auto, (max-width: 300px) 100vw, 300px" /></figure></div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>Today, Microsoft announced their step forward towards the <strong>&#8220;<a href="http://aka.ms/dotnetjourney">Journey to one .NET</a>&#8220;</strong>. One platform with all the tools developers need to build awesome software for all platforms.</p>



<p>With that, <strong>.NET Multi-platform App UI</strong> is also introduced. The abbreviation for this framework is MAUI and will be used as <strong>Maui</strong>.</p>
</div>
</div>



<p>Maui is essentially the next evolution of <a href="https://dotnet.microsoft.com/apps/xamarin/xamarin-forms">Xamarin.Forms</a> but it&#8217;ll be a lot more than just a rebrand. One of the most amazing things is that it has a <em>single project</em> from a <em>single codebase</em>. No more different heads for iOS and Android! Next to MVVM, Maui will also support the new and exciting <a href="https://thomasbandt.com/model-view-update">MVU (Model-View-Update)</a> design pattern, also known as <a href="https://guide.elm-lang.org/architecture/">The Elm Architecture</a>, and will get <a href="https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor">Blazor</a> support.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="940" height="464" src="https://marcofolio.net/wp-content/uploads/2020/05/single-project.jpg" alt="" class="wp-image-654" srcset="https://marcofolio.net/wp-content/uploads/2020/05/single-project.jpg 940w, https://marcofolio.net/wp-content/uploads/2020/05/single-project-300x148.jpg 300w, https://marcofolio.net/wp-content/uploads/2020/05/single-project-768x379.jpg 768w, https://marcofolio.net/wp-content/uploads/2020/05/single-project-810x400.jpg 810w" sizes="auto, (max-width: 940px) 100vw, 940px" /><figcaption>Single Project solution structure</figcaption></figure>



<p>Support for the <a href="https://docs.microsoft.com/en-us/dotnet/core/tools/">.NET CLI </a>will also be added, which means that start a project with a simple command: <code>dotnet new maui</code>. Namespaces will be upgraded as well, <code>Xamarin.Forms</code> will make place for <code>System.Maui</code>. <a href="https://docs.microsoft.com/en-us/xamarin/essentials/">Xamarin.Essentials</a> will also come along by moving to <code>System.Device</code>, completing the most important toolset for mobile .NET developers.</p>



<p>Where does it leave Xamarin.Native development (Xamarin.iOS &amp; Xamarin.Android)? Both will be incorporated into the .NET 6 Platform and renamed to <strong>.NET for iOS</strong> &amp; <strong>.NET for Android</strong> respectively. They&#8217;ll get CLI support as well: <code>dotnet new ios</code> &amp; <code>dotnet new android</code>, making development even faster.</p>



<div class="wp-block-columns has-2-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>Did you know Microsoft already name-dropped the term Maui in 2016? It was already prominently featured in a video from the HoloLens. Does this mean Maui will be available soon? Sadly, the answer is no, since we&#8217;ll have to wait until the .NET 6 release which is scheduled for November 2021 (previews will be available later in 2020).</p>



<p>Maui is open source, so you can easily follow the development progress on their <a href="https://github.com/dotnet/maui">Github repository</a>. They have <a href="https://github.com/dotnet/maui/wiki/Roadmap">their Roadmap</a> already shared. We&#8217;ll have to be patient before we can play with the new toys, but it looks very promising!</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="940" height="626" src="https://marcofolio.net/wp-content/uploads/2020/05/maui-2016.jpg" alt="" class="wp-image-629" srcset="https://marcofolio.net/wp-content/uploads/2020/05/maui-2016.jpg 940w, https://marcofolio.net/wp-content/uploads/2020/05/maui-2016-300x200.jpg 300w, https://marcofolio.net/wp-content/uploads/2020/05/maui-2016-768x511.jpg 768w, https://marcofolio.net/wp-content/uploads/2020/05/maui-2016-601x400.jpg 601w" sizes="auto, (max-width: 940px) 100vw, 940px" /><figcaption><a href="https://www.youtube.com/watch?v=MVXH5V8MVQo">HoloLens video from 2016</a></figcaption></figure>
</div>
</div>



<div class="wp-block-columns has-2-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="940" height="422" src="https://marcofolio.net/wp-content/uploads/2020/05/moana_maui.jpg" alt="" class="wp-image-626" srcset="https://marcofolio.net/wp-content/uploads/2020/05/moana_maui.jpg 940w, https://marcofolio.net/wp-content/uploads/2020/05/moana_maui-300x135.jpg 300w, https://marcofolio.net/wp-content/uploads/2020/05/moana_maui-768x345.jpg 768w, https://marcofolio.net/wp-content/uploads/2020/05/moana_maui-891x400.jpg 891w" sizes="auto, (max-width: 940px) 100vw, 940px" /><figcaption><a href="https://www.youtube.com/watch?v=79DijItQXMM">Maui from the Disney movie Moana</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>Personally, I&#8217;m really looking forward to these next steps. Although I&#8217;m sad we&#8217;re moving away from the Xamarin-name, but we also survived the Monodroid/MonoTouch rebrands. Maui does have a nice ring to it! I just hope they <a href="https://devblogs.microsoft.com/xamarin/top-xamarin-blog-posts-2019/">keep the monkeys</a> and move their conferences to <a href="https://en.wikipedia.org/wiki/Maui">Maui (Hawaii)</a>. There will be some challenging times ahead, like updates namespaces, upgrading from Xamarin.Forms (there will be a <a href="https://twitter.com/JamesMontemagno/status/1262789232554360832">try-convert tool</a>) and renaming Xamarin Meetup groups, but I&#8217;m sure we&#8217;ll manage. Like Maui from the Disney movie Moana says: &#8220;<em>It&#8217;s Maui, breathe it in</em>&#8220;.</p>
</div>
</div>



<p>What do you think about this rebrand? Is Microsoft moving towards the right direction? Let me know your thoughts in the comments. Read more:</p>



<ul class="wp-block-list"><li><a href="https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/">Introducing .NET Multi-platform App UI</a></li></ul>



<p><strong>Closing note:</strong> Even though Maui is still far away, Xamarin.Forms is still maintained and has some great features on its way! Check out their <a href="https://github.com/xamarin/Xamarin.Forms/wiki/Feature-Roadmap">Feature Roadmap</a> for upcoming functionality.</p>
<p>The post <a href="https://marcofolio.net/xamarin-maui/">Goodbye Xamarin, aloha Maui!</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/xamarin-maui/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Tiled image animations with Xamarin.Forms</title>
		<link>https://marcofolio.net/xamarin-tiled-image-animations/</link>
					<comments>https://marcofolio.net/xamarin-tiled-image-animations/#comments</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Thu, 04 Jul 2019 04:27:58 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[ffimageloading]]></category>
		<category><![CDATA[xamarin]]></category>
		<category><![CDATA[xamarin.forms]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=574</guid>

					<description><![CDATA[<p>One of the things I really like about web development, is the usage of the background-position CSS property. It allows you to move a background image around within its container. jFancyTile: A jQuery tile shifting image viewer plugin, realies heavily on this technique. Sadly, Xamarin doesn&#8217;t have a property like CSS that we can use out-of-the-box to recreate that effect. But, with some help of FFImageLoading, we can get the same results. In particular, the CropTransformation can crop away parts of an image so we can have some fun with each individual tile that makes up the complete image. So today, we&#8217;ll see how to build beautiful tiled image animations with Xamarin.Forms. You can view the source on Github if you directly want to dive into the code. Since it&#8217;s 4th of July, I&#8217;ve made sure the demos include some fireworks as well! Demo Let&#8217;s take a look at what we&#8217;ll be creating. The text and images for this demo are from PopOptiq, but can easily be changed to suit your needs. The concept The idea can be broken down into several steps: Split an image into sevaral tiles that together make up the complete image. The CropTransformation from FFImageLoading<a href="https://marcofolio.net/xamarin-tiled-image-animations/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/xamarin-tiled-image-animations/">Tiled image animations with Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>One of the things I really like about web development, is the usage of the <code><a href="https://css-tricks.com/almanac/properties/b/background-position/">background-position</a></code> CSS property. It allows you to move a background image around within its container. <a href="https://marcofolio.net/jfancytile-jquery-image-viewer/">jFancyTile</a>: A jQuery tile shifting image viewer plugin, realies heavily on this technique. Sadly, <a href="https://marcofolio.net/xamarin/">Xamarin</a> doesn&#8217;t have a property like CSS that we can use out-of-the-box to recreate that effect.</p>



<div class="wp-block-image"><figure class="alignleft is-resized"><img loading="lazy" decoding="async" src="https://marcofolio.net/wp-content/uploads/2019/07/small-1024x781.jpg" alt="" class="wp-image-612" width="225" height="171" srcset="https://marcofolio.net/wp-content/uploads/2019/07/small-1024x781.jpg 1024w, https://marcofolio.net/wp-content/uploads/2019/07/small-300x229.jpg 300w, https://marcofolio.net/wp-content/uploads/2019/07/small-768x586.jpg 768w, https://marcofolio.net/wp-content/uploads/2019/07/small-525x400.jpg 525w, https://marcofolio.net/wp-content/uploads/2019/07/small.jpg 1090w" sizes="auto, (max-width: 225px) 100vw, 225px" /></figure></div>



<p>But, with some help of <a href="https://github.com/luberda-molinet/FFImageLoading">FFImageLoading</a>, we can get the same results. In particular, the <code><a href="https://github.com/luberda-molinet/FFImageLoading/wiki/Transformations-Guide#croptransformation">CropTransformation</a></code> can crop away parts of an image so we can have some fun with each individual tile that makes up the complete image. So today, we&#8217;ll see <strong>how to build beautiful tiled image animations with <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/">Xamarin.Forms</a></strong>. You can view the source on <a class="btn_post" title="Tiled image animations on Github" href="https://github.com/marcofolio/TiledImageAnimations">Github</a> if you directly want to dive into the code. Since it&#8217;s <a href="https://en.wikipedia.org/wiki/Independence_Day_(United_States)">4th of July</a>, I&#8217;ve made sure the demos include some fireworks as well!</p>



<h2 class="wp-block-heading">Demo</h2>



<p>Let&#8217;s take a look at what we&#8217;ll be creating. The text and images for this demo are from <a href="https://www.popoptiq.com/types-of-fireworks/">PopOptiq</a>, but can easily be <a href="https://github.com/marcofolio/TiledImageAnimations/blob/master/Tiled/Data/FireworksDb.cs">changed</a> to suit your needs.</p>



<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Tiled image animations with Xamarin.Forms" width="960" height="720" src="https://www.youtube.com/embed/hE_VbweouA0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



<h3 class="wp-block-heading"> The concept</h3>



<p>The idea can be broken down into several steps:</p>



<ol class="wp-block-list"><li>Split an image into sevaral tiles that together make up the complete image. The <code><a href="https://github.com/luberda-molinet/FFImageLoading/wiki/Transformations-Guide#croptransformation">CropTransformation</a></code> from <a href="https://github.com/luberda-molinet/FFImageLoading/">FFImageLoading</a> will help us to create these tiles.</li><li> Use <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/animation/simple">Xamarin.Forms Animations</a> to individually animate the tiles.</li><li>Add some settings to switch the animations, as well as the tile size and tile count. We&#8217;ll use the <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/master-detail-page">Master-Detail</a> page to achieve this.</li></ol>



<p>Now that we have these steps, let&#8217;s dive into them!</p>



<h3 class="wp-block-heading">Splitting the image into tiles</h3>



<div class="wp-block-columns has-2-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p>When splitting an image, we need to use both <code>offset</code>-parameters (<code>x</code> and <code>y</code> parameter) for the <code>CropTransformation</code> from FFImageLoading. Depending on the size and location of the Tile, a different offset will be used. Dive into the <a href="https://github.com/marcofolio/TiledImageAnimations/blob/master/Tiled/Views/TileView.cs">TileView</a> to see how this offset can be calculated.</p>



<p>My colleagues <a href="https://twitter.com/youphulsebos">Youp</a> &amp; <a href="https://twitter.com/basdecort">Bas</a> helped me wrap my mind around this puzzle, but we managed to get it working. </p>



<p>Once we got all individual Tiles, we can start animating them to create a fun effect! All tiles together will still form the perfect image inside the <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/layouts/grid">Grid</a>.</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image"><img loading="lazy" decoding="async" width="500" height="499" src="https://marcofolio.net/wp-content/uploads/2019/07/grid.jpg" alt="" class="wp-image-597" srcset="https://marcofolio.net/wp-content/uploads/2019/07/grid.jpg 500w, https://marcofolio.net/wp-content/uploads/2019/07/grid-150x150.jpg 150w, https://marcofolio.net/wp-content/uploads/2019/07/grid-300x300.jpg 300w, https://marcofolio.net/wp-content/uploads/2019/07/grid-401x400.jpg 401w, https://marcofolio.net/wp-content/uploads/2019/07/grid-50x50.jpg 50w" sizes="auto, (max-width: 500px) 100vw, 500px" /></figure>
</div>
</div>



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



<p>Xamarin has some very useful and easy <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/animation/simple">Simple Animations</a>. I&#8217;ve used them before to <a href="https://marcofolio.net/xamarin-forms-animated-profile-cards/">create animated profile cards</a>. In this demo, I&#8217;ve created the following animations:</p>



<ul class="wp-block-list"><li><strong>Explode:</strong> Shatters the tiles in different directions</li><li><strong>Implode:</strong> Makes the tiles smaller</li><li><strong>Flip:</strong> Flip them left or right in 3D</li><li><strong>Spin:</strong> Spin them left or right around their center point</li></ul>



<p>As you can imagine, loads of other different animations can be applied to these tiles.</p>



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



<p>To play around with the demo, I added some basic settings you can use. This will help find an ideal situation for your Tiled animations.</p>



<ul class="wp-block-list"><li>The <strong>Tile Size</strong> is the value for both the height and width of each tile. You can calculate this dynamically based on the screen size, but for now it&#8217;s fixed in the configuration.</li><li>The <strong>Tile Count</strong> is the number of tiles in each row or column. Take note that this number shouldn&#8217;t be too high due to performace issues.</li><li>The selection of <strong>Animation Style</strong> is created to switch different kind of animations. You can easily add new ones as well by updating the <code><a href="https://github.com/marcofolio/TiledImageAnimations/blob/master/Tiled/Views/TiledImageView.cs">TiledImageView</a></code>!</li></ul>



<h3 class="wp-block-heading">Conclusion &amp; Download</h3>



<p>I think the demo does provide some interesting thoughts on how a different kind of animation for images can be made. It something different than you&#8217;d normally see on slideshows!</p>



<p>There are some things that I already want to point out to take into account:</p>



<ul class="wp-block-list"><li>On some scales, there&#8217;s a very small gap visible between the Tiles. I think it has to do with the way FFImageLoading Crops an image.</li><li>Although the demo works on both iOS and Android, iOS is the platform that produces the best results. This probably has to do with the way Android handles images.</li><li>By default, FFImageLoading caches the cropped image once it has been rendered for the first time. This means animations will be smoother the next time the same Tile is produced.</li></ul>



<p>Feel free to dive in the code on <a class="btn_post" title="Tiled image animations on Github" href="https://github.com/marcofolio/TiledImageAnimations">Github</a> and send me a Pull Request if you want to see things differently! What do you think of this idea and approach? Let me know in the comments.</p>



<hr class="wp-block-separator"/>



<div class="wp-block-media-text alignwide"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="860" height="360" src="https://marcofolio.net/wp-content/uploads/2019/06/xamuijuly-1.png" alt="" class="wp-image-581" srcset="https://marcofolio.net/wp-content/uploads/2019/06/xamuijuly-1.png 860w, https://marcofolio.net/wp-content/uploads/2019/06/xamuijuly-1-300x126.png 300w, https://marcofolio.net/wp-content/uploads/2019/06/xamuijuly-1-768x321.png 768w" sizes="auto, (max-width: 860px) 100vw, 860px" /></figure><div class="wp-block-media-text__content">
<p>This post is my entry for <strong><a href="https://www.thewissen.io/introducing-xamarin-ui-july/">#XamarinUIJuly</a></strong>, an initiative by <a href="https://twitter.com/devnl">Steven Thewissen</a>. Learn more about beautiful Xamarin UI by checking out the other entries too.</p>
</div></div>



<hr class="wp-block-separator"/>
<p>The post <a href="https://marcofolio.net/xamarin-tiled-image-animations/">Tiled image animations with Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/xamarin-tiled-image-animations/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Introducing: The Xamarin Security Scanner</title>
		<link>https://marcofolio.net/xamarin-security-scanner/</link>
					<comments>https://marcofolio.net/xamarin-security-scanner/#comments</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Mon, 10 Jun 2019 15:08:31 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[vulnerabilities]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=568</guid>

					<description><![CDATA[<p>If you like tools like SonarQube to continuously check your code quality and you’re a Xamarin developer that wants to make sure their app is secure, you’ll love the Xamarin Security Scanner. The Scanner finds security vulnerabilities by analysing the source code, also known as Static Application Security Testing (SAST). Xamarin Security Scanner on Github The Scanner is inspired by Quick Android Review Kit (QARK), a tool created by LinkedIn to look for several security related Android application vulnerabilities. Take note that the Scanner only finds security vulnerabilities in Xamarin.Android. Xamarin.Forms and Xamarin.iOS aren’t supported yet. The tool reports the following issues: Certificate validation overwritten Permissions may not be enforced Unsafe cipher mode used External storage is used Hardcoded HTTP URL found JavaScript enabled in WebView JavascriptInterface is added to a WebView Logging was found Access to phone number WorldReadable file found Backups are enabled App has debugging enabled App supports outdated Android version App contains a private key When the Scanner finds one (or more) of the above issues, it’ll provide you with a clear output on where you can find the issue. You can exclude certain vulnerabilities as well, if you supply a reason why you don’t think<a href="https://marcofolio.net/xamarin-security-scanner/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/xamarin-security-scanner/">Introducing: The Xamarin Security Scanner</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you like tools like <a href="https://www.sonarqube.org/">SonarQube</a> to continuously check your code quality and you’re a <a href="https://marcofolio.net/xamarin/">Xamarin developer</a> that wants to make sure their app is secure, you’ll love the <strong>Xamarin Security Scanner</strong>. The Scanner finds security vulnerabilities by analysing the source code, also known as Static Application Security Testing (<a href="https://www.gartner.com/it-glossary/static-application-security-testing-sast/">SAST</a>).</p>



<div style="text-align: center;"><a class="btn_post" title="Xamarin Security Scanner on Github" href="https://github.com/infosupport/xamarin-security-scanner">Xamarin Security Scanner on Github</a></div>



<p>The Scanner is inspired by Quick Android Review Kit (<a href="https://github.com/linkedin/qark">QARK</a>), a tool created by LinkedIn to look for several security related Android application vulnerabilities. Take note that the Scanner only finds security vulnerabilities in Xamarin.Android. Xamarin.Forms and Xamarin.iOS aren’t supported yet.</p>



<p>The tool reports the following issues:</p>



<ul class="wp-block-list"><li>Certificate validation overwritten</li><li> Permissions may not be enforced</li><li> Unsafe cipher mode used</li><li> External storage is used</li><li> Hardcoded HTTP URL found</li><li> JavaScript enabled in WebView</li><li> JavascriptInterface is added to a WebView</li><li> Logging was found</li><li> Access to phone number</li><li> WorldReadable file found</li><li> Backups are enabled</li><li> App has debugging enabled</li><li> App supports outdated Android version</li><li> App contains a private key</li></ul>



<p>
















When the Scanner finds one (or more) of the
above issues, it’ll provide you with a clear output on where you can find the
issue.



</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="149" src="https://marcofolio.net/wp-content/uploads/2019/06/screenshot-1024x149.png" alt="" class="wp-image-570" srcset="https://marcofolio.net/wp-content/uploads/2019/06/screenshot-1024x149.png 1024w, https://marcofolio.net/wp-content/uploads/2019/06/screenshot-300x44.png 300w, https://marcofolio.net/wp-content/uploads/2019/06/screenshot-768x112.png 768w, https://marcofolio.net/wp-content/uploads/2019/06/screenshot-940x137.png 940w, https://marcofolio.net/wp-content/uploads/2019/06/screenshot.png 1119w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>You can exclude certain vulnerabilities as well, if you supply a reason why you don’t think it makes your app vulnerable. The Scanner is created by <strong><a href="https://github.com/wesleydekraker">Wesley de Kraker</a></strong> under the supervision of <strong><a href="https://twitter.com/martijnhzbrk">Martijn Hazebroek</a></strong> as graduate intern of <a href="https://www.infosupport.com/">Info Support</a>.</p>



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
















Conclusion &amp; Download



</h3>



<div class="wp-block-media-text alignwide" style="grid-template-columns:18% auto"><figure class="wp-block-media-text__media"><img loading="lazy" decoding="async" width="381" height="339" src="https://marcofolio.net/wp-content/uploads/2019/06/logo.png" alt="" class="wp-image-571" srcset="https://marcofolio.net/wp-content/uploads/2019/06/logo.png 381w, https://marcofolio.net/wp-content/uploads/2019/06/logo-300x267.png 300w" sizes="auto, (max-width: 381px) 100vw, 381px" /></figure><div class="wp-block-media-text__content">
<p>The Scanner is a neat and simple way to do some basic security vulnerabilities checks for your Xamarin.Android apps. Right now, it only works with the source code but it would be great to work with packaged applications as well by decompiling it.</p>



<p>Also, the tool would be improved with Xamarin.Forms and .iOS support, as well as a plugin for <a href="https://marketplace.visualstudio.com/azuredevops">Azure DevOps</a> to include it in your pipeline. It has a lot of potential and makes life certainly easier for developers!</p>
</div></div>



<div style="text-align: center;"><a class="btn_post" title="Xamarin Security Scanner on Github" href="https://github.com/infosupport/xamarin-security-scanner">Xamarin Security Scanner on Github</a></div>



<p>Is the Scanner something you’d like to add to your projects? What improvements would you like to see? Let me know what you think in the comments and feel free to improve the code by creating a pull request.</p>
<p>The post <a href="https://marcofolio.net/xamarin-security-scanner/">Introducing: The Xamarin Security Scanner</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/xamarin-security-scanner/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Presentation: Turn specs into high quality apps [NDC Oslo]</title>
		<link>https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/</link>
					<comments>https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/#respond</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Mon, 17 Sep 2018 18:54:22 +0000</pubDate>
				<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[atdd]]></category>
		<category><![CDATA[specflow]]></category>
		<category><![CDATA[testcloud]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=557</guid>

					<description><![CDATA[<p>A while ago, I shared my presentation called “Turn specs into high quality apps” presented at the DevDayBE-conference. I&#8217;ve upgraded my talk with a great story as well as improved the overall presentation and held it at NDC Oslo. Today, I want to share the recording of that presentation. I&#8217;ve written already several articles here about ATDD/BDD with Specflow and Xamarin. During the presentation we&#8217;ll discuss the Three Amigo&#8217;s, how specifications are written using Gherkin and can be automated with Specflow and Xamarin.UITest. Will our hero Steve manage to get his beloved recipe for Red Velvet cake shared with the world? Let&#8217;s find out! The sample code can be found on Github. Enjoy! Slides I hope you liked the presentation and managed to get inspired. Look around on this blog to learn more about testing or Xamarin. Tell me what you think through Twitter or leave a comment below!</p>
<p>The post <a href="https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/">Presentation: Turn specs into high quality apps [NDC Oslo]</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A while ago, I shared my presentation called <a title="Presentation: Turn specs into high quality apps" href="https://marcofolio.net/presentation-specifications-quality-apps-specflow-testcloud/">“Turn specs into high quality apps”</a> presented at the <a title="DevDayBE" href="https://devday.be/">DevDayBE</a>-conference. I&#8217;ve upgraded my talk with a great story as well as improved the overall presentation and held it at <strong><a title="NDC Oslo" href="https://ndcoslo.com/">NDC Oslo</a></strong>. Today, I want to share the recording of that presentation. I&#8217;ve written already several articles here about <a title="ATDD is awesome and you should try it" href="http://marcofolio.net/awesome-atdd/">ATDD/BDD</a> with <a title="Automate your specs with SpecFlow and Xamarin.UITest" href="http://marcofolio.net/automate-specs-specflow-xamarin-uitest/">Specflow</a> and <a title="Interact with your app programmatically using Xamarin.UITest" href="http://marcofolio.net/interact-app-programmatically-xamarin-uitest/">Xamarin</a>.</p>
<p>During the presentation we&#8217;ll discuss the <a title="Three Amigo's" href="https://www.scrumalliance.org/community/articles/2013/2013-april/introducing-the-three-amigos">Three Amigo&#8217;s</a>, how specifications are written using <a title="Gherkin" href="https://github.com/cucumber/cucumber/wiki/Gherkin">Gherkin</a> and can be automated with <a title="Specflow" href="http://www.specflow.org/">Specflow</a> and <a title="Xamarin.UITest" href="https://developer.xamarin.com/guides/testcloud/uitest/">Xamarin.UITest</a>. Will our hero Steve manage to get his beloved recipe for Red Velvet cake shared with the world? Let&#8217;s find out!</p>
<p>The sample code can be found on <a class="btn_post" title="Samples on Github" href="https://github.com/marcofolio/RedVelvet">Github</a>. Enjoy!</p>
<h3>Slides</h3>
<div style="text-align: center;"><iframe loading="lazy" style="border: 1px solid #CCC; border-width: 1px; margin-bottom: 5px; max-width: 100%;" src="https://www.slideshare.net/slideshow/embed_code/key/9HJ4yI1cMMSKbS" width="641" height="534" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"> </iframe></div>
<p>I hope you liked the presentation and managed to get inspired. Look around on this blog to <a title="Testing on Marcofolio" href="https://marcofolio.net/testing/">learn more about testing</a> or <a title="Xamarin on Marcofolio" href="https://marcofolio.net/xamarin/">Xamarin</a>. Tell me what you think through <a title="Follow Marcofolio on Twitter" href="http://twitter.com/marcofolio">Twitter</a> or leave a comment below!</p>
<p>The post <a href="https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/">Presentation: Turn specs into high quality apps [NDC Oslo]</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/ndc-oslo-presentation-specifications-quality-apps-specflow-testcloud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Particle follower with CocosSharp and Xamarin.Forms</title>
		<link>https://marcofolio.net/particle-cocossharp-xamarin-forms/</link>
					<comments>https://marcofolio.net/particle-cocossharp-xamarin-forms/#comments</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Wed, 29 Aug 2018 12:15:00 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[cocossharp]]></category>
		<category><![CDATA[particles]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=547</guid>

					<description><![CDATA[<p>CocosSharp is a library for building 2D games using C# and F#. It is a .NET port of the popular Cocos2D engine. I wanted to play around with this library for a while and came up with a very simple demo to get a basic understanding of it. This demo shows how to create a Particle follower. Simply drag your finger across the screen and a particle explosion will occur! You can view the source on Github if you directly want to dive into the code. Otherwise, read on and learn how to build a particle follower using the CocosSharp 2D Game Engine and Xamarin.Forms to build a beautiful cross-platform app. The goal The goal is to create a neat particle follower that follows your fingers around on the phone when you touch it. Although it&#8217;s not very useful, it&#8217;s beautiful to look at and will help you get your first steps into development with CocosSharp. Play around with the source to change colors, speed and more! Getting started I&#8217;ll use Xamarin.Forms as starting point. Simply add the CocosSharp.Forms NuGet package to all Projects (iOS, Android and .NET Standard). Once we got that in place, let&#8217;s move on! Device specific<a href="https://marcofolio.net/particle-cocossharp-xamarin-forms/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/particle-cocossharp-xamarin-forms/">Particle follower with CocosSharp and Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a title="CocosSharp" href="https://docs.microsoft.com/en-us/xamarin/graphics-games/cocossharp/"><strong>CocosSharp</strong></a> is a library for building 2D games using C# and F#. It is a .NET port of the popular <a title="Cocos2D" href="http://www.cocos2d-x.org/">Cocos2D engine</a>. I wanted to play around with this library for a while and came up with a very simple demo to get a basic understanding of it.</p>
<p>This demo shows how to create a <strong>Particle follower</strong>. Simply drag your finger across the screen and a particle explosion will occur! You can view the source on <a class="btn_post" title="Particles on Github" href="https://github.com/marcofolio/Particles">Github</a> if you directly want to dive into the code. Otherwise, read on and learn how to build a particle follower using the CocosSharp 2D Game Engine and Xamarin.Forms to build a beautiful cross-platform app.</p>
<h3>The goal</h3>
<p><img loading="lazy" decoding="async" class="alignleft  wp-image-549" src="https://marcofolio.net/wp-content/uploads/2018/08/01.png" alt="" width="142" height="153" /></p>
<p>The goal is to create a neat particle follower that follows your fingers around on the phone when you touch it. Although it&#8217;s not very useful, it&#8217;s beautiful to look at and will help you get your first steps into development with CocosSharp.</p>
<p>Play around with the source to change colors, speed and more!</p>
<h3>Getting started</h3>
<p>I&#8217;ll use <a title="Xamarin.Forms" href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/">Xamarin.Forms</a> as starting point. Simply add the <a title="CocosSharp.Forms NuGet package" href="https://www.nuget.org/packages/CocosSharp.Forms/"><strong>CocosSharp.Forms NuGet package</strong></a> to all Projects (iOS, Android and .NET Standard).</p>
<p><img loading="lazy" decoding="async" class="aligncenter  wp-image-550" src="https://marcofolio.net/wp-content/uploads/2018/08/02.png" alt="" width="599" height="414" srcset="https://marcofolio.net/wp-content/uploads/2018/08/02.png 875w, https://marcofolio.net/wp-content/uploads/2018/08/02-300x207.png 300w, https://marcofolio.net/wp-content/uploads/2018/08/02-768x531.png 768w, https://marcofolio.net/wp-content/uploads/2018/08/02-579x400.png 579w" sizes="auto, (max-width: 599px) 100vw, 599px" /></p>
<p>Once we got that in place, let&#8217;s move on!</p>
<h3>Device specific variables</h3>
<p>First, we&#8217;ll need to determine the size of the screen so we&#8217;ll be able to use it later. Since that differs for each device, we&#8217;ll need to request the OS to pass along that value to Xamarin.Forms. Add the following to the <a title="App.xaml.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles/App.xaml.cs"><code>App.cs</code></a>-file.</p>
<pre><code>
public partial class App : Application {
    public static int Height { get; set; }
    public static int Width { get; set; }
    public static int Density { get; set; }
}
</code></pre>
<p>To fill these values, we&#8217;ll need to add them in the OS specific solutions. For iOS, this means changing the <a title="AppDelegate.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles.iOS/AppDelegate.cs"><code>AppDelegate.cs</code></a>.</p>
<pre><code>
public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
    App.Height = (int)UIScreen.MainScreen.Bounds.Height;
    App.Width = (int)UIScreen.MainScreen.Bounds.Width;
    App.Density = (int)UIScreen.MainScreen.Scale;
}
</code></pre>
<p>And for Android, we&#8217;ll need to update the <a title="MainActivity.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles.Android/MainActivity.cs"><code>MainActivity.cs</code></a>.</p>
<pre><code>
protected override void OnCreate(Bundle bundle) {
    var metrics = Resources.DisplayMetrics;
    App.Width = (int) metrics.WidthPixels / metrics.Density;
    App.Height = (int) metrics.HeightPixels / metrics.Density;
    App.Density = (int) metrics.Density;
}
</code></pre>
<p>Now that we got these values inside of Xamarin.Forms, we can move on!</p>
<h3>The view</h3>
<p>CocosSharp uses a <code>CCGameView</code> in order to work. We&#8217;ll wrap that inside of a Xamarin.Forms <code>ContentView</code>. I called this the <a title="ParticlesView.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles/ParticlesView.cs"><code>ParticlesView</code></a>.</p>
<pre><code>
public class ParticlesView : ContentView {
    ParticlesScene _scene;

    public ParticlesView() {
        var sharpView = new CocosSharpView {
            HorizontalOptions = LayoutOptions.FillAndExpand,
            VerticalOptions = LayoutOptions.FillAndExpand,
            ViewCreated = HandleViewCreated
        };
        Content = sharpView;
    }

    void HandleViewCreated(object sender, EventArgs e) {
        var ccGView = sender as CCGameView;
        if (ccGView != null) {
            ccGView.DesignResolution = new CCSizeI(App.Width, App.Height);
            _scene = new ParticlesScene(ccGView);
            ccGView.RunWithScene(_scene);
        }
    }
}
</code></pre>
<p>A couple of things that I&#8217;d like to point out:</p>
<ul>
<li><code>ViewCreated</code> &#8211; This is the event when the element is placed which we&#8217;ll use to draw the <code>CCGameView</code></li>
<li><code>DesignResolution</code> &#8211; Here you see why we need the <code>App.Width</code> and <code>App.Height</code> to determine the dimensions to draw on</li>
<li><code>RunWithScene</code> &#8211; CocosSharp uses a <code>CCScene</code> to run the application, which we&#8217;ll create in the next step</li>
</ul>
<h3>Add a scene with particles</h3>
<p>The scene is the piece of code that&#8217;ll actually draw the different particles on a <code>CCLayer</code>. Let&#8217;s see how the <a title="ParticlesScene.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles/ParticlesScene.cs"><code>ParticlesScene</code></a> looks like!</p>
<pre><code>
public class ParticlesScene : CCScene {
    CCLayer _layer;
    
    public ParticlesScene(CCGameView gameView) : base(gameView) {
        _layer = new CCLayer();
        this.AddLayer(_layer);
    }

    public void DrawParticle(CCPoint point) {
        var explosion = new CCParticleExplosion(CCPoint.Zero) {
            TotalParticles = 10,
            StartColor = new CCColor4F(CCColor3B.White),
            EndColor = new CCColor4F(CCColor3B.Black),
            Position = new CCPoint(point.X / App.Density, App.Height - point.Y / App.Density)
        };
        _layer.AddChild(explosion);
    }
}
</code></pre>
<p>The <code>DrawParticle</code>-method will be called later on to draw the particles. CocosSharp comes with a couple of built-in Particles, like <code>CCParticleFire</code> and <code>CCParticleSmoke</code>. In this demo, we&#8217;ll be using the <code><a title="CocosSharp.CCParticleExplosion Class" href="https://developer.xamarin.com/api/type/CocosSharp.CCParticleExplosion/">CCParticleExplosion</a></code> but you can play around with these values as well. Just play around with these variables do have more fun!</p>
<h3>Enable touch</h3>
<p>Update the <code>HandleViewCreated</code>-method of the <a title="ParticlesView.cs" href="https://github.com/marcofolio/Particles/blob/master/Particles/ParticlesView.cs"><code>ParticlesView</code></a> and add an <code>CCEventListenerTouchOneByOne</code> to enable listening to touch events. From here, we&#8217;ll call the <code>DrawParticle</code>-method.</p>
<pre><code>
_scene = new ParticlesScene(ccGView);
var touchEvent = new CCEventListenerTouchOneByOne();
touchEvent.OnTouchBegan = (touch, _event) =&gt; {
    _scene.DrawParticle(touch.LocationOnScreen);
    return true;
};
touchEvent.OnTouchMoved = (touch, _event) =&gt; {
    _scene.DrawParticle(touch.LocationOnScreen);
};
_scene.AddEventListener(touchEvent);
</code></pre>
<p>Finally, update the <a title="MainPage.xaml" href="https://github.com/marcofolio/Particles/blob/master/Particles/MainPage.xaml"><code>MainPage.xaml</code></a> to use the new view and you&#8217;re ready to go!</p>
<pre><code>
&lt;ContentPage xmlns:local="clr-namespace:Particles" x:Class="Particles.MainPage"&gt;
    &lt;StackLayout&gt;
        &lt;local:ParticlesView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /&gt;
    &lt;/StackLayout&gt;
&lt;/ContentPage&gt;
</code></pre>
<h3>Conclusion &amp; Download</h3>
<p>Although the sample is pretty simple, it gives me a basic understanding of CocosSharp. The outcome looks pretty good and is fun to play around with! Since the Android Emulator supports multi-touch, we can even check how amazing that looks.</p>
<p><img loading="lazy" decoding="async" class="aligncenter  wp-image-551" src="https://marcofolio.net/wp-content/uploads/2018/08/03.png" alt="" width="600" height="408" srcset="https://marcofolio.net/wp-content/uploads/2018/08/03.png 800w, https://marcofolio.net/wp-content/uploads/2018/08/03-300x204.png 300w, https://marcofolio.net/wp-content/uploads/2018/08/03-768x522.png 768w, https://marcofolio.net/wp-content/uploads/2018/08/03-588x400.png 588w, https://marcofolio.net/wp-content/uploads/2018/08/03-455x310.png 455w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>Take note there&#8217;s a discussion on where <a title="CocosSharp future?" href="https://forums.xamarin.com/discussion/62602/cocossharp-future">the future of CocosSharp</a> as well as <a title="The future of Cocos2d-x" href="https://discuss.cocos2d-x.org/t/the-future-of-cocos2d-x-c/42392/12">Cocos2d</a> is going. What do you think? Let me know in the comments or on <a title="Follow @marcofolio on Twitter" href="http://twitter.com/marcofolio">Twitter</a> and feel free to improve <a class="btn_post" title="Particles on Github" href="https://github.com/marcofolio/Particles">the code</a>.</p>
<p>Further reading:</p>
<ul>
<li><a title="Making It Snow! Xamarin.Forms and CocosSharp and Particles" href="https://codemilltech.com/making-it-snow-xamarin-forms-and-cocossharp-and-particles/">Making it snow!</a></li>
<li><a title="Particle Designer with CocosSharp" href="https://mikebluestein.com/2014/10/29/particle-designer-with-cocossharp/">Particle Designer with CocosSharp</a></li>
<li><a title="Xamarin Forms Particle System" href="https://baglabs.com/2016/04/29/xamarin-forms-particle-system/">Xamarin Forms Particle System</a></li>
</ul>
<p>The post <a href="https://marcofolio.net/particle-cocossharp-xamarin-forms/">Particle follower with CocosSharp and Xamarin.Forms</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/particle-cocossharp-xamarin-forms/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>First look at Xamarin.Essentials</title>
		<link>https://marcofolio.net/xamarin-essentials-first-look/</link>
					<comments>https://marcofolio.net/xamarin-essentials-first-look/#respond</comments>
		
		<dc:creator><![CDATA[Marco]]></dc:creator>
		<pubDate>Fri, 25 May 2018 11:51:06 +0000</pubDate>
				<category><![CDATA[Xamarin]]></category>
		<category><![CDATA[essentials]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[xamarin]]></category>
		<guid isPermaLink="false">https://marcofolio.net/?p=530</guid>

					<description><![CDATA[<p>Xamarin.Essentials was casually name-dropped by Miguel and James during their sessions at Build, without being officially announced. This might be because the bits are still in Preview and they&#8217;re still working on it, but it&#8217;s looking great already! Last week the first word was out, so let&#8217;s have a first look at Xamarin.Essentials. Originally called Caboodle, Xamarin.Essentials is a single library to access native platform features for iOS, Android, and UWP that works in traditional Xamarin and Xamarin.Forms apps. Before Essentials, you had to grab one or more of the many plugins from James Montemagno. Now we can access them through one, single codebase: Xamarin.Essentials. There is already some extensive documentation available so it&#8217;s easy to play around with. Getting started Here, I&#8217;ll use Xamarin.Forms as starting point but native Xamarin.iOS or Xamarin.Android will work as well. Simply add the Xamarin.Essentials NuGet package to all Projects (iOS, Android and .NET Standard). Since it&#8217;s currently in Preview, make sure you mark the Show pre-release packages checkbox in the Add Packages window. Once you got the package in place, there&#8217;s some additional stuff you have to do to get it working on Android. We&#8217;ll need to initialise Essentials in the MainActivity and<a href="https://marcofolio.net/xamarin-essentials-first-look/" class="more_link more_link_dots"> &#8230; </a></p>
<p>The post <a href="https://marcofolio.net/xamarin-essentials-first-look/">First look at Xamarin.Essentials</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>Xamarin.Essentials</strong> was casually name-dropped by <a title="Miguel de Icaza on Twitter" href="https://twitter.com/migueldeicaza">Miguel</a> and <a title="James Montemagno on Twitter" href="https://twitter.com/JamesMontemagno">James</a> during their sessions at <a title="Visual Studio and Xamarin at Microsoft Build 2018" href="https://marcofolio.net/visual-studio-xamarin-microsoft-build/">Build</a>, without being officially announced. This might be because the bits are still in <em>Preview</em> and they&#8217;re still working on it, but it&#8217;s looking great already! Last week <a title="Xamarin.Essentials: Cross-Platform APIs for Mobile Apps" href="https://blog.xamarin.com/xamarin-essentials-cross-platform-apis-mobile-apps/">the first word</a> was out, so let&#8217;s have a first look at Xamarin.Essentials.</p>
<p><img loading="lazy" decoding="async" class="aligncenter  wp-image-532" src="https://marcofolio.net/wp-content/uploads/2018/05/xam-essentials-overview-1024x579.png" alt="" width="580" height="328" srcset="https://marcofolio.net/wp-content/uploads/2018/05/xam-essentials-overview-1024x579.png 1024w, https://marcofolio.net/wp-content/uploads/2018/05/xam-essentials-overview-300x170.png 300w, https://marcofolio.net/wp-content/uploads/2018/05/xam-essentials-overview-768x434.png 768w, https://marcofolio.net/wp-content/uploads/2018/05/xam-essentials-overview-707x400.png 707w" sizes="auto, (max-width: 580px) 100vw, 580px" /></p>
<p>Originally called <em>Caboodle</em>, Xamarin.Essentials is a <em>single library</em> to access native platform features for iOS, Android, and UWP that works in traditional Xamarin and Xamarin.Forms apps. Before Essentials, you had to grab <a title="James Montemagno repositories" href="https://github.com/jamesmontemagno?tab=repositories">one or more of the many plugins</a> from James Montemagno. Now we can access them through one, single codebase: <a title="Xamarin.Essentials" href="https://github.com/xamarin/Essentials"><strong>Xamarin.Essentials</strong></a>. There is already some <a title="Xamarin.Essentials Documentation" href="https://docs.microsoft.com/en-us/xamarin/essentials/">extensive documentation</a> available so it&#8217;s easy to play around with.</p>
<h3>Getting started</h3>
<p>Here, I&#8217;ll use <a title="Xamarin.Forms" href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/">Xamarin.Forms</a> as starting point but native <a href="https://docs.microsoft.com/en-us/xamarin/#pivot=platforms&amp;panel=iOS">Xamarin.iOS</a> or <a href="https://docs.microsoft.com/en-us/xamarin/#pivot=platforms&amp;panel=Android">Xamarin.Android</a> will work as well. Simply add the <a title="Xamarin.Essentials NuGet package" href="https://www.nuget.org/packages/Xamarin.Essentials"><strong>Xamarin.Essentials NuGet package</strong></a> to all Projects (iOS, Android and .NET Standard). Since it&#8217;s currently in <em>Preview</em>, make sure you mark the <em>Show pre-release packages</em> checkbox in the <em>Add Packages</em> window.</p>
<p><img loading="lazy" decoding="async" class="aligncenter  wp-image-533" src="https://marcofolio.net/wp-content/uploads/2018/05/nuget-1024x662.png" alt="" width="600" height="388" srcset="https://marcofolio.net/wp-content/uploads/2018/05/nuget-1024x662.png 1024w, https://marcofolio.net/wp-content/uploads/2018/05/nuget-300x194.png 300w, https://marcofolio.net/wp-content/uploads/2018/05/nuget-768x497.png 768w, https://marcofolio.net/wp-content/uploads/2018/05/nuget-619x400.png 619w, https://marcofolio.net/wp-content/uploads/2018/05/nuget.png 1488w" sizes="auto, (max-width: 600px) 100vw, 600px" /></p>
<p>Once you got the package in place, there&#8217;s some additional stuff you have to do to get it working on Android. We&#8217;ll need to initialise Essentials in the <code>MainActivity</code> and also override the <code>OnRequestPermissionsResult</code> like so:</p>
<pre><code>
protected override void OnCreate(Bundle bundle)
{
    ...
    global::Xamarin.Forms.Forms.Init(this, bundle);
    Xamarin.Essentials.Platform.Init(this, bundle);
    ...
}

public override void OnRequestPermissionsResult(int requestCode, string[] permissions,
    [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
    Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
    base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
</code></pre>
<p>That&#8217;s all there is to it, we now can start using Xamarin.Essentials!</p>
<h3>Sample</h3>
<p><img loading="lazy" decoding="async" class="aligncenter  wp-image-534" src="https://marcofolio.net/wp-content/uploads/2018/05/sample.gif" alt="" width="300" height="503" /></p>
<p>I created a <em>very</em> simple sample app that allows you to send <a href="https://docs.microsoft.com/en-us/xamarin/essentials/sms">a SMS message</a> using Xamarin.Forms and Xamarin.Essentials. I created a very basic UI with two <code>Entry</code>-fields and one <code>Button</code> to submit. You can view the complete source on <a class="btn_post" title="XamSMS on Github" href="https://github.com/marcofolio/XamSMS">Github</a> to directly to dive into the code. But this is all it takes to send a SMS using Xamarin.Essentials:</p>
<pre><code>
private async void submitBtn_Clicked(object sender, EventArgs e)
{
    var message = messageEntry.Text;
    var recipient = recipientEntry.Text;

    var smsMessage = new SmsMessage(message, recipient);
    await Sms.ComposeAsync(smsMessage);
}
</code></pre>
<p>Simple and very straightforward! James wrote a <a title="Building mobile apps with Visual Studio and Xamarin" href="https://github.com/jamesmontemagno/app-compass">sample Compass-app</a> as well and <a href="https://channel9.msdn.com/Events/Build/2018/THR2415">demonstrated it at Build</a> to get even more info.</p>
<h3>Conclusion</h3>
<p><img loading="lazy" decoding="async" class="alignleft  wp-image-535" src="https://marcofolio.net/wp-content/uploads/2018/05/pre-release.png" alt="" width="248" height="79" srcset="https://marcofolio.net/wp-content/uploads/2018/05/pre-release.png 304w, https://marcofolio.net/wp-content/uploads/2018/05/pre-release-300x96.png 300w" sizes="auto, (max-width: 248px) 100vw, 248px" /></p>
<p>Even though Essentials is still in Preview, this is exactly what I wanted to have as a mobile developer. One package with all the cross-platform plugins in one place. I can&#8217;t wait for the package to be Stable, but it&#8217;s looking great so far! Don&#8217;t forget to check out my sample on <a class="btn_post" title="XamSMS on Github" href="https://github.com/marcofolio/XamSMS">Github</a>. <a title="Jim Bennett on Twitter" href="https://twitter.com/jimbobbennett">Jim Bennett</a> also <a title="Xamarin Essentials" href="https://www.jimbobbennett.io/xamarin-essentials/">wrote about Xamarin.Essentials</a>. What do you think of this library? What&#8217;s missing or would you like to see different? I can&#8217;t wait to see where this library will head to!</p>
<p>The post <a href="https://marcofolio.net/xamarin-essentials-first-look/">First look at Xamarin.Essentials</a> appeared first on <a href="https://marcofolio.net">Marcofolio.net</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marcofolio.net/xamarin-essentials-first-look/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
