Disclaimer: this is an automatic aggregator which pulls feeds and comments from many blogs of contributors that have contributed to the Mono project. The contents of these blog entries do not necessarily reflect Xamarin's position.

August 28

Xamarin Events in September

Xamarin is back in session with tons of new workshops, seminars, Dev Days, user groups, and conferences happening this September all over the world!

September meetup-banner

Get involved this month in events near you:

Seattle Mobile .NET Developers us

  • Seattle, WA: September 1st
  • What’s new in C# 6 and F# 4! with James Montemagno and Xamarin MVP, Frank Krueger

XHackNight powered by IBM Bluemix & Xamarin in

  • Bangalore, India: September 5th – 6th
  • LEARN.HACK.WIN – a Cross Platform Mobile Hackathon

Gauteng Xamarin User Group in

  • Johannesburg­, South Africa: September 8th
  • Real World Xamarin.Forms (a case study)

Xamarin Dev Days – Jacksonville us

  • Jacksonville, FL: September 12th
  • Come learn Xamarin awesomeness with your community in Jacksonville

NYC Mobile .NET Developers us

  • New York, NY: September 15th
  • Xamarin Navigation Patterns with Xamarin MVP, Dan Hermes

Noser Engineering Breakfast ch

  • Zurich, Switzerland: September 16th
  • Noser, Go Mobile with Xamarin

Slalom us

  • Boston, MA: September 15th
  • Rapidly Delivering High Quality Mobile Experiences with Xamarin

Slalom us

  • Chicago, IL: September 16th
  • Rapidly Delivering High Quality Mobile Experiences with Xamarin

H&D International Workshops & Training Germany

  • Hanover, Germany: September 21st – 25th
  • Five days of extensive training in the world of Xamarin!

Xamarin Dev Days – Miami us

  • Miami, FL: September 26th
  • Come learn Xamarin awesomeness with your community in Jacksonville

Be sure to check out the Xamarin Events Forum for even more Xamarin events, meetups, and presentations happening near you!

Interested in getting a developer group started? We’re here to help! Here’s a tips and tricks guide on staring a developer group, an Introduction to Xamarin slide deck, and, of course, our community sponsorship program to get you started. Also, we love to hear from you, so feel free to send us an email or tweet @XamarinEvents to help spread the word and keep an eye out for events in your neck of the woods!

The post Xamarin Events in September appeared first on Xamarin Blog.

August 27

State of TLS in Mono

This is an update on our efforts to upgrade the TLS stack in Mono.

You can skip to the summary at the end if you do not care about the sausage making details.

Currently, TLS is surfaced in a few places in the .NET APIs:

  • By the SslStream class, which is a general purpose class that can be used to turn any bidirectional stream into an TLS-powered stream. This class is what currently powers the web client in Mono.
  • By the HttpWebRequest class, which provides .NET's HTTP client. This in turn is the foundation for the modern HttpClient, both the WCF and WebServices stacks as well as the quick and dirty WebClient API.

HttpClient is in particular interesting, as it allows for different transports to be provided for it. The default implementation in .NET 4.5 and Mono today is to use an HttpWebRequest-based implementation. But on Windows 10, the implementation is replaced with one that uses WinRT's HTTP client.

Microsoft is encouraging developers to abandon HttpWebRequest and instead adopt HttpClient as it both async-friendly and can use the best available transport given on a specific platform. More on this in a second.

Mono's Managed TLS

Mono currently only supports TLS 1.0.

This is the stack that powers SslStream and HttpWebRequest.

Last year we started an effort to bring managed implementations of TLS 1.2 and TLS 1.1. Given how serious security has become and how many holes have been found in existing implementation, we built this with an extensive test suite to check for conformance and to avoid common exploits found in implementation mistakes of TLS. This effort is currently under development and you can see where it currently lives at mono-tls module.

This will give us complete TLS support for the entire stack, but this work is still going to take a few months to audit.

Platform Specific HttpClients

Most of the uses for TLS today is via the HTTP protocol, and not over custom TLS streams. This means that it is more important to get an HTTP client that supports a brand new TLS stack, than it is to provide the SslStream code.

We want to provide native HttpClient handlers for all of Mono's supported platforms: Android, iOS, Mac, Linux, BSD, Unix and Windows.

On iOS: Today Xamarin.iOS already ships a native handler, the CFNetworkHandler. This one is powered by Apple's CFNetwork stack. In recent years, Apple has improved their networking stack, and we now I strongly recommend using Paul Bett's fantastic ModernHttpClient which uses iOS' brand new NSUrlSession and uses OkHttp on Android.

On Android: in the short term, we recommend adopting ModernHttpClient from Paul Betts (bonus points: the same component works on iOS with no changes). In the long term, we will change the default handler to use the Android Java client.

In both cases, you end up with HTTP 2.0 capable clients for free.

But this still leaves Linux, Windows and other assorted operating systems without a regular transport.

For those platforms, we will be adopting the CoreFX handlers, which on Unix are powered by the libcurl library.

This still leaves HttpWebRequest and everything built on top of it running on top of our TLS stack.

Bringing Microsoft's SslStream and HttpWebRequest to Mono

While this is not really TLS related, we wanted to bring Microsoft's implementations of those two classes to Mono, as they would fix many odd corner cases in the API, and address limitations in our stack that do not exist in Microsoft's implementation.

But the code is tightly coupled to native Windows APIs which makes the adoption of this code difficult.

We have built an adaptation layer that will allow us to bring Microsoft's code and use Mono's Managed TLS implementation.

SslStream backends

Our original effort focused on a pure managed implementation of TLS because we want to ensure that the TLS stack would work on all available platforms in the same way. This also means that all of the .NET code that expects to control every knob of your secure connection to work (pinning certificates or validating your own chains for example).

That said, in many cases developers do not need this capabilities, and in fact, on Xamarin.iOS, we can not even provide the functionality, as the OS does not give users access to the certificate chains.

So we are going to be developing at least two separate SslStream implementations. For Apple systems, we will be implementing a version on top of Apple's SSL stack, and for other systems we will be developing an implementation on top of Amazon's new SSL library, or the popular OpenSSL variant of the day.

These have the advantage that we would not need to maintain the code, and we benefit from third parties doing all the hard security work and will be suitable for most uses.

For those rare uses that like to handle connections manually, you will have to wait for Mono's new TLS implementation to land.

In Summary

Android, Mac and iOS users can get the latest TLS for HTTP workloads using ModernHttpClient. Mac/iOS users can use the built-in CFNetworkHandler as well.

Soon: OpenSSL/AppleSSL based transports to be available in Mono (post Mono 4.2).

Soon: Advanced .NET SSL use case scenarios will be supported with Mono's new mono-tls stack

Soon: HttpWebRequest and SslStream stacks will be replaced in Mono with Microsoft's implementations.

Join Xamarin at GOTO London & GOTO Copenhagen

Highly regarded in the software development community, the GOTO Conference series of annual events has been firmly established in Europe since 2009. This year, for the first time, the UK is getting it’s own three-day conference at GOTO London 2015.

GOTO London 2015 – September 16th to 18th (Workshops Sept. 15-16)

GOTO London 2015 BannerJoin Xamarin Developer Evangelist Mike James on Friday, September 18 to learn about creating native apps with up to 100% cross-platform code sharing with Xamarin.Forms. We’ll also have our team of mobile experts on hand at the Xamarin booth to answer your questions and help you understand how Xamarin can help you build, test, and monitor apps. Drop by for a chat—and maybe some of our popular Xamarin t-shirts and other swag!

GOTO Copenhagen 2015 – October 5th to 6th (Workshops Oct. 7-8)

