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.

July 26

Learn How Xamarin Customers Ship Five-Star Apps

Today, we’re happy to announce our new Xamarin Customers website, which highlights our global customers across verticals, use cases, and geographies. From indie developers building their first app to multi-million dollar organizations with hundreds of apps in the pipeline, our customers are creating amazing mobile experiences. To recognize their success, we’ve captured more than 25 customer stories across 12 verticals.

Xamarin Customer logo wall

It’s easier than ever to deliver amazing Xamarin apps for any scenario:

  • Pinterest uses Xamarin Test Cloud to delight Pinners everywhere, guaranteeing its apps look amazing and work without issue on any device for over 100 million users.
  • Coca-Cola Bottling Co. Consolidated is transforming their business with anywhere, anytime accessible field sales apps powered by Xamarin for Visual Studio, Azure, and Visual Studio Team Services.

Our partners play a big role in our customers’ mobile strategy:

  • Info Support took home the 2016 Enterprise Xammy Award for their work with Dutch Railways, creating apps that equip Dutch Railways’ staff to better serve its over 1.1 million daily passengers.
  • Escher Group paired their Xamarin development skills with JudoPayments’ Xamarin SDK to rewrite Ireland’s largest coffee chain’s loyalty apps in C#, resulting in a better customer experience, incorporating technologies like Apple Pay to drive more revenue.

Visit xamarin.com/customers to explore our customer stories, and contact us to share your own.

The post Learn How Xamarin Customers Ship Five-Star Apps appeared first on Xamarin Blog.

IL2CPP Optimizations: Devirtualization

The scripting virtual machine team at Unity is always looking for ways to make your code run faster. This is the first post in a three part miniseries about a few micro-optimizations performed by the IL2CPP AOT compiler, and how you can take advantage of them. While nothing here will make code run two or three times as fast, these small optimizations can help in important parts of a game, and we hope they give you some insight into how your code is executing.

Modern compilers are excellent at performing many optimizations to improve run time code performance. As developers, we can often help our compilers by making information we know about the code explicit to the compiler. Today we’ll explore one micro-optimization for IL2CPP in some detail, and see how it might improve the performance of your existing code.

Devirtualization

There is no other way to say it, virtual method calls are always more expensive than direct method calls. We’ve been working on some performance improvements in the libil2cpp runtime library to cut back the overhead of virtual method calls (more on this in the next post), but they still require a runtime lookup of some sort. The compiler cannot know which method will be called at run time – or can it?

Devirtualization is a common compiler optimization tactic which changes a virtual method call into a direct method call. A compiler might apply this tactic when it can prove exactly which actual method will be called at compile time. Unfortunately, this fact can often be difficult to prove, as the compiler does not always see the entire code base. But when it is possible, it can make virtual method calls much faster.

The canonical example

As a young developer, I learned about virtual methods with a rather contrived animal example. This code might be familiar to you as well:

public abstract class Animal {
  public abstract string Speak();
}

public class Cow : Animal {
   public override string Speak() {
       return "Moo";
   }
}

public class Pig : Animal {
    public override string Speak() {
        return "Oink";
   }
}

Then in Unity (version 5.3.5) we can use these classes to make a small farm:

public class Farm: MonoBehaviour {
   void Start () {
       Animal[] animals = new Animal[] {new Cow(), new Pig()};
       foreach (var animal in animals)
           Debug.LogFormat("Some animal says '{0}'", animal.Speak());

       var cow = new Cow();
       Debug.LogFormat("The cow says '{0}'", cow.Speak());
   }
}

Here each call to Speak is a virtual method call. Let’s see if we can convince IL2CPP to devirtualize any of these method calls to improve their performance.

Generated C++ code isn’t too bad

One of the features of IL2CPP I like is that it generates C++ code instead of assembly code. Sure, this code doesn’t look like C++ code you would write by hand, but it is much easier to understand than assembly. Let’s see the generated code for the body of that foreach loop:

// Set up a local variable to point to the animal array
AnimalU5BU5D_t2837741914* L_5 = V_2;
int32_t L_6 = V_3;
int32_t L_7 = L_6;

// Get the current animal from the array
V_1 = ((L_5)->GetAt(static_cast<il2cpp_array_size_t>(L_7)));
Animal_t3277885659 * L_9 = V_1;

// Call the Speak method
String_t* L_10 = VirtFuncInvoker0< String_t* >::Invoke(4 /* System.String AssemblyCSharp.Animal::Speak() */, L_9);

I’ve removed a bit of the generated code to simplify things. See that ugly call to Invoke? It is going to lookup the proper virtual method in the vtable and then call it. This vtable lookup will be slower than a direct function call, but that is understandable. The Animal could be a Cow or a Pig, or some other derived type.

Let’s look at the generated code for the second call to Debug.LogFormat, which is more like a direct method call:

// Create a new cow
Cow_t1312235562 * L_14 = (Cow_t1312235562 *)il2cpp_codegen_object_new(Cow_t1312235562_il2cpp_TypeInfo_var);
Cow__ctor_m2285919473(L_14, /*hidden argument*/NULL);
V_4 = L_14;
Cow_t1312235562 * L_16 = V_4;

