Category: Article

Home / Category: Article

There are many reasons why you should download Xamarin.Forms 4.6 right now, but one is extremely important: without it you cannot publish new iOS apps on the app store anymore (UIView deprecated). Is this not enough? 🙂

So ok, let’s see what other new features we have in this new version.

Improved Shell Styling

Shell is a “quite” new feature of Xamarin.Forms that simplifies your app structure. Using it, you can have access to an “already cooked” tabbed navigation or Fly-out menu (use Shell and you’ll have an app and its navigation ready in 2 minutes). Xamarin.Forms 4.6 has improved the Shell styling making very easy to customise your navigation pages.

Navigating Back

Sometimes you don’t know your previous page so you don’t know where to go when the user presses the back button. Now you can co back with a vey easy and intuitive command:

await Shell.Current.GoToAsync("..");

Experimental Features

Thanks to an amazing open source community, Xamarin.Forms progresses really quickly. Sometime, they want to add new features but maybe the users are not fully ready for them, so they use an experimental flag.

To use a new feature you need to add to your App.xaml.cs the following constructor:

Device.SetFlags(new[] {
} );

Of course you want to add only the features you need in your app.


Should I really have to tell you what they are? Com on, you know what we are talking about. To be sure your radio buttons are part of the same group, you need to set the GroupName.

    <RadioButton GroupName="BestOne" Text="Android" />
    <RadioButton GroupName="BestOne" Text="iOS"/>
    <RadioButton GroupName="BestOne" Text="UWP"/>


How many times did you want to show and hide part of your page? Now with the Expander you can. This component shows/hides its content.

        <Label Text="My header"/>
    <Label Text="My content">

Easy? Yes, it is!

C# UI Extensions

This is something I personally don’t like as I prefer to write my UI in XAML, but anyway I’m sure thare are many people around that would love this new feature. If you like to write your UI in C#, then you’ll be very happy. This extension enables the use of the fluent syntax.

Font Embedding

This is an amazing feature. I love it as it makes very easy to use custom fonts in our Xamarin.Forms apps. To add a new font, add it as an Embedded Resource to you .netstandard project then in you assemblyInfo.cs file add this line:

[assembly: ExportFont("yourfont.ttf")]

Just remember to replace “yourfont” with your font filename 🙂

then you just have to set the fontfamily every time you want to use that font. For example if we want to set a font for every label in our app we can create a style like this:

<Style TargetType="Label">
    <Setter Property="FontFamily" Value="MyFontName"/>


I’ve tested the new version of Xamarin.Forms and I’ve found few things very useful.I think that you should really upgrade your app to Xamarin.Forms 4.6.

Have you tried this version and you are happy or have issues with it? Let me know your experience in the comments!

Do you need the link to download it? Here you go: nuget Xamarin.Forms

Happy Xamarin Coding!

Xamarin eXpert is proud to present you a new amazing tool to create the icons for your apps for free and with a single click of your mouse:

App icons generator

How it works

The app icons generator, allow to generate the icon for your app and all the icon set for the button, tabs and other UI components.

App icon

Drag your icon over the grey box with the text: “Drag and drop your icon here”. You will see a preview of your image. Now press the “Download” button to download your icons.

After extracting the zip file, you can simply copy the Android icons in your Android project and the iOS icons in your iOS project. The iOS icons contain also the Contents.json file so if you copy the icons and this file inside your Assets.xcassets folder, Xamarin (or xcode) will automatically recognize all the icons for the different sizes (so cool!).

Thanks to, the process of creating the icons for your Android and iOS project will take only few seconds.

Icon Set allows you to generate also the icons for your UI elements (buttons, tabs…). As you know, you shouldn’t have a single size icon but you should have different sizes according to the phone/tablet screen. In android you should create 5 icons for each image and they should go under these folder:

  • drawable-mdpi,
  • drawable- hdpi,
  • drawable- xhdpi,
  • drawable- xxhdpi,
  • drawable- xxxhdpi.

Under iOS, you should have 3 icons for each image with the names written with this logic:

The process can be quite laborious and long but thanks to, it will require just few seconds.

Drag your icon over the grey box with the text: “Drag and drop your icon here”. You will see a preview of your image. If you want you can change the name of your icons. Now press the “Download” button to download your icons. In just a second you will have all the 8 icons resized for your Android and iOS project.

all for FREE…

Yes, it’s right…the tool is completely free. Use it as mush as you like, for all the times you need.

If you want, it would be nice if you could share this article and talk about

Then, if you feel generous, you can buy me a coffee going here: Buy me a coffee.

If you need help to use the tool, or you have suggestions to improve it, write a comment here or send me an e-mail.

Thank you for your support.

On September 2013 I released Safe Photo a native application for Android that allows you to hide pictures on your phone.

The app was quite successful with over 100.000 downloads and an impressive rating of 4.1.

During these years I’ve stopped to write native apps to concentrate entirely on Xamarin. So the logic consequence of that is that I’ve now created a new version of the app with Xamarin.Forms: Safe Photo 2.

Get it on Google Play
Get the app on Google Play Store

The idea behind the app is always the same: Safe Photo 2 will allow you to hide your secret pictures behind the security of the app.


  • Protect the photos on your smartphone or tablet
  • Take new photos directly from the application, they will be protected automatically
  • Import photos from the public gallery (then delete them from the public gallery)
  • Protect your privacy with a numeric password
  • Organise your photos in galleries
  • Share your photos with whoever you want and how you want
  • The application can run on an external memory card so you will not consume the internal memory of your smartphone
  • Your photos are invisible also connecting the phone to a PC
  • Delete one or more images or galleries in one click
  • Compatible with smartphones and tablets
  • And it’s free


Xamarin : How the app is made

To store all the data, Safe Photo 2 uses a SQLite database and of course the app uses the Sqlite Plugin For Xamarin And Windows (Nuget package).

The app also uses a Google Admob to show ads as banners and interstitials. As soon as possible I’ll create a package to easily add Admob to your Xamarin applications. If you prefer to write code yourself instead of using the plugin, I’ll also add a tutorial on how to add Admob on Xamarin.Android, Xamarin.iOS and Ads on UWP.

The app also uses some Dependency Services to execute some code on the native platforms. We use them to

  • Share a picture
  • Save, Copy and delete Files
  • Implement banners and interstitials for Admob

Do you want to know more about the app code or about Xamarin? Let me know and I’ll tell you more.

Have you seen how amazing are the Admob Rewarded video Ads? If you are creating a game or an app, the Rewarded Videos are something you should add to your app.

UPDATE: I’ve added on github the source code of a project to test this Admob plugin. You can find it here:

Do you think that are difficult to implement and it takes hours of your time? WRONG!