GOTO Copenhagen 2015

If you can’t catch Mike’s talk in London, you have another chance to get the lowdown on Xamarin.Forms just a few weeks later at GOTO Copenhagen 2015 in Denmark. While you’re there, don’t miss Niels Frydenholm, Senior iOS Developer at eBay Classifieds, who will be presenting invaluable advice on the topic of “Continuous Delivery of Native Apps”, including automated UI testing with Xamarin Test Cloud.

We look forward to seeing you soon!

The post Join Xamarin at GOTO London & GOTO Copenhagen appeared first on Xamarin Blog.

Easily Automate Your Xamarin.Forms Apps

When developing mobile applications, it’s extremely time consuming and tedious to manually test your app for every new feature added or bug fixed. Of course, it’s possible to test an app’s business logic with common unit testing practices using nUnit or xUnit, but what about the user interface? UITestHow can we ensure that an application’s user interface is not only behaving properly, but also looks right on the thousands of unique iOS and Android devices out in the world?

This is where automated user interface testing with Xamarin.UITest, combined with the power and scale of Xamarin Test Cloud, comes in. In the past, we’ve looked at creating tests for traditional Xamarin iOS and Android applications by setting the Accessibility and Resource IDs to gain access to user interface controls in Xamarin.UITest, and today we’ll look at how to use UITest with Xamarin.Forms apps.

Meetup Manager in Test Cloud

Accessing Controls

When creating applications with Xamarin.Forms, we create our user interface with Xamarin.Forms controls in C# or XAML. At runtime, Xamarin.Forms handles laying down and displaying the native controls for the application. Since we’re developing against Xamarin.Forms controls, there’s a special way to gain access to them in our Xamarin.UITests through a special property called StyleId. The StyleId can be set to any string that can be accessed when creating your tests and will be the same between iOS and Android, which means there is no special management of Ids when developing with Xamarin.Forms.

XAML

 <Button x:Name="ButtonLogin"
         StyleId="ButtonLogin"
         BackgroundColor="#F44336"
         BorderRadius="0"
         TextColor="White"
         Text="Login to Meetup"
         Command="{Binding LoginCommand}" />

C#

var buttonLogin = new Button
  {
    StyleId = "ButtonLogin",
    Text = "Login to Meetup",
    BorderRadius = 0,
    TextColor = Color.White,
    BackgroundColor = Color.FromHex("F443336")
  };

The last thing to do is to add a few lines of code in your iOS and Android applications to apply the StyleId to the native controls, which actually does expose them to Xamarin.UITest. These lines of code should be commented out for final app store submissions.

iOS Setup

Open the AppDelegate.cs file in your iOS project. Add the following lines in FinishedLaunching method after Xamarin.Forms’ Init is called:

Forms.ViewInitialized += (sender, e) =>
{
  if (null != e.View.StyleId)
  {
    e.NativeView.AccessibilityIdentifier = e.View.StyleId;
  }
};

Android Setup

Open the MainActivity.cs file and add the following lines in OnCreate method after Xamarin.Forms’ Init is called:

Xamarin.Forms.Forms.ViewInitialized += (sender,  e) =>
{
  if (!string.IsNullOrWhiteSpace(e.View.StyleId))
  {
    e.NativeView.ContentDescription = e.View.StyleId;
  }
};

Now, if I was to run a UITest and open the REPL, ButtonLogin will be visible in the tree:

LoginButtonVisible

In the UITest, the ButtonLogin can be now used to interact with the button and validate so the login screen appears:

[Test]
public void OpenLoginScreen()
{
  app.Screenshot("App Launches");
  app.Tap("ButtonLogin");
  app.Screenshot("When I tap Login");
  Assert.IsNotNull(app.Query("EntryUserName").Single());
  app.Screenshot("Login Page is Visible");
}

Learn More

To learn more about Xamarin.UITest and Xamarin Test Cloud, be sure to dive through the developer documentation and see our advanced guide for using Xamarin.UITest with Xamarin.Forms. You can also download the full source code and Xamarin.UITest for Meetup Manager, which I demoed here, on my GitHub.

The post Easily Automate Your Xamarin.Forms Apps appeared first on Xamarin Blog.

Plans for Graphics Features Deprecation

This is a heads-up of graphics related things we plan to “drop” from future versions of Unity, a.k.a. Dropping of Things for Make Benefit Glorious Future of Rendering.

Sometimes when we try to make things better (better looking, faster, more flexible, etc.), we find that some old corner case or old hardware limitations get in the way. In general, we try to keep as much as possible working between versions of Unity, but sometimes the potential benefit of removing legacy functionality is just too great and said functionality hopefully affects very few people (if any).

So without further ado, here’s a tentative list of graphics related “it will stop working” items. Note that all these are “planned” and not actually done yet, so if you really, really need them to keep on working forever, let us know!

Shaders: Drop support for “precompiled” shader assets

A “precompiled” shader is the one that effectively comes “without source code”. Instead of having readable HLSL code in there, these shaders contain already compiled shader assembly or microcode or translated shader code for several platforms.

One problem with “precompiled” shaders (if you got them from somewhere) is that they will not work on platforms that might appear in the future. Say you’ve got a shader that was precompiled for DX9, OpenGL and OpenGL ES 2.0. This shader will not work on consoles, Metal, DX11 and so on! Hence using precompiled shaders is typically a bad practice for this reason alone.

Another reason why we want to remove support for them is because we want the shader serialization format to be much more efficient in disk storage, load times and runtime memory usage. The shader format we had so far was, shall we say, fairly inefficient text-based format that resulted in long shader load times and high memory usage. In our current experiments, we’re seeing big reductions in both of these (megabytes to dozens of megabytes saved depending on shader variant complexity, etc.) by changing to more efficient shader data format. However, that makes these “precompiled with old version of Unity” shaders not work anymore. We think that’s a fair tradeoff.

Advantages:

  • Shaders take up less space in your game data files (multiple times smaller).
  • Shaders load much faster, and especially the “hiccups on the main thread” while loading them asynchronously are much smaller.
  • Shaders take up a lot less memory at runtime.
  • “Show compiled code” in shader inspector will display actual shader disassembly on DX11, instead of a not-very-usable sea of vowels.

Disadvantages:

  • Precompiling your shaders (“show compiled code” from shader inspector) and then later on using that code directly will stop working.

Affects: People who precompile shaders, and people who got precompiled shaders from someone else.

When: Unity 5.3 (2015 December)

Hardware: Drop support for DirectX 9 Shader Model 2.0 GPUs

DX9 SM2.0 GPUs are fairly old and we’d like to drop support for them! This would mean that these GPUs would stop working in your Unity games: NVIDIA before 2004 (pre-GeForce 6000), AMD before 2005 (pre-Radeon X1000) and Intel before 2006 (pre-GMA X3000/965). In short, GPUs older than 10 years or so would stop working. Looking at the data, it seems that it’s only Intel GMA 950 aka 82945 GPU that is still sometimes found in the wild these days — so that one would stop working.

Note that we’re not dropping support for DirectX 9 as a whole! Often that is still the only practical option on Windows XP, which just isn’t going away… DirectX 9 rendering support (on Shader Model 3.0 or later GPUs) will continue to be in Unity for quite a while.

Advantages of doing this:

  • Less hassle for people writing shaders. Currently, all newly created shaders in Unity are compiled to “lowest common denominator” by default (shader model 2.0) and if you want any of more advanced features (vertex textures, dynamic branching, derivatives, explicit LOD sampling etc.), you need to add things like “#pragma target 3.0” etc. If we’d drop SM2.0 support, the minimum spec goes up and you don’t have to worry about it as much.
  • Way, way less hassle for us internally at Unity. You don’t want to know, for example, how much time we’ve spent on trying to cram Unity 5 physically based shaders into DX9 SM2.0 fallbacks. We could be doing actually useful stuff in that time!