// Call the Speak method
String_t* L_17 = VirtFuncInvoker0< String_t* >::Invoke(4 /* System.String AssemblyCSharp.Cow::Speak() */, L_16);

Even in this case we are still making the virtual method call! IL2CPP is pretty conservative with optimizations, preferring to ensure correctness in most cases. Since it does not do enough whole-program analysis to be sure that this can be a direct call, it opts for the safer (and slower) virtual method call.

Suppose we know that there are no other types of cows on our farm, so no type will ever derive from Cow. If we make this knowledge explicit to the compiler, we can get a better result. Let’s change the class to be defined like this:

public sealed class Cow : Animal {
   public override string Speak() {
       return "Moo";
   }
}

The sealed keyword tells the compiler that no one can derive from Cow (sealed could also be used directly on the Speak method). Now IL2CPP will have the confidence to make a direct method call:

// Create a new cow
Cow_t1312235562 * L_14 = (Cow_t1312235562 *)il2cpp_codegen_object_new(Cow_t1312235562_il2cpp_TypeInfo_var);
Cow__ctor_m2285919473(L_14, /*hidden argument*/NULL);
V_4 = L_14;
Cow_t1312235562 * L_16 = V_4;

// Look ma, no virtual call!
String_t* L_17 = Cow_Speak_m1607867742(L_16, /*hidden argument*/NULL);

The call to Speak here will not be unnecessarily slow, since we’ve been very explicit with the compiler and allowed it to optimize with confidence.

This kind of optimization won’t make your game incredibly faster, but it is a good practice to express any assumptions you have about the code in the code, both for future human readers of that code and for compilers. If you are compiling with IL2CPP, I encourage you to peruse the generated C++ code in your project and see what else you might find!

Next time we’ll discuss why virtual method calls are expensive, and what we are doing to make them faster.

July 25

Preview: Android Nougat is on the Way

Today, we’re excited to release a new version of our Android N Developer Preview, which features bindings to the final APIs of the Android N SDK. The new version includes several exciting features including multi-window UI, direct reply notifications, advanced memory and power optimizations, and more for developers to integrate into their applications.

Android N Hero

Get Started

Start the Android SDK Manager:

  • Xamarin Studio, use Tools > Open Android SDK Manager
  • Visual Studio, use Tools > Android > Android SDK Manager

Install the latest Android SDK tools; these are listed under Tools:

Tools

Install Android Nougat (API 24) SDKs and Device Images:
AndroidN

You must install Android SDK Tools revision 25.1.7 or later, SDK Platform-tools 24 or later, and SDK Build-tools 24.0.1. For more information about using the Android SDK Manager to install the Android SDK, see SDK Manager.

Finally, download the latest preview Xamarin.Android packages for Visual Studio or Xamarin Studio.

When is Nougat coming out?

As of this posting, the final release of Android N Developer preview has been released and developers can start publishing apps to devices running Android N at the official API level if your users have opted into the Android Beta program. This will have your app ready for Android N when it is officially released later this year in Q3. Head over to Google’s preview overview page for more details.

Google’s Android N Timeline
Android N Updates

Important Behavior Changes

Android N introduces several behavior changes that could impact your application. These include new Doze optimizations for battery and memory improvements, background optimizations (including the deprecation of the CONNECTIVITY_ACTION broadcast), permissions changes, and several others that you can read about on the Android N preview portal. One of the more substantial changes to the platform is a new restriction of applications using non-public APIs such as SQLite, libcrypto, and many more. Be sure to test your application and libraries on Android N to ensure compatibility.

Learn More

Head over to our Xamarin Android N Developer Preview guide to read up on all of the latest features and for the latest downloads of our Android N Preview for Xamarin developers. Then be sure to check out our Android N samples on GitHub.

The post Preview: Android Nougat is on the Way appeared first on Xamarin Blog.

July 22

New Xamarin Dev Days Cities Announced!

Last year, hundreds of developers joined us at Xamarin Dev Days in dozens of cities around the US to learn cross-platform mobile development. The events were such a success that we’re bringing it back this year and taking it global! The first Xamarin Dev Days of 2016 in Milan and Mexico City were great, with a full house at both locations, where every developer went home with a goodie bag and tangible knowledge of how to build, test, and monitor native iOS, Android, and Windows apps with Xamarin.

XDD Milan 2016

What are Dev Days?

Screen Shot 2016-07-22 at 13.19.22Xamarin Dev Days are community run, hands-on learning experiences. More than just your average hackathon, they are free, day-long events focused around learning how to build native iOS, Android, and Windows apps with C#, Xamarin, and partner technology through valuable sessions from Xamarin, our partners, or your local developer community leaders.

After a morning of learning how to build beautiful, cloud-connected mobile apps with Xamarin, you’ll get a chance to put your new knowledge into practice with a hands-on workshop that walks you through the process of building your first cloud-connected, cross-platform mobile app. Xamarin experts will be there to help you get up and running, debug code, and answer any questions you may have.

 

Announcing More Cities!

