Xamarin: Securing Your App with Touch ID

One of my favorite features of the iPhone is Touch ID, introduced by Apple with the release of the iPhone 5s a couple of years ago. Touch ID adds biometric authentication to your device so users can touch the home button to unlock their device instead of using a pin code. Since its initial release, […]

The post Securing Your App with Touch ID appeared first on Xamarin Blog.

Details

Gone Mobile: Episode 28: Behind the Scenes of Xamarin.Forms with Jason Smith

In this episode we’re talking about Xamarin.Forms again, but this time around it’s a bit different. We’re joined once again by Jason Smith, lead developer of Xamarin.Forms, to take a look behind the scenes of Xamarin.Forms. We get into where it came from, inspirations, design decisions, triumps, mistakes, and more. Join us for this peek behind the curtain of creating the Xamarin.Forms framework!

Hosts: Greg Shackles, Jon Dick

Guest: Jason Smith

Links:

Thanks to our Sponsors!

Raygun.io

Raygun.io – Exceptional Error Tracking
Raygun.io is the fastest and easiest way to track your application’s errors and get the level of detail you need to fix crashes quickly. Notifications are delivered right to your inbox and presented on a beautiful dashboard.

Details

Xamarin: Mobile Apps with Visual Basic & Xamarin.Forms

If you are a Visual Basic developer, your options for becoming a mobile developer have historically been limited to targeting Windows Phone; however, with Xamarin.Forms, Portable Class Libraries, and Visual Studio, developing iOS and Android apps entirely in Visual Basic has become a real possibility. Last year I wrote about how Visual Basic Portable Class […]

The post Mobile Apps with Visual Basic & Xamarin.Forms appeared first on Xamarin Blog.

Details

Johan Karlsson: Using iOS standard icons in Xamarin Forms

Have you ever wished for using the standard iOS icons in the toolbar for Xamarin Forms applications? Then you are reading the correct blog post. If not, then you are in the wrong place.

The problem

We want to utilize the built in icons for iOS in our Xamarin Forms application to create something like the image below.

The solution

The good news is that is isn’t really that complicated. Simply create a custom renderer and add some behavior to the NavigationRenderer.

First, the Xaml

The definition of our view looks like this.

xml version=1.0 encoding=UTF8?>
<ContentPage xmlns=http://xamarin.com/schemas/2014/forms 
    xmlns:x=http://schemas.microsoft.com/winfx/2009/xaml 
    Title = Welcome
    x:Class=Test.MyPage>

    <ContentPage.ToolbarItems>
        <ToolbarItem Name=Add />
        <ToolbarItem Name=Camera />
    </ContentPage.ToolbarItems>

    <ContentPage.Content>
        <Label Text=Wow, thats cool! HorizontalOptions=Center VerticalOptions=Center />
    </ContentPage.Content>

</ContentPage>

The key part here is to name your ToolbarItems to something useful and something that we can reference in the custom renderer. You also might want to make sure that the name works on Android and Windows Phone since those platforms won’t be affected by this change.

Then the renderer

Being a swede, I have trouble saying the word Renderer… Rendererrerr… Anyhow, this is what it looks like in code. The key is to look at the title for each UIBarButtonItem and replace the entire button with a new one. So we first define a new list to hold our new buttons and then recreate them, one by one to finally assign the new list to the NavigationItem.

The renderer goes in the iOS project since it’s iOS specific.

[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]

namespace ToolbarApp.iOS.Renderers
{
    public class CustomNavigationRenderer : NavigationRenderer
    {

        public override void PushViewController(UIKit.UIViewController viewController, bool animated)
        {
            base.PushViewController(viewController, animated);

            var list = new List<UIBarButtonItem>();

            foreach (var item in TopViewController.NavigationItem.RightBarButtonItems)
            {
                if(string.IsNullOrEmpty(item.Title))
                {
                    continue;
                }

                if (item.Title.ToLower() == add)
                {
                    var newItem = new UIBarButtonItem(UIBarButtonSystemItem.Add)
                    {
                        Action = item.Action,
                        Target = item.Target
                    };
                    
                    list.Add(newItem);
                }

                if (item.Title.ToLower() == camera)
                {
                    var newItem = new UIBarButtonItem(UIBarButtonSystemItem.Camera)
                        {
                            Action = item.Action,
                            Target = item.Target
                        };

                    list.Add(newItem);
                }

                TopViewController.NavigationItem.RightBarButtonItems = list.ToArray();
            }
        }
    }
}

Summary

It’s pretty simple to utilize platform specific stuff in Forms and you should do that in order keep that native feeling. The key to success is Custom Renderers. Learn to use them and you’ll excel in all parts of your life!

Resources

The original post from the Xamarin Forum. Thanks goes to Torben Kruse for initially answering this question.
Details

Xamarin: Rapid Mobile App Prototyping with Xamarin.Forms

Creating mobile app prototypes is an important part of the design process. It’s extremely useful for developers and test users to be able to interact with a prototype in order to experience how the app will behave when it’s complete, but building prototypes can be daunting due to the large amount of time it takes. […]

The post Rapid Mobile App Prototyping with Xamarin.Forms appeared first on Xamarin Blog.

Details

James Montemagno: Xamarin Evolve + Open Source Save The Date App

In just under eight months in Orlando, FL thousands of mobile .NET developers will be heading to the next Xamarin Evolve conference. Xamarin Evolve 2014 was one of the most spectacular conferences that I have ever been part of and have ever attended. The most amazing developers came together for five action packed days of training, sessions, hacking, and collaboration. To keep it short, you do NOT want to miss Xamarin Evolve 2016.

I had the joy last year of crafting multiple mobile applications for Evolve including the main conference application and an interactive scavenger hunt based on iBeacons called Evolve Quest.

With Evolve 2014 coming to a close there isn’t much need for the mobile application to hang around on the app stores, which is why I teamed up with Xamarin’s very own Mike James to craft an updated Save the Date application for Evolve. We decided that we wanted something simple but native. It had to be elegant with the latest iOS and Android designed, but still have deep integration into the platforms. The new Save the Date application for Evolve can be installed from both the Apple App Store or Google Play for Android enabling you easily sign up for updates, add Evolve to your calendar, and of course share Evolve with your friends.

Best yet, is that you can see exactly how Mike and I created the application and create your own Save the Date application for your upcoming event. Simply head over to the github repo to download the entire source code and get started today. 

Details