Disadvantages:

  • Unity games would no longer work on Intel GMA 950 / 82945 GPU.

Affects: Windows standalone player developers.

When: Unity 5.4 (2016 March).

Hardware: Drop support for Windows Store Apps DX11 feature level 9.1 GPUs

Almost all Windows Store Apps devices are at least DX11 feature level 9.3 capable (all Windows Phone devices are). But there were one or two devices in the past that only supported feature level 9.1, so that dragged down the minimum spec that we had to support.

Advantages of doing this:

  • All WSA/WP8 shaders will be compiled to feature level 9.3, instead of 9.1, gaining some more functionality that wasn’t working previously (multiple render targets, derivative instructions in pixel shaders etc.).
  • We get to remove quite some code that had to deal with 9.1 limitations before.

Disadvantages:

  • Your Windows Store Apps would no longer support 9.1 devices (in practice this pretty much means “Surface RT tablet”). Note that Windows Phone is not affected, since all phones have at least 9.3 support.

Affects: Windows Store Apps developers.

When: Unity 5.4 (2016 March).

Shaders: Drop support for “native shadow maps” on Android OpenGL ES 2.0

Shadow mapping can be done using either “native GPU support for it” (sampling the shadowmap directly returns the “shadow value”, possibly also using hardware PCF filtering), or “manually” (sample depth from the shadowmap, compare with surface depth to determine whether in or out of shadow).

The first form is usually preferred, especially since many GPUs can provide 2×2 PCF filtering “for free”. On majority of platforms, we know ahead of time which of the shadow modes they support, however Android OpenGL ES 2.0 was the odd one, since some devices support “native shadow maps” (via EXT_shadow_samplers extension), but some other devices did not. This meant that for any shadow related shader, for Android ES 2.0 we’d have to compile and ship two variants of the shader to cover both cases.

However, we looked at the data and it seems that support for EXT_shadow_samplers on Android is extremely rare (1-2% of all devices). So we think it’s worth it to just remove support for that; we’d just always treat Android ES 2.0 as “manual depth comparison for shadows” platform.

Advantages of doing this:

  • Less shader variants to compile, ship and load at runtime on Android ES 2.0.

Disadvantages:

  • About 1% of Android ES 2.0 devices would no longer do hardware shadow PCF sampling, but instead do a slightly slower depth comparison in the shader. Note, however, that all these devices can use OpenGL ES 3.0 which has built-in PCF, so it’s better to include support for that!

Affects: Android developers targeting OpenGL ES 2.0.

When: Unity 5.4 (2016 March).

August 26

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-iconTouch 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, Apple has added a few new ways to use Touch ID, including integrating it as an essential part of Apple Pay and adding an API for developers to use Touch ID in their apps. In this blog post we’re going to discuss how you can leverage Touch ID to create secure user authentication. We’ll include a fallback to store the password in Keychain and authenticate our users against that in cases where the device doesn’t support Touch ID.

Xamarin Studio with TouchID Design

Supporting Older Devices

Sign Up

If the device has Touch ID, we won’t need to sign the user up since the device can authenticate them for us. But to ensure we support devices such as iPhone 4, 4S, and the iPhone 5, we’ll want to ensure we’ve got a fallback in place. To do this, we’ll use Keychain to store and validate the user credentials.

I like to use UserDefaults for storing usernames to read back information when the app launches and populate the username UITextField for the user. It’s small touches like this that make an app feel more polished and help achieve higher ratings on the app store.

var hasLoginKey = NSUserDefaults.StandardUserDefaults.BoolForKey("hasLogin");

if (!hasLoginKey)

    NSUserDefaults.StandardUserDefaults.SetValueForKey(new NSString(tbxUsername.Text), new NSString("username"));


Saving the Password

It’s important to note that we don’t want to use UserDefaults here since it’s not a secure approach to saving your data. Instead, we’ll use Keychain, which is iOS’s built-in secure storage service that allows us to store passwords, keys, certificates, and more. My colleague René Ruppert has developed a helpful wrapper for storing passwords on iOS with Keychain that you can grab here and is what I’ll be using.

To save the password, we simply call ‘SetPasswordForUsername’. In this case, I have my serviceId set to ‘MySecureApp’.

Helpers.KeychainHelpers.SetPasswordForUsername(tbxUsername.Text, tbxPassword.Text, serviceId, Security.SecAccessible.Always, true);

Once we’ve done that, it’s time to set ‘hasLogin’ to true and synchronize the UserDefaults.

NSUserDefaults.StandardUserDefaults.SetBool(true, "hasLogin");

NSUserDefaults.StandardUserDefaults.Synchronize();

Validating the User Credentials

We’re now ready to validate the credentials provided by the user. To do this, we get the password from the Keychain and check that it matches the password provided. We then repeat the process with the username. If CheckLogin returns true, then we can continue loading new views.

static bool CheckLogin(string username, string password)
{
    if (password == Helpers.KeychainHelpers.GetPasswordForUsername(username, serviceId, true) &&
        username == NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString("username")).ToString())
    {
        return true;
    }
    return false;
}

Adding Touch ID

Implementing user authentication with Touch ID is painless and only involves a tiny amount of code since iOS does most of the heavy lifting for us. Below is all the code required to get started.

//Lets double check the device supports Touch ID
if (context.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out error))
{
    var replyHandler = new LAContextReplyHandler((success, error) =>
        {
            InvokeOnMainThread(() =>
                {
                    if (success)
                    {
                        var newVC = new UIViewController();
                        PresentViewController(newVC, true, null);
                    }
                    else
                    {
                        var alert = new UIAlertView("OOPS!", "Something went wrong.", null, "Oops", null);
                        alert.Show();
                    }
                });
        });
    context.EvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Logging in with Touch ID", replyHandler);
}
else
{
    var alert = new UIAlertView("Error", "TouchID not available", null, "BOOO!", null);
    alert.Show();
}

Wrapping Up

Not all apps require a backend service for user authentication, and iOS provides lots of options for authenticating locally. If you wanted to take this one step further you could look at integrating 1Password authentication into your app. I’ve created a completed version of the demo project on GitHub, to which I’ll be adding 1Password support to in a separate branch that you can find here. Additionally, be sure to read through our full documentation on integrating Touch ID.

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

IKVM.NET 8.1 Release Candidate 0

The first release candidate is finally available. It can be downloaded here or from NuGet.

What's New (relative to IKVM.NET 8.0):

  • Integrated OpenJDK 8u45.
  • Many fixes to late binding support.
  • Added ikvmc support for deterministic output files.
  • Various sun.misc.Unsafe improvements.
  • Many minor bug fixes and performance tweaks.

Changes since previous development snapshot:

  • Assemblies are strong named.
  • Fix for bug #303. ikvmc internal compiler error when trying to get interfaces from type from missing assembly reference.
  • Implemented NIO atomic file move on Windows.

Binaries available here: ikvmbin-8.1.5717.0.zip

Sources: ikvmsrc-8.1.5717.0.zip, openjdk-8u45-b14-stripped.zip

Unity Comes to Linux: Experimental Build Now Available

Hello again, lovely people!

Last month, I wrote a blog post detailing our plans for Unity on Linux.  Well, I’m back again to tell you the big day has come; today we’re releasing an experimental build of Unity for Linux!

An Experimental Build

Today’s build is what we call an experimental build; future support is not yet guaranteed.  Your adoption and feedback will help us determine if this is something we can sustain alongside our Mac and Windows builds.

Today’s build is based off Unity 5.1.0f3 and comes with the ability to export to the following runtimes:

  • Linux, Mac, Windows Standalone
  • WebGL
  • WebPlayer
  • Android
  • Tizen
  • SamsungTV

System Requirements

  • 64-bit Ubuntu 12.04 or newer (just like our player, the editor will run on most ‘modern’ 64-bit Linux distributions, but official support is only provided for 64-bit Ubuntu 12.04 or newer)
  • Modern Nvidia, AMD, or Intel graphics card with vendor-supported graphics drivers

Feedback and Issues

We’ve created a new section of the forums for you to provide feedback and report issues.  That’s the primary place where we’ll be communicating with our users who are using the Linux build, so be sure to check it out.  Crashes of the editor will pop up the bug reporter, which we encourage you to use in that case (because we’ll get the stacktrace).

That’s all for now. You can find the downloads here:

Read more about the release notes and known issues in our forum post.

Much love from Unity

Na’Tosha

August 25

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 Libraries (PCLs) can be used in Xamarin apps. Xamarin.iOS and Xamarin.Android can access business logic written in Visual Basic PCLs, while writing the platform-specific code (including the user interface) in C# (or F#) on the Xamarin platform.

Visual Basic Xamarin.Forms

Since then we’ve released Xamarin.Forms, which makes it possible for an entire app—from business logic to user interface—to be written in a PCL and shared across platforms. This means that it’s become possible to write entire mobile applications in Visual Basic in Visual Studio using Xamarin.Forms. The Xamarin developer portal has instructions on creating a Visual Basic project from the Xamarin.Forms new project template. A “Basic” App class is shown here:

Public Class App
    Inherits Application
    Public Sub New()
        Dim label = New Label With {.XAlign = TextAlignment.Center,
                                    .FontSize = Device.GetNamedSize(NamedSize.Medium, GetType(Label)),
                                    .Text = "Welcome to Xamarin.Forms with Visual Basic.NET"}
        Dim stack = New StackLayout With {
            .VerticalOptions = LayoutOptions.Center
        }
        stack.Children.Add(label)
        Dim page = New ContentPage
        page.Content = stack
        MainPage = page
    End Sub

Once you’ve created a new project and converted it to Visual Basic (or just started with the sample) your entire application can be written in Visual Basic. The code below represents a simple ContentPage written in Visual Basic. You can use this as a basis for new pages in your apps:

Public Class Page2
    Inherits ContentPage
    Public Sub New()
        Dim label = New Label With {.XAlign = TextAlignment.Center,
                                    .FontSize = Device.GetNamedSize(NamedSize.Medium, GetType(Label)),
                                    .Text = "Visual Basic  ContentPage"}
        Dim button = New Button With {.Text = "Click me"}
        AddHandler button.Clicked, Async Sub(sender, e)
                                       Await DisplayAlert("Hello from VB", "Visual Basic.NET is back!", "Thanks")
                                   End Sub
        Dim stack = New StackLayout With {
            .VerticalOptions = LayoutOptions.Center
        }
        stack.Children.Add(label)
        stack.Children.Add(button)
        Content = stack
    End Sub
End Class

Xamarin doesn’t implement support for the Visual Basic language directly, so you can’t use Xamarin Studio for these projects; however, if you’re a Visual Basic programmer, or have existing Visual Basic code you’d like to mobilize, there’s never been a better time to get started with mobile development with Xamarin.Forms! And, of course, if you have published a Windows Phone application written in Visual Basic, there’s still time to take advantage of our free subscriptions for Windows Phone Developers promotion before August 31, 2015.

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

The Unity Assertion Library

Unity 5.1 shipped with a brand new Assertion Library. In this post, we will explain what an assertion is and how you can use it to improve runtime error diagnostics in your games.

What is an assertion and why should I care?

An assertion is a method that checks for a condition. If the condition is true, the method returns and the execution continues. If something unexpected happens and the assumption in the condition is not met, a message is printed that shows the callstack and optionally a user specified message. Let’s look at an example:

//Make sure the player GameObject is active
Assert.IsTrue(playerGameObject.isActive, “Player GameObject is not active”);

If the referenced GameObject was not active, an error log message would be printed showing the callstack and specified message “Player GameObject is not active”.

Assertion message

Many developers know asserts from unit tests. In a unit tests written using the Arrange-Act-Assert pattern, it’s the final part of the test method, where you compare expected and actual results. Assertions are not just for tests, though. You can use them in production code as well to get warned, at runtime, when invariants are violated. However, not all asserts should be used in runtime code.

What about the assertion libraries from unit tests frameworks?

It is very likely that you have first encountered assertions in a unit tests framework. As an example, let’s take NUnit. NUnit has a rich and battle-tested library for asserting tests you write with it. A natural thing to ask is why wouldn’t you simply want to use this library to test your production code? There are few reasons for that and one simple answer: it’s not meant for that purpose.

NUnit assertions allow you to test many things. From simple equality comparisons through more complex operations on collections to testing throwing exceptions. That is all fine but it all makes it too slow for using it in runtime. Low level assertions need to be as lean as possible and not give any unnecessary overhead in execution. The assertion library was written to run with no extra memory allocation and unnecessary operations.

An important thing for an assertion library is the possibility to strip the method calls out from the release build. The assertions can be very useful for developers during the production, but will be meaningless for the end-users if they fail. When building your final build you would want to get rid of all the calls to assertions. You could potentially comment all of the code out, but that wouldn’t be too smart. Luckily, .NET has a conditional compilation mechanism for such situations. The assertions library is implemented with Conditional attribute that will only include the assertion call in the developer’s build of your players. It is, however, still possible to include the assertions by forcing it via a compilation option.

Last but not least, it’s common for unit test assertion libraries to be based on exceptions. An exception is thrown on a failure and the execution flow is broken. This, obviously, is not desired in runtime code. The assertion library has been integrated with the Unity logging system and in case of a failure, a message will be logged. It makes the library versatile for all the platforms Unity supports. It also means the assertions work on AOT platforms that do not support exceptions.

So, what is in the library?

The library offers a several type-specific comparison methods and a generic equality comparer. Some of the assertion methods:

  • AreEqual – generic comparer used for basic equality comparison. Uses default equality comparer.
  • AreApproximatelyEqual – approximate comparer that tolerates comparison error. Can be used to compare floating point numbers.
  • IsTrue – for quick and easy boolean variables checks.

All the methods can be found in the Assert documentation.

A cool thing about this library is it’s out-of-the-box compatibility with Unity Test Tools. Without any extra effort, the assertion will fail any integration tests calling the code guarded by them.

Extending the library

When you want to get the most out of a feature, it’s natural to want to extend it. The library’s AreEqual methods allow you to pass your own implementation of a comparer for a specific type. The comparer has to implement the IEqualityComparer interface.

The library comes with FloatComparer used for comparing floats. It also allows you to do comparison with a relative error check. This comparer is used by AreApproximatellyEqual method.

Wrap-up

Using assertion library to protect your code from bugs and undesired state is an easy and little-impact mechanism you can start using right away. The library will be improved with time and, as usual, your comments and suggestions are more than welcome!

August 24

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. This is especially true when you’re asked to make prototypes for more than just one mobile platform, which happens more often than not. With Xamarin.Forms, though, it’s quick and easy to create user interfaces that are shared across Android, iOS, and Windows Phone.

Wireframes vs. Mockups vs. Prototypes

These terms often get used interchangeably in the mobile world. In order to understand why you might use Xamarin.Forms for prototyping, let’s go over the differences between these design terms.

Login_Wireframe

Wireframes

Wireframes are a static, low-fidelity representation of design. They’re usually in black and white, with blue sometimes used to show links and/or buttons. Wireframes should be created before mockups or prototypes, since they’re the backbone of your mobile app’s design.

Bottom Line: Wireframes are quick to create and are typically used as documentation for your project.
 

MockupsProfile_Mockup

Mockups are a static, high-fidelity representation of designs. These full-color images should look almost exactly like the final product in terms of color, icons, buttons, etc. Mockups represent the structure of information and demonstrate the basic functionalities of your app in a static way.

Bottom Line: Mockups are quicker to create than prototypes and are great for gathering feedback on the design in its entirety.

Prototypes

Prototypes are a middle to high-fidelity representation of the final product that simulates user interaction. It’s more likely that your prototypes will be middle-fidelity, meaning they won’t have to be as accurate as mockups when it comes to the design of your app. Prototypes should allow testers to interact with the app in a way similar to the final product.
Prorotype_Image
Bottom Line: Prototypes are expensive to create but are good for allowing stakeholders to preview the mobile app in its entirety.

Xamarin.Forms for Prototyping

Prototyping can be expensive and time consuming, but Xamarin.Forms lets you create prototypes for all three platforms by writing code in XAML or C# just one time, greatly reducing this pain. Xamarin.Forms also allows you to put real apps onto real devices to show off your prototypes. It empowers you to rapidly create a prototype and then put your prototype onto iOS, Android, and Windows devices so that your client or stakeholder can experience the user interaction of your app. That’s a pretty powerful tool in the design and development process.

So… Let’s code!

We are going to use the Swarm mobile app by Foursquare for our prototyping example. Here are a few screens that we should be able to easily create prototypes for:
Swarm_Screenshots

Initial Setup

Create a new Xamarin.Forms app. I’m going to name mine “SwarmPrototype”. Now, add a new Forms ContentPage XAML file named “LoginPage”.

In your App.cs file, modify the existing App() method so that our LoginPage shows up as soon as the app starts. We will also wrap the LoginPage in a NavigationPage and change some navigation bar properties.

public App ()
{
  // The root page of your application
  MainPage = new NavigationPage(new LoginPage())
  {
    BarBackgroundColor = Color.Transparent,
    BarTextColor = Color.White
  };
}

This gives us a NavigationPage, which provides some simple navigation properties so we can easily move from screen to screen through our prototype. The navigation bar will have white text to represent the screenshots above.

Login

Let’s head over to our LoginPage.xaml now. You can see it has automatically given us a content page in which we will need to add some content. First, add a StackLayout with 200 padding on top and an orange background.

<ContentPage.Content>
  <StackLayout
    Padding="0,200,0,0"
    BackgroundColor="#FFA733"
    VerticalOptions="FillAndExpand"
    Spacing="20">
  </StackLayout>
</ContentPage.Content>

Now, inside of our stacklayout, which is oriented vertically by default, we want to add a label, two entries, and three buttons. The label and the two entries will look like this:

<Label
  Text="Log in with your Foursquare account"
  TextColor="White"
  HorizontalOptions="Center"/>
<StackLayout
  HorizontalOptions="FillAndExpand"
  Spacing="0">
  <Entry
    Placeholder="Username"/>
  <Entry
    Placeholder="Password"/>
</StackLayout>

As you can see, we have a label and then two entries inside of another stacklayout. The reason I put those two entries inside of a new stacklayout is so that I could make sure the Spacing=”20″ in our main stacklayout didn’t apply to those elements. Here’s the rest of the XAML for the LoginPage:

<StackLayout
  Orientation="Horizontal"
  HorizontalOptions="CenterAndExpand"
  Spacing="30">
  <Button
    x:Name="buttonCancel"
    Text="Cancel"
    TextColor="White"
    BackgroundColor="#FFA733"
    BorderRadius="15"
    BorderColor="White"
    BorderWidth="2"
    HeightRequest="40"
    WidthRequest="150"/>
  <Button
    x:Name="buttonLogin"
    Text="Log in"
    TextColor="#FFA733"
    BackgroundColor="White"
    BorderRadius="15"
    HeightRequest="40"
    WidthRequest="150"/>
</StackLayout>
<Button
  x:Name="buttonForgot"
  Text="Forgot your password?"
  TextColor="White"
  BackgroundColor="Transparent"/>

One Last Thing

Now we have a static login page, which is a great start, but prototypes are meant to be interactive; we want the app to navigate when the user clicks the “Log in” button. In the LoginPage.xaml.cs file, we’re going to add an event handler for that button as well as a line of code to hide the navigation bar on the LoginPage.

public LoginPage ()
{
  InitializeComponent ();
  NavigationPage.SetHasNavigationBar (this, false);
  buttonLogin.Clicked += async (object sender, EventArgs e) => {
    await Navigation.PushAsync (new ActivityFeedPage ());
  };
}

In the event handler, we use the Navigation property (given to us by the NavigationPage we set up in our App.cs file) to Push a new ActivityFeedPage. You will have to add a new ContentPage XAML file named “ActivityFeedPage” for this to work.

Our login page is now good to go! If we run the app we can see that, even though we only wrote one XAML file, it looks and feels native on Android and iOS.
Login_Screenshots

Keep on coding!

I urge you to take a look at the Xamarin.Forms guides and to try creating the next two pages on your own. If you’re having trouble, take a look at the completed project on my GitHub. I will also be doing a more extensive guest lecture on this topic through Xamarin University on September 24th. Get your free 30-day trial so you can join me for this awesome rapid prototyping session!

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

August 21

Test Your Way to Xamarin Evolve Contest Winners!

We’d like to extend a big “Thank you!” to everyone that entered our “Test Your Way to Xamarin Evolve” contest. With app testing at the forefront of every mobile project, Xamarin wanted to relieve some of the stress associated with UI.Testing by introducing Xamarin Test Cloud. Now that all Xamarin Platform subscriptions include 60 Xamarin Test Cloud device minutes per month to test any app, we asked to see all of your awesome apps running in Xamarin Test Cloud!

Picking a single winner for a big prize like a ticket to Xamarin Evolve 2016 is difficult. However, without further adieu, I’m excited to congratulate our Grand Prize winner, Casper Skoubo!

Casper Tweet Pic 1

The app is called “Tilbagekaldt”, which in Danish translates to “revoke” or “withdraw” and was intended as a warning service for users when the Danish Ministry of Food sends out warnings about foods that may not have been handled correctly.

Casper Tweet Pic 2

With such great submissions from the community, we couldn’t decide on just one second place winner. So, I’m happy to congratulate both of our second place winners: James Alt and Mitch Muenster, for their wonderful contributions to Xamarin Test Cloud!

And also honorable mentions to:

Sebastian Seidel

Esteban Solano

Alison Fernandes

Marcel Malik

Mark Arteaga

Pavlina Pavlova

Didn’t get a chance to partake in the contest? Not to worry! You can still take advantage of this new benefit to start automating UI testing for mobile apps written on ANY platform (not just Xamarin) on our industry-leading catalog of over 1,800 devices. Get started using Xamarin Test Cloud today!

The post Test Your Way to Xamarin Evolve Contest Winners! appeared first on Xamarin Blog.

August 20

Mars Petcare Improves Engagement 10x with Xamarin

Mars Petcare logoIn 1911, Frank C. Mars made the first Mars candies, establishing Mars’ roots as a confectionery company. The company, based in McLean, Virginia, now has a presence in 74 countries, generating net sales of more than $33 billion a year.

Mars Petcare, one of the company’s six lines of business, is headquartered in Brussels, Belgium, and is one of the world’s leading pet care providers, employing more than 35,000 associates representing over 41 brands, including industry giants PEDIGREE®, IAMS®, and WHISKAS®. To keep sales representatives and other customer-oriented personnel up to date, they created a sales portal to access marketing collateral, training information, and their own private social network.

Hoping that a move to mobile would increase the use of the previously web-based sales portal by sales associates and distributors, Mars Petcare turned to Fortuitas, a Xamarin Premier Consulting Partner. Using the Xamarin Platform and Xamarin.Forms, Fortuitas and Mars created a cross-platform iOS and Android app that shares 100% of its code.

Mars Petcare app on iPhone, Android, and tablet

“Our ability to use Xamarin to create all of the user interface using the same code across platforms was a major time saver,” Kurtz says. “The 100% code sharing reduced our total development time for the iOS and Android apps by at least 50%.”

Mars is more than pleased with the results, with sales representatives and other users valuing the newfound ease with which they can access and share blogs, collateral, and other materials and collaborate socially to help build a sense of community.

“Initially there were just a few hundred people using the portal,” Kurtz says. “After deploying the mobile app, those numbers skyrocketed to almost 3,000 users. We’ve been told that people love it because it provides the true mobile user experience they needed to access high- value content.”

 

View the Case Study
 

The post Mars Petcare Improves Engagement 10x with Xamarin appeared first on Xamarin Blog.

Stugan Game Accelerator: Developers in the Swedish countryside

Sweden is a great country for game development. Companies based there such as King, EA Dice, Mojang, Avalanche Studios, Simogo and more have created and released some of the best-known and highly-successful IPs in the world. For example, just a couple of weeks ago, Rovio Stockholm released Angry Birds 2 (made with Unity btw), already downloaded by over 30 million people.

The beautiful Swedish countryside also hosts Oskar Burman’s (Rovio) and Tommy Palm’s (ex-King) non-profit game accelerator program Stugan.

Stugan – the name means “cabin” in English – gathers talented independent developers from all over the globe, from USA to South Africa or Australia. Together, they’re spending two summer months in lakeside red cabins. The program is their opportunity to make friends with developers from far away, get away from the distractions of large cities and focus on the games they have always wanted to create. But there’s also time for hiking through the surrounding woodlands, swimming in the nearby lake and an end-of-day relax in a traditional Scandinavian sauna!

3) Lake Photo

Aside from working on their games, the organisers of Stugan also organized visits from various experts from the games industry to speak to the teams. They delivered talks and gave advice to the developers on topics like PR and marketing, running a game studio or using the Arduino hardware. I had the luck and pleasure to represent Unity and visit the game accelerator at its mid-way point of the program.

I met the teams, played their creations and learned about their backgrounds, what type of game are they making and how. The majority of the projects use Unity, which gave me a chance to learn how they are using the engine, help with a few of the technical questions and gather feedback.

Below is a sample of their many in-development Unity projects, plus my impressions on what’s interesting about them in terms of input, visuals and gameplay.

20,000 Leagues Above The Clouds by That Brain (Sweden)

Ever wanted to be a captain of your own air-ship? Now you can! In ‘20,000 Leagues’ you command your own flying-vessel and explore open worlds of floating islands, sky-harbours and rival air-ships. When playtesting the current version of the game, I customized my own ship in body-size, weapons, boost-abilities and even banner logo and colors!
4) 20000above

Rosvita by Rosvita Works (UK)

In Rosvita, the visuals of the game are created by rendering 3D models of buildings in the game-world, but with a 2D detail map in the overlay. In the end, the game looks like a water-color painting with ink-work detail. The core mechanic lets you create cut-out bubbles, which you can combine with similar bubble colors. That creates pockets where you can manipulate gravity, so that Rosvita can navigate through the game world and get to out-of-reach locations.

5) Rosvita01_1080

Planeter by Ditto (Sweden)

PLANETER is a vibrant exploration game in which you create the universe. Adventuring is difficult on your own, but along the way you will find some alien friends to help you. Wiggle and wobble your way across the colourful terrain to discover the secrets of each planet, helping them flourish. PLANETER’s soothing soundtrack accompanied me as I floated, in my little bubble, between worlds. When the bubble bursts, there are puzzles to solve that reveal the mysteries of the planets.

6) Planeter

Cerulean Moon by Nacho Beard (Spain)

Cerulean Moon puts a new spin on platformer controls. Instead of using virtual joysticks or thumb-sized buttons in the corner of the screen, the player holds a finger to the screen and gently slidea it left or right to ‘move’ the world around the character. The faster you move your finger, the faster the character dashes in that particular direction. The developer of the game, Nacho, demonstrated how this unique control style allows some high-precision movement, platform-dashing and fireball-dodging.

7) ceruleanMoon03

Cadence by Made With Monster Love (South Africa)

More than just a sound toy, the game is built on connections between logical nodes that create loops of music. Puzzles demand careful thought and can be solved in multiple ways, generating unique melodies from real-time synthesisers.

8) Cadence Editor Aug 2015 1600x900

Robot Space Labs by Robin Baumgarten (UK)

Robot Space Labs is a space exploration and asteroid mining game that is entirely centered around peaceful research with autonomous robots. Rather than controlling the robots directly, they’re fully autonomous and you manage them by planning the construction of new factories, excavate minerals, and research and upgrade technology in laboratories. Different missions, materials and environmental hazards such as radioactivity, solar winds and meteor collisions add challenge and diversity to the game.

9) Robot Space Labs

A Dog’s Heart by Wendelin Reich (France)

A Dog’s Heart is a short game featuring a unique, high-end artificial intelligence.  Mimi, a 5-month old puppy, is your companion on a magical island and you become friends while playing through various activities together.

10) dogsheart

Intergalactic Space Princess by Geeiz Games (Australia)

Intergalactic Space Princess is a hyperactive adventure game about mistaken identity and roaming across the galaxy. It’s like a TV episode where you get to do all the action. You play as a sassy 14 year old, Meline, who accidentally gets eaten by a giant space worm and transported to a new planet, where people think she’s the REAL Space Princess. Features minigames, rap battles, sticking googly eyes on tomatoes, falling down a worms stomach and more!

11) spaceprincess

Sunshine by Amy Dentata (USA)
Sunshine is a first-person exploration game set in a futuristic, low-poly city. Instead of a firearm or a melee-weapon, you posses a wrist-mounted computer-terminal that allows you to view live-feeds from nearby CCTV cameras and write commands to override nearby computer systems. This opens up a whole range of unique possibilities for missions across the neon city.

12) sunshine

Keyhole by Czarcade (USA)
Keyhole is a timeline exploration game where the player’s actions affect the future of the world and its inhabitants, and every action can be undone at any time. As the player travels back and forth along the timeline, items are moved from character to character, creating new branches of reality.
13) Keyhole

_PRISM by Clint Siu (USA)
Inspired by Fireproof Studios’ ‘The Room’ and Plato’s ‘Classical Elements’, PRISM is a puzzle game about interacting with glyphs that surround abstract 3D geometry. It’s up to the player to work out the relationship between different glyphs and how to align them. This series of ‘combination lock’ puzzles is beautifully presented, with both the visuals and the sound contributing to a really immersive experience.

14) Prism

The Last Word by Mark Backler (UK)

Mark Backler’s project adds an interesting spice to the traditional a-to-b 2D platformer genre. Each level is presented as excerpts of a diary. Words that present the narrative can be repositioned as platforms, re-aligned to create stairs or even re-located to cause an effect to a certain object blocking or hindering your player’s progress. Each level brings a new part of the story and new environmental puzzles.

15) Last Word ScreenshotInduction by Bryan Gale (UK)

Induction is a puzzle game about time travel and paradoxes. You control a cube moving around abstract isometric levels and solve puzzles by jumping back in time and co-operating with past versions of yourself. Adding to the difficulty, you’re always required to create a ‘consistent’ timeline before you can complete each puzzle, so you have to be careful not to do anything that prevents your past self going back in time.

16) induction-screenshot-5

August 19

Xamarin Helps Launch AWS APN Mobile Competency Program

We’re excited to announce that we’ve been selected as an inaugural Amazon Web Services’ (AWS) Mobile Competency Program Partner. The Amazon Partner Network (APN) Competency Program highlights companies who have demonstrated technical expertise and customer success across specialized solutions and industries, including security, digital media, big data, and many others. The new Mobile Competency Program recognizes top partners with extensive experience working with developers and mobile-first businesses to help build, test, and monitor mobile apps.

AWS Advanced Technology Partner for Mobile Competency badge

We recently announced the Amazon Web Services (AWS) Mobile SDKs for Xamarin, allowing developers to quickly connect their native Xamarin apps to an array of AWS cloud services for identity management, push notifications, cloud storage, analytics, and more. Our inclusion in the APN Mobile Competency Program reinforces our collaboration with AWS, and affirms our leadership in delivering high quality integrations to organizations worldwide.

Together with AWS, we’re making it easy, fast, and fun to build beautiful, high-performance apps powered by robust cloud services. To get started, check out the AWS Mobile SDKs from the Xamarin Component Store.

The post Xamarin Helps Launch AWS APN Mobile Competency Program appeared first on Xamarin Blog.

Unite Boston Update: Rob Pardo, Full Session Schedule, and Made with Unity Showcase!

Hey everyone, Unite Boston is quickly approaching as it’s now only one month away. We’re excited to host it this year at the John B. Hynes Veterans Memorial Convention Center in Boston on September 21-23.

Today we’re pleased to say that our full session schedule is now live so that you can plan your time in Boston to be as productive and educational as possible.

In addition, we’re excited to announce that Rob Pardo will be participating in the Unite Boston keynote as a guest speaker! Rob, former Chief Creative Officer at Blizzard Entertainment, has been travelling around the world visiting developers as a Unity consultant, sharing his own knowledge about design and development practices and learning more along the way as well. For those unfamiliar, Rob is one of the videogame industry’s most respected and influential voices and has played a huge role in the development of some of the world’s most famous and beloved gaming franchises like World of Warcraft, StarCraft: Brood War, and Warcraft III: Reign of Chaos. To view the full session schedule, visit the Unite Boston website and scroll down the page.

New this year, in collaboration with Execution Labs, we will have a showcase area for projects developed using Unity. The showcase is open to projects in all stages of development and developers selected to participate in the showcase will be given a display area at the conference to show off to all the conference attendees. For more information about the showcase and to submit your game for a chance at participation in the showcase, just follow this link, fill out the form, and submit!

Additionally at this year’s Unite, we have a great line up of exhibitors including Facebook, Microsoft, Morph3D, Nintendo, Oculus, Project Tango, Qualcomm, PlayStation,  Samsung,  VirZoom, IMVU, Meta, Allegorithmic, Surre.al, ARM, Thinksquirrel, Leap Motion, Game Insight, Photon, PlayFab, Perforce Software and Blue Frog Robotics who will be on hand to demonstrate their technologies and talk to you about how it might benefit your development.

We’ll also have Asset Store Publishers showcasing their plugins, assets and tools such as Cinema Suite, Fungus Games, Invert Game Studios, LaneMax, Quantum Theory, Opsive, ProCore, Rust, Text Mesh Pro and PopcornFX at the Asset Store booth over the course of three days.

Make sure to visit the Unite Boston website to get all the details of the show! We’ll see you there!

Update 8.27.15: Rob will also host a Fireside Chat and Q&A on Wednesday morning. Rob will discuss things to consider as developers are continually faced with the challenge of making successful games in an ever-evolving industry. Then you’ll have the opportunity to get any of your questions answered by Rob himself.

August 18

Using Auto Layouts for iOS 9 SplitView

The official launch of iOS 9 is on the horizon, which makes it a great time to ensure your Xamarin.iOS app is ready to take advantage of all of the upcoming features. One that I’m excited about is the new and improved multi-tasking experience on the iPad. With iOS 9, it’s possible to run two apps side-by-side in a split view on the iPad. This means that your app can’t assume that it’s going to have the device’s full resources, or, more importantly, the entire screen. If you already use Auto Layouts for your apps, then you’re all set to take advantage of split view on the iPad, but if your app is using the older layout option of Autoresizing, you’ll want to transition to Auto Layouts as soon as possible to make sure you’re ready for the change.

iOS 9 Split View Multitasking

Getting Started with Auto Layouts

Auto Layout for iOS is an extremely powerful layout system that allows you to create complex relationships between controls and how they should respond to changes in screen size or orientation. Let’s take a look at how you can take an existing Autoresizing layout and convert it to Auto Layout. Below is my simple iPad layout, which uses Autoresizing.

Screen Shot 2015-08-13 at 16.29.08This is how we want our app to look when Auto Layouts is switched on. To turn Auto Layouts on, we’ll first need to click on the canvas behind our view controllers. This will allow access to the Storyboard Document Inspector, as you can see in the right hand side of the above screenshot.

Select ‘Use Auto Layouts’. When you do this you’ll notice two extra buttons appear in the toolbar. These are adding and removing constraints from our controls. Now that Auto Layouts is enabled, we can begin to define our layout relationships between controls. We’ll begin with configuring the layout for the title. The key to successfully mastering Auto Layouts is understanding that you’re providing rules for width, height, and X and Y positions. If you don’t provide these four pieces of information per control, your layout won’t work. When you double click the ‘My Amazing App!’ label, you’ll see controls that look similar to “Ts” appear on the edges. Screen Shot 2015-08-13 at 16.37.30

We can drag these controls to form connections. In the example below, I’m defining the Y-value of the control relationship to the top of the view controller.

Screen Shot 2015-08-13 at 16.38.36

Dragging the square in the center of the label allows us to set its X position as the middle of the view. I can click the control on the bottom and right of the Ts to fix the height and width of the label. If you’ve done this successfully, you’ll see the Auto Layout guides change from orange (to indicate an issue) to blue.

Screen Shot 2015-08-13 at 16.42.18

If you repeat the process for the bottom button by fixing the height and drawing lines to the left button and right edges, you should be able to rotate the UI and see both the label and the button resize correctly.

Screen Shot 2015-08-13 at 16.48.51

Finishing Up

Hopefully this post has demonstrated that using Auto Layouts is straight forward and not as complex as you might have initially thought. If you’re looking for advanced examples or more in-depth understanding of how to utilize Auto Layouts, make sure to check out our documentation.

Remember, its not long before iPad users will expect your app to work with Split View, so make sure you’re ready today!

The post Using Auto Layouts for iOS 9 SplitView appeared first on Xamarin Blog.

The Story of Ultraflow: Designing with Unity Analytics

This story was written by our intern Eric Tsai

In June 2014, 5 students studying at Supinfogame, located in France, came together to prove that “one simple mechanic with only three flat shapes can make a cool, fun and ‘addictive’ game”. ULTRAFLOW was released on Dec. 23. 2014. ULTRAFLOW is a minimalist yet complex puzzle game based on agility. The objective is simple:  shoot a ball so that it bounces through obstacles within a limited number of bounces.

Almost two months since launching, it hadn’t made much noise. “We were frustrated,” says one of the level designers, Gautier Tintillier. “We had plenty of playtests to make sure our levels were well designed before launching; everything was ready. There must be a roadblock we overlooked that turns the players away; we just didn’t have an easy solution to find it.”

Being a team of five, they lacked the human and computing resources to collect, analyze and pinpoint which part of the game might be  turning away players. Unity Analytics turned out to be the perfect solution.

“We are game design students at Supinfogame. Our priority was to design and develop games; it would take way too much of our focus to build an infrastructure for data collection. We have thought about using other services, but since our game is already built on Unity, it was effortless to integrate Unity Analytics into our game to get all the metrics we need,” says the developer, Thibaud Troalen.

Activated by a simple switch, games made with Unity log their players’ actions such as session length, frequency of play, and any custom events the developer defines. This data is aggregated into a dashboard which visualizes important factors, such as engagement and retention.

Ultrateam, the developers behind ULTRAFLOW, noticed Day One retention was good, but the figures showed a big drop off by Day Three. The sticky factor (metric to measure how ‘sticky’ the game is using duration of game play and frequency of opening the game) was also low.

Using the Funnel Analyzer, they identified that 7% of players left the at level 9. They also noticed that the average retries increased 3X from the previous level. They concluded that level 9 is frustrating new players and started working on redesigning it.

funnel

“The result was stunning”, said Thibaud. “I didn’t think a simple change like this would have such a huge effect.” The effect of adjusting the difficulty was dramatic and immediate: the 7% drop off was completely eliminated (now there is only .8% drop off at level 9) They had a total of 10% increase in the proportion of users who finish all 99 levels in the two weeks span after the adjustment. The durations increased by 10% on average and number of retries at higher levels increased as well.  While these changes might seem small, the result was that a game that had very little traction during the first three months, spiked up the rankings in the app stores.

“I’m sure there are tons of developers facing the same problems that we face. As a game designer from a small studio, we focus most of our time on graphics, music, and gameplay. We know analytics can really help us build a better game, but we don’t really have additional resources to handle the backend data infrastructure. It was really cool to see how easy getting the data we need from Unity Analytics is and how powerful insights we could get,” says Gautier. “With Unity Analytics, we were able to have a 360 view on the in and outs of our game. We know who is playing, which segment of users were having difficulty, who kept playing, where they came from, which levels were too difficult, where are our players dropping off. It opens up so many opportunities for us to improve our game and improve our players’ experience.”

What’s next for these 5 students from France?

“We are getting ready to launch a new game,” says Thibaud. “It will be similar to ULTRAFLOW, but with lots of variations and improvements using insights we learned from Unity Analytics. With the availability of data, we can rely on statistics and really tailor the game to our players. We plan to incorporate more insights that Unity Analytics offers and really leverage analytics to maximize the user experience”.

Funnel Analyzer is only one of the many data visualization tools that Unity Analytics offers; this is a sneak peak at the power of Unity Analytics and how it transform a quality game into a popular game. With Unity Analytics, indie developers like Ultrateam do not need to spend additional resources on building and maintaining the infrastructure for data collecting and analysis; instead, they can focus on what they enjoy and do the best: design and engineer amazing games.

Team Ultrateam includes Thibaud Troalen (Developer), Franck Fitrzyk (Level Designer),Gautier Tintillier (Level Designer), Maxime Bondoux (Sound Designer) and Theophile Loaec (Sound Designer).

August 17

The Great Incident Bash of 2015

It’s been 1.5 years since we last did an incident bash, so time was ripe for executing another in order to get some fresh data. Enter the Great Incident Bash of 2015.

Just to make sure we have the terms in place: An incident is when a user sends us a report through the bugreporter. An incident is turned into a bug when one of our testers has successfully reproduced the incident as a bug.

An incident bash is a period of time where we mark up a random sample of bugs within a given time period. In this case, we took 28 days of incidents that came in on version 5.0.1f1. We looked at 5.0.1f1 because it is the first release to roll up the initial patches after 5.0. We get a majority of incidents a month or two after the release, so this was a good time to look at it. Our sample had a total of 2058 incidents of which we randomly marked up 25%, leading us to fully investigate 491 cases.

Fully investigating a case means that we try to reproduce every case, respond to the user if we miss information, follow up on every response and try to get to the bottom of each case. This is immensely time consuming, but doing it on a random sample gives us a lot of information.

Going through 491 incidents, we managed to turn 73 into a bug:

image02

That’s a total of 14.86% of the entire population. Compared to the previous value of 6.83%, this is a lot more valid bugs, but it is also very low compared to the effort of digging them out. In other words, 85% of all incidents we get are in fact not bugs or duplicates of known issues. Having to wade through 7 bugs to actually find something real is an immense waste of time, so normally we don’t do that.

What we do is prioritize incidents according to a rating system. The rating takes into account the description, attached projects, images and files. It ranges from 0 (crash, profanity, no added information) to 5 (project attached and a solid description). We also handle incidents from our enterprise support customers first, because we have direct relations with them already. As such, we take incidents in the following order:

Enterprise customers -> Pro Rating 5 -> Rating 5 -> Pro Rating 4 -> Rating 4 -> etc.

Because of the incident bash, we now have the data to check whether this system is working.

The overview of the ratings on the incidents we started with shows that 4 and 5 are the smallest portion of the total pool.image00

We can see that 55 Rating 5 and 35 Rating 4 incidents out of the total 491 is not a lot. The one incident without a rating got through by mistake, but we included it for completeness sake.

Looking at the spread of the bugs according to the rating they had, we see the following picture:

image01

As expected, the vast majority of actual bugs were those with a rating of 5. And that’s out of the smallest pool of incidents.

The rating 0 incidents that do turn into bugs are most likely crashes that we have automatically identified through our crash analysis tool. We will blog about that later in the year. For now, please make sure you send all crash reports to us, even if you don’t add information. We can use the data for processing automatically.

Rating   Chance of Bug
0 1%
1 0%
2 16%
3 14%
4 20%
5 62%

This table really tells the story of why we are so insistent on getting a repro project attached and get a good description as well. Rating 4 is a solid description, but no attachment, while 5 is both. The difference is a 3 times larger chance of reproducing the issue and ultimately filing a bug that can be fixed.

It also tells the story of why we prioritize rating 5 so high. We are hunting bugs, as many as we can in the time we have available. That means prioritizing the effort on where the biggest chance of finding a bug is present. We will never be able to handle and respond to all incidents, there are simply too many incoming. To date, we have gotten 4.510 incidents reported on just version 5.0.1f1, of which only 10.7% percent have rating 5.

There are other things we are working on to change the flow of incidents. Coming in 5.3, we will integrate an automated search in the bug reporter itself. This will attempt to present possible solutions to a user as they are filling out the form, which will hopefully allow them to solve the problem much faster than having a turnaround with our team.

Further down the road, we will integrate crash lookups with our internal crash analysis tools, so a crash will automatically be able to tell the user whether it is a known problem, if there is a patch that solves it or if this is a new crash and we need more information. There are many other ways we can improve the bug reporter and we’re continuously working on it.

Monologue

Monologue is a window into the world, work, and lives of the community members and developers that make up the Mono Project, which is a free cross-platform development environment used primarily on Linux.

If you would rather follow Monologue using a newsreader, we provide the following feed:

RSS 2.0 Feed

Monologue is powered by Mono and the Monologue software.

Bloggers