8/06: Gurgaon, India
8/09: Ho Chi Minh City, Vietnam
8/20: Washington, DC
8/20: Kuala Lumpar, Malaysia
8/20: San Francisco, California
8/20: Bangalore, India
8/27: New York, NY
8/27: Kochi, India
9/03: Kolkata, India
9/03: Brisbane, Australia
9/10: Sevilla, Spain
9/16: Pisa, Italy
9/17: Hyderabad, India
9/17: Kitchener, Canada
9/24: Thiruvananthapuram, India
9/24: Curitiba, Brazil
9/24: Montreal, Canada
9/30: Bristol, UK
10/15: Houston, TX
10/29: Strasbourg, France

Use the map below to find an event near you, or head on over to our Xamarin Dev Days website for a full list of current Xamarin Dev Days cities around the world.

 

Get a Xamarin Dev Days in Your City

If you didn’t see a city near you on the map but are interested in organizing an event locally, apply as a Xamarin Dev Days host! We’ll provide you with everything you need for a fantastic Dev Days event in your town, including all of the speaker content and lab walkthrough, a hosting checklist, and swag goodies to give away to all of your attendees.

Sponsoring Xamarin Dev Days

We’re working with tons of Xamarin Partners and community members’ companies around the world to help facilitate Xamarin Dev Days. If your company is interested in participating, apply to be a sponsor and get global recognition as a Xamarin Dev Days contributor, as well as access to our worldwide developer community.

The post New Xamarin Dev Days Cities Announced! appeared first on Xamarin Blog.

In Development – Unity Splash Screen tools

As you saw in our recent pricing announcements, part of our new structure allows you as a Plus or Pro subscriber to disable the Splash Screen feature of Unity. In addition to this we wanted to provide a set of simple tools to let you display a co-branded splash screen with animation, for those of you that do wish to use them.

As we still require Personal Edition users to show a Unity splash screen for now, these tools will also be available and become the default method of showing the Made with Unity splash. The tools are still in development, and are currently aimed to be part of Unity 5.5. Check out the video above for what they look like in practice, and please provide us with feedback in the comments below.

Pre-emptive Questions and Answers

Q. Why not offer the shiny cube animation video we’ve seen from Unity recently?

A. This is a pre-rendered video clip that we may consider including for platforms it would make sense to include in (Desktop and Console) in future versions of the splash screen, but for now we wanted a light-weight simple system that everyone could use – or if on Plus/Pro – opt out of.

Q. Aliasing looks funky on the MWU logo in the video?

A. Yes, a little – because we are yet to implement AA for the splash – its in development, and we’ll work on the quality up til release.

Q. What’s to stop me as a Personal edition user from having a dark background with a dark unity logo?

A. We include the Overlay opacity as a mandatory feature on Personal edition, plus you’d be rendering at least 2 seconds of needless blank screen to try and circumvent the splash screen.

Q. This is cool, but why no nested prefabs?

A. Actually completely unrelated teams are working on features like this, and nested prefabs. We actually have solid ideas on how to achieve what is necessary for nested prefabs now and our core team are migrating from improving asset bundles to working full-time on this feature.

Q. Are there any Pokémon here? I heard there were Pokémon here.

A. Probably.

July 21

Introducing Stack Overflow Documentation

Xamarin and Microsoft are excited to be a part of the launch of Stack Overflow Documentation. This new feature brings the same collaborative approach from Stack Overflow’s question-and-answer system to developer documentation.
stackoverflow documentation

Stack Overflow Documentation provides a set of edit and review tools that lets the community write example-focused documentation to complement our existing developer portal and samples at developer.xamarin.com. Stack Overflow badges and reputation are supported, so every contribution you make is recognized; the more docs you contribute, the more rep you earn!

How does it work?

The new site will be organized by Stack Overflow tags (such as Xamarin.iOS and Xamarin.Android) which will contain documentation topics with many examples.

Browsing the documentation is as easy as using Stack Overflow: you can navigate by tag, topic, or search. If you can’t find the documentation you’re looking for, suggest someone write it (or if you know about a particular subject, write it yourself).

How to Contribute

Stack Overflow users can:

  • Suggest topics that they would like to see documented, for others to write.
  • Create a topic they are knowledgeable on, and immediately add examples.
  • Add examples to existing topics.

Each topic can have a number of examples to demonstrate how to accomplish different tasks. Examples can have the following four elements:

  • Examples: Topics should always include working code examples.
  • Syntax: Add method signatures if they aren’t obvious.
  • Parameters: Explain what parameters are for and any constraints they must adhere to.
  • Remarks: Describe any additional rules or pitfalls that aren’t covered in the code examples.

Submissions will be peer-reviewed; the site includes the ability to share drafts and chat with other contributors before an example is published.

Get Started

Xamarin tags are set up and ready for contributions, as this screenshot demonstrates:

Xamarin.iOS on Stack Overflow Documentation

We’re excited to see what great examples our developer community create and share!

Visit stackoverflow.com/documentation to get started today.

The post Introducing Stack Overflow Documentation appeared first on Xamarin Blog.

July 20

Build C# and F# Apps on Your iPad with Continuous Mobile Development Environment

It doesn’t matter if you’re on a Windows or a macOS machine, you have access to amazing IDEs to build iOS, Android, Mac, and Windows apps and libraries with Visual Studio and Xamarin Studio. But, what if you could take all of your code on the go and with you everywhere you go? What if you could open up a code file, library, or Xamarin.Forms project on your iPad and start coding with a full professional mobile development environment with IntelliSense powered by Roslyn? That’s the experience that Frank Krueger, Xamarin MVP, delivers with his new app, Continuous Mobile Development Environment, a professional C# and F# IDE for your iOS devices.

continuous_app

Built with Xamarin

Frank Krueger has been developing apps with Xamarin since it first came out. He’s seen great success as an independent developer with apps including iCircuit and Calca. Continuous demonstrates the full potential that’s unlocked for .NET developers through Xamarin, with full API access across all platforms and the power of .NET.

Powered by Open Source

Powered by the open source .NET compiler platform as a service Roslyn, Continuous offers full syntax highlighting and code completion as well as documentation for over 60,000 symbols. Krueger was able to deliver rich F# support with the open source FSharp Compiler, and to bring Continuous full circle and deliver support for .NET’s standard library, all iOS APIs, and support for Xamarin.Forms, it leverages Mono and the now open sourced Xamarin.iOS and Xamarin.Forms. It’s amazing to see what can be built with these open source technologies!

code_completion

Professional Development Environment

As a professional development environment, Continuous is lightning fast, has an interactive output window to see your app running live, automatic and constant debugging, and works completely offline. If that wasn’t enough, Continuous deeply integrates into iOS features and has a custom keyboard accessory for quick access to much needed keys for C# and F# development. Continuous doesn’t stop there, though—it also enables developers to carry on development in your favor desktop IDEs, Visual Studio and Xamarin Studio. You can share a single file, zip an entire solution, or collaborate with other iOS apps to synchronize with Git.

Try Continuous Yourself

You can learn more about Continuous at continuous.code and learn more about its development and release on Krueger’s blog. We want to congratulate Frank on his release of Continuous; we can’t wait to see what he and all developers building apps with Xamarin come up with next. To learn more about all of the open source projects at Xamarin, visit open.xamarin.com

The post Build C# and F# Apps on Your iPad with Continuous Mobile Development Environment appeared first on Xamarin Blog.

Games by the Numbers (2016 Q2): BRIC Countries Dominate Global Mobile Game Installs

The Q2 2016 edition of the “Games by the Numbers” report is now available! This quarterly report reveals global game install trends across different platforms, devices and regions.

Unity by the Numbers - 2016 - Infographic1-Final

Key highlights from this report include:

  • The BRIC countries, Brazil, Russia, India and China, accounted for four of the top five global game install leaders with 41% of the total and 42% of Android. Four of the top five Android mobile device manufacturers for BRIC countries are from China.
  • Android achieved near total dominance in Indonesia, with 96% of total game installs, surpassing the Republic of Korea and Brazil (Q1 2016 leaders, each with 92%).
  • Marshmallow (6.0 or later), released in October 2015, gained significant traction over the last quarter, jumping over 4.5X to 7.5% of installs globally, likely a result of all the major device manufacturers kicking off rollouts of Marshmallow on their devices.  
  • iOS showed more consolidation with 78% (vs 72% in Q1) of installs occurring on devices running iOS 9.0 (released September 2015) or later.

This marks the third data report developed in conjunction with the Unity Analytics team and is based on the anonymized data of the 238K Made with Unity games which generated 4.4B installs from 1.7B unique devices in Q2 2016. To see all the insights and trends, download the full report:

DOWNLOAD FREE REPORT

More Information:

 

Report version history

April 2016, Second edition covers Q1 2016 

Sept 2015, First edition covers April-July 2015

 

July 19

Explore iOS 10, tvOS 10, watchOS 3, and macOS Sierra Previews Today

Apple announced major updates to all of their operating systems and a smattering of new APIs for developers to explore at this year’s WWDC conference. sdk-icon-90x90_2xWe are excited for Xamarin developers to get their hands on these new APIs to start building beautiful native apps in C#, so today, we’re releasing our first set of previews for developers to start exploring iOS 10, tvOS 10, watchOS 3, and macOS Sierra along with supporting Xamarin-specific documentation to get you started.

iOS 10

iOS 10 has something for everyone. SiriKit unleashes the power of Siri for developers to integrate unique experiences into their mobile applications to enhance a slew of services. Notifications have been completely overhauled to schedule notifications based on geo-fencing or time and a new UI framework to allow enhanced customization has been added. This is just that start, as there are new APIs unlocked in HealthKit, HomeKit, Core motion, Foundation, Core Data, and many more as well. To get started, browse through our Introduction to iOS 10 documentation.

ios_overview_2x

tvOS 10

Bring your apps to life on the big screen with the latest additions to tvOS including ReplayKit to live broadcast game play, PhotoKit to share photos with iCloud Photo Library and your apps, and easily integrate multipeer connectivity to your iOS apps. To get started, check out our Introduction to tvOS 10 documentation.

watchOS 3

Take advantage of the latest watchOS release, which dramatically speeds up performance and navigation of all apps. Performance is one thing, but there are also several new APIs to play with, including Fitness and Motion with access to real-time heart rate data, gyroscope, and accelerator. Enhance your existing apps with direct access to the Digital Crown, speaker audio, in-line video, SpriteKit, SceneKit, Apple Pay, and camera data from HomeKit-enabled accessories! You can get started today with our Introduction to watchOS 3 documentation.
watchos3

*This initial release of watchOS 3 has a subset of the final APIs that will be available in the future.

macOS Sierra

hero-macos_medium_2xThese Apple previews aren’t just about mobile devices, as you can also start integrating the latest APIs in macOS Sierra (10.12) into your Xamarin.Mac applications. Our Introduction to macOS Sierra documentation is a great place to start.

Installing the Previews

You can download the Previews for Xamarin Studio on macOS directly from the Xamarin Developer site for each OS: iOS 10, tvOS 10, watchOS 3, and macOS Sierra. You will need to ensure that you have the latest Xcode 8 Beta installed, which can be run on macOS 10.11.5 (El Capitan) or newer for iOS, tvOS, and watchOS, and macOS Sierra for macOS Sierra development. Upcoming previews will add even more support for these platforms, including support for Visual Studio.

The post Explore iOS 10, tvOS 10, watchOS 3, and macOS Sierra Previews Today appeared first on Xamarin Blog.

Made with Unity Showcase at Unite 16 & The Revamped Madewith.unity.com!

Made with Unity has been a really bright spot for us for many reasons this past year. It’s invigorating for all of us to really see just how many incredible games are being made with Unity! A big part of that visibility has been due to madewith.unity.com which we launched last year. We’re very happy to announce that we’ve launched the next iteration of the site today, but before we get into more detail about that…

One of the newest (and super bestest, by our calculations) additions to the global Unite line-up has been the Made with Unity Showcases. We’re very happy with how positively they’ve been received both by show attendees and the participants and they’ve quickly become an integral part of the events.

showcaseEU

Made with Unity Showcase @ Unite Europe ’16

So, to go along with the unveiling of the madewith.unity.com site redesign, we’re also announcing that open submissions have begun for the Unite Los Angeles Made with Unity Showcase! Once again, we’ll be looking to include a variety of games and other projects that show off the breadth of awesome experiences being made by the community.

All you need to do is fill out the submission form and sign up for a profile on madewith.unity.com if you haven’t already done that. If you haven’t announced your game yet and can’t sign up for a profile, feel free to submit anyway, we can take care of signing up later.

Open submissions will close on August 14th at midnight PDT, so make sure to get your submissions in by then.

 

Untitled-4

 

The New Madewith.unity.com

After you’ve signed up, you’ll hopefully have noticed some sweeping changes to the layout, design, and how we’re showcasing your content on madewith.unity.com.  We hope you like the new look!  Here’s a quick rundown of the highlighted changes to the site and how you can get started to create your profile and publish your own story.  

Front Page1

 

Overall Improvements and Bug Fixes

Our primary goal was to take in the overall feedback over the past year and make this an easier experience to share stories and create profiles.  To accomplish this, we rewrote the codebase and focused a lot of attention on making the CMS easier to work with and the process to create a profile a bit easier to digest.  

The good news is, this code rewrite makes it easier for us to update the site and make fast changes if common issues rear their ugly heads.  We’ll continue to listen to you to make this a reliable experience for you.  If you run into any issues as an existing profile owner or new user, please let us know in the forum!

Games Gallery and Stories Library

We also  wanted to improve the way you browse and find new games developed by Unity devs everywhere.  The new layout allows us the opportunity to showcase many of your games by category, themes, or any way we want really.  In turn, that gives us the ability to show off more of your content to everyone.  

We’ve added the much needed search option throughout the site so you can find a story or game based on a specific tag, keyword, or platform.  Slowly but surely, we’re growing the site to make it easier to find your interests, discover new ideas, and keep track of dev updates and announcements.  

 

Updated Game Profiles

Another area of focus was to improve the ability for devs to showcase their work on the site.  Your game profile pages are updated to show off more of what you’re working on, including an option for release dates and an updated tagging system to allow for more relevant related games.  We invite you to use this as a resource for you to show all your story announcements, blog updates, and media with everyone should you need it.  

In addition to that, you may have observed the new Weekly Top 10 on the front page.  We’re using this to highlight the most active game profiles of the week.  You may be asking how you get on this prestigious list. It’s a mixture of how many stories related to the game you’re posting, how much the article is shared, and how many people have read those stories and viewed your profile within the given period.  Put simply:  post awesome updates, share your awesome stories, and actively promote each other.

 Untitled-5

Share Your Story!

Over the past several months, we’ve seen some amazing stories and insights from Unity developers around the world.  We’re well over 300 crowd-sourced articles from the community in under a year!  It’s been awesome to see the site take shape with such varied perspectives and creatives ideas.  

Our goal remains the same as when we originally launched the site.  To make this a place for every Unity developer to express their ideas to a global audience, inspire and educate others, and be a central resource for what’s going on in the community so press and media to see what’s going on.  

Whether those stories are about experimentation with new concepts in VRa director’s commentary inside look on your upcoming game, tips and tricks, or even failures encountered that taught you important lessons you feel are valuable to the community, we want this to be a place can read about all the hard work that goes into game development. When you’re ready to write a story yourself, check out our quick guidelines to help get you started.

Do you already have a profile?

All stories and profiles have been migrated to the new site.  We’ve done a lot to make sure we haven’t negatively impacted your content but some edge cases may have slipped through.  To combat that we’ve created an Update FAQ for you madewith.unity.com veterans and some tips to help make sure your migrated profile looks great.  If you encounter any issues or something isn’t looking quite right, let us know in the forum.  The easiest solution is to log in, edit your profile, and walk through the new steps to make sure everything is 100%.

What’s Next?

Now that the overall redesign is in the wild, we can continue our focus on more functional additions for you.  Comments, statistical data, and more ways for readers to interact and provide feedback are definitely on our mind.  We’ll be listening to your feedback closely as always.  

So go ahead and apply for the Unite 16 showcase, create a profile, share what you’re working on.  With your continued support and participation we can’t wait to continue to grow Made with Unity as a developer resource and to aid discovery.

July 18

Podcast: Tools for Creating & Designing Five Star Apps

This week on the Xamarin Podcast, Mike James and I share the tools and processes we use to create and design beautiful, five-star cross-platform apps, including Sketch, Zeplin, Paintcode, and Bitrise.

Subscribe or Download Today

Knowing the latest in .NET, C#, and Xamarin is easier than ever with the Xamarin Podcast! The Xamarin Podcast is available from iTunes, Google Play Music, and SoundCloud. Do you have an interesting story, project, or advice for other .NET mobile developers? If so, we’d love to share it with the Xamarin community! Tweet @pierceboggan or @MikeCodesDotNet to share your blog posts, projects, and anything else you think other mobile developers would find interesting. Be sure to download today’s episode tools for creating and designing five star apps, and don’t forget to subscribe!

The post Podcast: Tools for Creating & Designing Five Star Apps appeared first on Xamarin Blog.

July 15

Contest: Add an Azure Backend to Your Mobile App

All apps need a backend, and Azure Mobile Apps makes it simple to add a backend to your mobile application. From no-code backends with Azure Easy Tables to full .NET backends with ASP.NET Web API, Azure has a backend for any kind of mobile app. Once you’ve built your backend, it’s time to consume it from a mobile app, and thanks to the App Service Helpers library, adding a backend to your mobile app can be done in as little as four lines of code.

In this contest, we invite you to add an Azure Mobile Apps backend to your app to win a Xamarin t-shirt!

How to Enter

1. Create a new Azure Mobile App:

2. Connect your mobile app to the cloud.

3. Tweet a short video clip of your Xamarin app connected to an Azure Mobile Apps backend with the hashtags:

  • #Xamarin AND #AzureMobile

Xamarin T-Shirts

Pro Tip: Easily add a no-code backend to your mobile app with just four lines of code in five to ten minutes with App Service Helpers, or follow our guides on adding a backend with Azure Easy Table.

Rules

All submissions must be made by Monday, July 25 at 12 pm EST. A valid entry consists of a tweet containing the hashtags #Xamarin AND #AzureMobile, along with a short video clip of your app connecting to an Azure Mobile Apps backend. A valid entry will win one Xamarin t-shirt. Limit one entry per person. To be eligible, you must follow @XamarinHQ to enable us to DM you for private follow up. Please allow up to three weeks for us to verify entries and collect shipping information to send your Xamarin t-shirt. There is no purchase necessary to enter the “Add an Azure Backend To Your Mobile App” contest.

The post Contest: Add an Azure Backend to Your Mobile App appeared first on Xamarin Blog.

July 13

Creating a Five-Star Search Experience with Azure Search

Search is a feature that can make or break a mobile app, but it can be incredibly difficult to get right. Often, the likelihood that a user continues to use your app depends on the quality of the search experience; if Yelp didn’t help me find restaurants or Amazon didn’t display the products I was looking for, I’d likely abandon that service.

There are so many options for developers looking to implement search solutions into their apps. Some of us may opt for using LINQ and the Entity Framework to query a table, or the more adventurous of us may opt to create an instance of Elastic Search, which requires a lot of work and knowledge to set up and maintain. For my app Beer Drinkin, I’m using Microsoft’s Azure Search service, since it has proved to be easy to configure and requires zero maintenance. In this blog post, you’ll learn how to implement intelligent search with Azure Search into a mobile app.

Dealing with spelling mistakessearchresults

One of the main reasons that I’ve opted to use Azure Search is to resolve off-by-one-letter spelling mistakes, which yield no results. One alternative way I considered to address spelling mistakes was to utilize a spell checking service, like WebSpellChecker.net. The issue with a service such as WebSpellChecker is that it has no context in which to make corrections. It struggled with product names like Duvel, often offering to correct my spelling to Duvet, which would be incorrect and yield no result.

One popular way to minimize spelling mistakes is to provide a list of suggestions as the user types in a search query. You’re probably familiar with this in search engines like Google and Bing. This approach to searching is intuitive for users and significantly reduces the number of spelling mistakes. This is built into Azure Search with an easy to use API for consuming the predictions.

Enter Azure Search

Azure Search aims to remove the complexity of providing advanced search functionality by offering a service that does the heavy lifting for implementing a modern and feature-rich search solution. Microsoft handles all of the infrastructure required to scale as it gains more users and indexes more data. Not to mention that Azure Search supports 50 languages, which use technologies from multiple teams within Microsoft (such as Office and Bing). What this equates to is that Azure Search actually understands the intent of a search for intuitive results; it doesn’t just evaluate the result based on the characters typed.

Some of my favorite features include:

  • Fuzzy Search: Find strings that match a pattern approximately.
  • Proximity Search: Geospatial queries allow you to find search targets within a certain distance of a particular point.
  • Term Boosting: Boosting allows you to promote results based on rules you create. One example might be to boost old stock or discounted items.

Getting Started

The first step towards adding intelligent search to your mobile apps is to provision an instance of Azure Search within the Azure Portal. Because my index already contains over 60,000 beers, I opted for the basic plan. The basic plan comes with more power through the use of dedicated resources, and I’m able to store 2GB of data and one million documents. I can also scale out to three units, which provides me with plenty of room to grow.

Creating an Index

Before I could take advantage of Azure Search, I needed to upload my data to be indexed. Fortunately, with the .NET SDK the Azure Search team provides, it’s exceptionally easy to interact with the service. Using the .NET library I wrote to interact with the BreweryDB REST API, I was able to iterate quickly through each page of beer results and upload them in blocks to the search service.

Screen Shot 2016-01-04 at 10.18.02.png

Uploading Documents

You can see how easy it is to import documents into Azure Search, as I did below with the BreweryDB.NET library.

Parallel.For(1, totalPageCount, new ParallelOptions {MaxDegreeOfParallelism = 25}, index =&amp;amp;amp;amp;amp;amp;amp;amp;gt;
{
    var response = client.Beers.GetAll(index).Result;
    var beersToAdd = new List();
    foreach (var beer in response.Data)
    {
        var indexedBeer = new IndexedBeer
        {
            Id = beer.Id,
            Name = beer.Name,
            Description = beer.Description,
            BreweryDbId = beer.Id,
            BreweryId = beer?.Breweries?.FirstOrDefault()?.Id,
            BreweryName = beer?.Breweries?.FirstOrDefault()?.Name,
            AvailableId = beer.AvailableId.ToString(),
            GlassId = beer.GlasswareId.ToString(),
            Abv = beer.Abv
         };
         if (beer.Labels != null)
         {
            indexedBeer.Images = new[] {beer.Labels.Icon, beer.Labels.Medium, beer.Labels.Large};
         }
         beersToAdd.Add(indexedBeer);
    }
    processedPageCount++;
    indexClient.Documents.Index(IndexBatch.Create(beersToAdd.ToArray().Select(IndexAction.Create)));
    Console.Write( $"\rAdded {beersToAdd.Count} beers to Index | Page {processedPageCount} of {totalPageCount}");
});

Other Data Import Methods

Azure Search also supports the ability to index data stored in Azure SQL or DocumentDB, which enables me to point a crawler to my SQL table, removing the need to manually manage the index yourself. There are a few reasons you may not want to use a crawler. The best reason for not using a crawler is that it introduces the possibility of a delay between your database changing and your search index reflecting the changes. The crawler will only crawl on a schedule, which results in an out-of-date index.

If you opt for the self-managed approach, you can add, remove, and edit your indexed documents yourself as the changes happen in your back end. This provides you with live search results, since you know the data is always up-to-date. Using the crawler is an excellent way to get started with search and quickly get some data in place, but I wouldn’t consider it a good strategy for long-term use.

Suggestions

Before we can use suggestions, we’ll need to ensure that we’ve created a suggester within Azure.

Screen Shot 2016-01-04 at 10.27.15.png

In the current service release, there is support for limited index schema updates. Any schema updates that would require reindexing, such as changing field types, are not currently supported. Although existing fields cannot be modified or deleted, new fields can be added to an existing index at any time.

If you haven’t checked the suggester checkbox at the time of creating a field, then you’ll need to create a secondary field, because Azure Search doesn’t currently support editing the fields. The Azure Search team recommends that you create new fields if you require a change in functionality.

The simplest way to get suggestions would be to use the following API.

var response = await indexClient.Documents.SuggestAsync(searchBar.Text, "nameSuggester");
foreach(var r in response)
{
    Console.WriteLine(r.Text);
}

Having fun with the suggestion API

The API suggestion provides properties for enabling fuzzing matching and hit highlighting. Let’s see how we might enable that functionality within our app.

var suggestParameters = new SuggestParameters();
suggestParameters.UseFuzzyMatching = true;
suggestParameters.Top = 25;
suggestParameters.HighlightPreTag = "[";
suggestParameters.HighlightPostTag = "]";
suggestParameters.MinimumCoverage = 100;

What do the properties do?

UseFuzzyMatching: The query will find suggestions even if there’s a substituted or missing character in the search text. While this provides a better search experience, it comes at the cost of slower operations and consumes more resources.

Top: The number of suggestions to retrieve. It must be a number between 1 and 100, with its default set to 5.

HightlightPreTag: Gets or sets the tag that is prepended to hit highlights. It MUST be set with a post tag.

HightlightPostTag: Gets or sets the tag that is prepended to hit highlights. It MUST be set with a pre tag.

MinimumCoverage: Represents the percentage of the index that must be covered by a suggestion query in order for the query to be reported a success. The default is 80%.

How do the results look?

suggestions

Search

The Search API itself is even easier (assuming we don’t use filtering, which is a topic for another day).

var searchParameters = new SearchParameters() { SearchMode = SearchMode.All };
indexClient.Documents.SearchAsync(searchBar.Text, searchParameters);

Getting Started

The easiest way to get started with Azure Search is to create an instance from the Azure Portal and then use my previous blog post to implement search suggestions in your own apps. You can also find plenty of videos on Youtube of the Azure Search team discussing the service and a full iOS sample on my Github.

This blog post was originally published on my personal blog and has been updated to reflect changes in Azure Search.

The post Creating a Five-Star Search Experience with Azure Search appeared first on Xamarin Blog.

Wait, I’ve changed my mind! State Machine Transition interruptions

I recently investigated a tricky bug reported by a user involving the combination of empty states, override layers, and transition interruptions. As I was digging in, I found that our documentation about transition interruptions in the animation system was a bit… minimalist. A long conversation with my team later, we concluded that a blog post was in order.

So let’s dive into some intricate details of State Machine Transitions and interruptions!

By default in the animation system, transitions cannot be interrupted: once you start going from one state to the other, there’s no way out. Like a passenger on a transatlantic flight, you’re cozily nestled in your seat until you reach your destination and you can’t change your mind. For most users, this is fine.

But if you need more control over transitions, Mecanim can be configured in a variety of ways to meet your needs. If you’re unhappy with your current destination, you can hop in the pilot’s seat and can change plans midway through your flight. This means more responsive animations, but also many opportunities to get lost in the complexity.  

So let’s walk through a few examples to sort that out. We can begin with a fairly simple state machine with four states, labeled A to D, and triggers hooked to every transition on the state machine.

image05

By default, when we trigger the A->B transition, our state machine transitions towards B and nothing can keep it from reaching its destination. But if we go on the A->B transition inspector and change the interruption source from “None” to “Current State”, our journey from A to B can be interrupted by some triggers on state A.

image01

Why only “some”? Because the “Ordered Interruption” checkbox is also checked by default. This means only transitions on state A that have a higher priority than the current one are allowed. Looking at the inspector of state A, we can see that this only applies to the A->C transition.
image02
So if we activate the A->B trigger, then shortly after the A->D trigger, our transition remains uninterrupted. However, if we press the A->C trigger instead, then the transition is immediately interrupted and the state machine starts transitioning towards C. 

 

Internally, the animation system records the pose at the time of the interruption, and will now blend between that static pose (X) and the new destination animation. image04Why a static pose, instead of a possibly smoother blend between the current and new transitions? Simply put: performance. When a game faces a cascade of interruptions, keeping track of several dynamic transitions taking place simultaneously would quickly made the animation system unscalable.

Now, if we uncheck that “Ordered Interruption” checkbox, then both A->C and A->D can interrupt the transition. However, if they are both triggered on the same frame, A->C will still take precedence because it has a higher priority.

If we change the interruption source to “Next State”, A->C and A->D can no longer interrupt the transition, regardless of their order. However, if we press the B->D trigger, we will immediately start transitioning from A to D, without completing the transition towards B.

Transition order matters on state B too. The “Ordered Interruption” checkbox is not available anymore (any triggered transition on B can interrupt the transition because they do not have a priority ranking relative to A->B), but the order of the transitions on B will determine which transition wins if both are triggered within the same frame. In this case, if B->D and B->C are triggered in the same frame, B->D will be selected.

image03

Finally, for complete control, we can set the Interruption Source to “Current State Then Next State”, or “Next State Then Current State”. In that case, the transitions will be analyzed independently on one state, then the other.

So, let’s assume we have the following configuration.

image00

During the A->B transition, a very excited player triggers four transitions within the same frame: A->C, A->D, B->C and B->D. What happens?

First, “Ordered Interruption” is checked, so we can ignore A->D right away: it has lower priority than A->B. The current state gets resolved first, so we do not even have to look at state B to know that transition A->C wins.

image02image03
However, with the same configuration, if only B->C and B->D get triggered, transition B->D will take place (it has greater precedence than B->C).  

Now, this is only for one transition… All other transitions can also be interruptible too, with their own specific rules. So if we make transition A->C interruptible from the next state, we can have transition A->B interrupted by A->C which in turn could be interrupted by C->D.

One important thing to keep in mind: regardless of interruptions taking place, the source state remains the same until the transition is complete, and Animator.GetCurrentAnimatorStateInfo() will always return that source state.

In short, transition interruptions settings are powerful and offer a lot of flexibility, but they can quickly become very confusing. So use transition interruptions wisely, and when in doubt, test it out in the Editor.

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