Thanks to my plugin MarcTron.Admob ( you can add Rewarded Videos with a single line of code!!!

Exactly!!! Install the MarcTron.Admob free plugin and in less than few seconds you can show Rewarded Videos in your Android and iOS apps!

HOW (It’s super easy!!!)

  • Install the MarcTron.Admob plugin in your projects (.netstandard, Android and iOS).
  • That’s it! No other things to do!!!

Now, if you want to show a rewarded video you just have to write this code:


Of course remember to replace the xxx with your video ID that you can find on your Google Admob page.


We all love events 🙂 If you love them as well. There are 7 events that you can use with Rewarde Videos:

OnRewarded                          When the user gets a reward
OnRewardedVideoAdClosed             When the ads is closed
OnRewardedVideoAdFailedToLoad       When the ads fails to load
OnRewardedVideoAdLeftApplication    When the users leaves the application
OnRewardedVideoAdLoaded             When the ads is loaded
OnRewardedVideoAdOpened             When the ads is opened
OnRewardedVideoStarted              When the ads starts


We have just seen how to add Rewarded Videos (with the plugin you can add Banners and Interstitials as well) in less than few seconds.

Basically it’s a dream 🙂 But it’s all TRUE!


Now here some links that you can use:

A detailed tutorial on how to use the plugin:

The nuget package link:

The bitbucket project site to report/view issues:

Github test project to try the plugin:

Have you ever dreamed to create a 3D game? Or maybe an Augmented Reality app? With Xamarin and UrhoSharp it couldn’t be easier.


The new UrhoSharp tutorial (with source code) is available here:


UrhoSharp is a lightweight Game Engine suitable for using with C# and F# to create games that run on Android, iOS, Mac, Windows and Unix. The game engine is available as a portable class library, allowing your game code to be written once and shared across all platforms. UrhoSharp is powered by Urho3D (, a game engine that has been under development for more than a decade.The idea is the same as Xamarin: you write your code once and your app will run on many different platforms. In this case:

  • Android
  • iOS
  • Mac
  • Windows (WPF and UWP so it will run also on Windows phones)
  • Unix

After several months of silence UrhoSharp has come back strongly with a new release (v.1.8.91) tha fixes many bugs and updates this extremely powerful engine.The biggest news are:

  • Updated to Urho3D 1.7
  • ARKit and ARCore components
  • Fixed major Android and iOS crashes
  • Optional DirectX11 backend for Windows
  • UWP 64bit support (and .NET Native toolchain)

The amazing thing is that with UrhoSharp you can create your 2D/3D games and also create amazing Augmented Reality apps thanks to support to ARKit (iOS) and ARCore (Android).

I’m writing a tutorial on how to use UrhoSharp and I’ll publish it here as soon as it ready.

Meanwhile you can find more info on the official Xamarin website:

For a beginner’s guide on how to create a Xamarin.Forms app you can read this tutorial:

Xamarin has a long story of problematic releases where new features comes along with numerous bugs.For this reason is possible that you are still using an old version of Xamarin.Forms.But today you will see why you should really upgrade to Xamarin.Forms 2.5

Layout Compression

Sometimes to create the UI we want, we need to add several layouts that are not visible but are needed as container for other components.As you can imagine, all these layouts come with a cost and you can see it especially on older Android devices.Layout compression helps us to solve this problem reducing the number of views to render.Consider this basic example:

<StackLayout Orientation="Horizontal"                  
        <Button Text="Yes"></Button>
        <Button Text="No"></Button>

We have a StackLayout that contains two buttons, the only reason to have this layout is to add the two buttons at the same height.Even if we don’t see the layout, having it in our Page has a cost.With the Layout Compression we can keep the StackLayout and remove its cost.To enable the compression of the StackLayout we need to add the codeCompressedLayout.IsHeadless="true"so the previous example will be:

<StackLayout Orientation="Horizontal"                  
        <Button Text="Yes"></Button>
        <Button Text="No"></Button>

Easy. Isn’t it? You can enable the Layout compression on: StackLayout, AbsoluteLayout, Grid, RelativeLayout.Because the compression removes the renderer for the layout, candidates for the compression are layouts that don’t have:

  • Background color
  • Gestures
  • Transformations
  • etc.

Layout Compression is available on iOS and Android.

Fast Renderers

Ok this is not entirely a new feature (they arrived on Xamarin.Forms 2.4) but it’s definitely a feature you shouldn’t miss.We love Xamarin but we also know that sometimes, especially on Android the performances are not really amazing.Fast Renderers for Android will improve performances on your Xamarin.Forms applications.As this is still an experimental feature, to enable them you need to add this line


to your MainActivity class before calling Forms.Init

I’ve personally tested Layout compression and Fast Renderers and I can confirm that there is a performance improvement especially on older Android devices so I really suggest you to use these features in your projects.

Forms Embedding

I have to tell you, I’m not particularly inclined to mix things so I prefer to keep separated Xamarin.Forms and native Xamarin projects.BUT…I can honestly see cases where you already have existing Xamarin.Forms pages and you want to use in other Xamarin iOS, Android or UWP projects.Thanks to the Forms Embedding now you can do it.

Improved macOS Desktop Support

In case you want to add macOS desktop support in your Xamarin.Forms apps 🙂

%d bloggers like this: