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 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 =>
{
    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.

July 12

RecyclerView: Highly Optimized Collections for Android Apps

I’ve spent hours of development time trying to optimize Android’s ListView to make scrolling through items smooth, followed by similar amounts of time attempting to optimize and configure Android’s GridView if I wanted to display more than one column of data at a time. These days of struggling to remember the correct pattern (and copy and pasting code from adapter to adapter) are now over, thanks to the introduction of Android’s RecyclerView. The RecyclerView has been around for a while now, having been introduced in Support Library v7 as a NuGet package, so you can use it in all of the applications you’re currently developing. Today, we’ll take a look at integrating the RecyclerView into an app with some similar paradigms of the ListView.

RecyclerView Recycling

Adding the NuGet

The first step is to add the NuGet package to your Android project. This will give you direct access to the widget in code and for Android XML.

NuGetRecyclerView

Integrate RecyclerView Widget

Just like any other Android widget, you can simply add the RecyclerView directly into your existing Android XML or even replace your ListView with a RecyclerView:



    
    

Item Layout

For this app, I’m displaying a list of images that are inside of a CardView to add a nice drop shadow:



    
        
            
            
        
    

Bringing It All Together

With the main layout and item layout all set up, it’s time to bring them together and start displaying items. The RecyclerView has three required classes that need to be implemented for each:

03-recyclerview-diagram

  • RecyclerView.ViewHolder: Caches references to the views in your item layout file so that resource lookups are not repeated unnecessarily.
  • RecyclerView.Adapter: Provides a binding from your app’s data set (which is specific to your app) to item views that are displayed within the RecyclerView.
  • RecyclerView.LayoutManager: Positions items within the RecyclerView.

RecyclerView ViewHolder & Adapter

The RecyclerView ViewHolder seem familiar if you have optimized ListViews in the past. This class must be a subclass of RecyclerView.ViewHolder and has one job, which is to cache all views by finding them by their ID.

public class ImageAdapterViewHolder : RecyclerView.ViewHolder
    {
        public ImageView Image { get; private set; }
        public TextView Caption { get; private set; }
        public ImageAdapterViewHolder(View itemView) : base(itemView)
        {
            Image = itemView.FindViewById(Resource.Id.imageView);
            Caption = itemView.FindViewById(Resource.Id.textView);
        }
    }

This ViewHolder is used in the main adapter, which actually inflates the view and sets the properties on each widget. It must inherit from RecyclerView.Adapter and then implement three methods to handle layout inflating, binding, and the count of items that are to be displayed.

class ImageAdapter : RecyclerView.Adapter
    {
        Image[] images;
        Activity activity;
        public ImageAdapter(Activity activity, Image[] images)
        {
            this.images = images;
            this.activity = activity;
        }
        // Create new views (invoked by the layout manager)
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            //Setup and inflate your layout here
            var id = Resource.Layout.item;
            var itemView = LayoutInflater.From(parent.Context).Inflate(id, parent, false);
            return new ImageAdapterViewHolder(itemView);
        }
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            var item = images[position];
            // Replace the contents of the view with that element
            var holder = viewHolder as ImageAdapterViewHolder;
            holder.Caption.Text = item.Title;
            Picasso.With(activity).Load(item.ImageLink).Into(holder.Image);
        }
        public override int ItemCount => images.Count;
    }

With the adapter in place, it’s time to tie it together with the RecyclerView in the Main Activity:

[Activity(Label = "Image Search", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : AppCompatActivity
    {
        RecyclerView recyclerView;
        RecyclerView.LayoutManager layoutManager;
        ImageAdapter adapter;
        Image[] images;
        protected override int LayoutResource
        {
            get { return Resource.Layout.main; }
        }
        int count = 1;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Id.main);
            //Create Images here
            images = new [] { new Image { Caption = "Baboon", Image = "http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Portrait_Of_A_Baboon.jpg/314px-Portrait_Of_A_Baboon.jpg" } };
            //Setup RecyclerView
            adapter = new ImageAdapter(this, images);
            recyclerView = FindViewById(Resource.Id.recyclerView);
            recyclerView.SetAdapter(adapter);
        }
    }

Managing the Layout

The last part of the RecyclerView is to set the LayoutManager. This allows complete customization of how items in the list are laid out. Built into the RecylerView library are a few default layout managers to get started, including the LinearLayoutManager and the GridLayoutManager.

LinearLayoutManager

This manager will layout items either horizontally or vertically:

layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
recyclerView.SetLayoutManager(layoutManager);

LinearLayoutManager

GridLayoutManager

This manager allows a set number of columns in a list, which is great for displaying multiple images in a list:

layoutManager = new GridLayoutManager(this, 2);
recyclerView.SetLayoutManager(layoutManager);

GridLayoutManager

The beautiful part of the LayoutManager is that you can change them at any time for customization depending on the type of device the app is running on.

Learn More

This is just the beginning of what’s possible with the RecyclerView and its immense power. Be sure to read through our complete documentation on how to customize the item decoration, add click handlers, and a lot more. You can find the source code for this example on my GitHub page.

The post RecyclerView: Highly Optimized Collections for Android Apps appeared first on Xamarin Blog.

How Game Hive keeps on buzzing – and experiences real success

Game Hive has been pioneering the new era of mobile gaming since 2008. Starting with just two co-founders, Game Hive has now grown into a thriving, rapidly growing free-to-play game leader with 100+ million downloads on iOS and Android. Their success started with Beat the Boss, and most recently Tap Titans. But as downloads continued to pour in, they found it difficult to keep up with the success and stay true to their vision.

“All we ever really wanted to do was to make great games the way we dreamed about them when we were kids,” says co-founder and Head of BD & Operations, Mark Wang.

Although they grew rapidly in terms of game popularity, Game Hive still believed a small team was the best way to work. They felt that this was the only way to keep the long meetings and bureaucracy to a minimum, and the creativity alive.

A move to Unity in 2010 helped them maintain a focus on high quality game design, programming and art. Plus, the integrated Unity Ads enabled them to monetize without alienating players or detracting from the game experience.

Game-hive-blog

 

The result has been that their time-to-market has decreased exponentially, and their video ads have resulted in increased player engagement and lifetime value. As Wang put it, “Hands down the best ad format is rewarded video because it’s unintrusive and extends the player’s lifetime value (LTV).”

Read the full case study

July 11

Top 5 reasons to present at Unite ’16 in Los Angeles

Time to step up and take center stage! We’re looking for speakers who can share tips, tricks, insights and stories about their experiences working with the Unity engine. Here’s five reasons to apply to speak in LA:

  1. Get a free pass to the show: As a featured speaker at the event, not only will you stand out, you’ll also get a free VIP ticket to Unite LA worth up to $475.
  2. Make new contacts: As a featured speaker at the event, you and your team will stand out, making it easier to network and make new industry acquaintances.
  3. Share your knowledge: Do you have an interesting story, or some knowledge or vision that can inspire and educate fellow Unity developers? Why not give yourself a push forward and share it? You never know what it could lead to.
  4. Showcase your project: This is a great opportunity to gain exposure, generate interest for your team, and put your work in the spotlight.
  5. Get feedback: There’s no doubt that you can get technical input if that’s what you’re looking for, but there’s also entrepreneurs, artists, audio experts, and others at Unite LA who will be interested in your story. The subject of your presentation will set the tone for the type of feedback you get.

Talk about your Unity project from start to finish, focus on a particular challenge, demo your crazy Unity project, dazzle us with your technical expertise, showcase your visual talents, surprise us with something new — it’s up to you! This is a great opportunity to connect with your peers, and engage with the Unity team.

Apply to be a speaker now

Let Me Translate That For You: Getting Started with Microsoft Translator Service

Many of us love to travel, but often encounter a language barrier when we do. For many years, translation was tedious and potentially expensive, requiring either manual translation with a paper dictionary or a translator. Today, with the combined power of the cloud and mobile, translation can occur in only a few lines of code. As mobile developers, there are many opportunities for us to take advantage of translation in our apps. In this blog post, we’ll use the Microsoft Translator Service offered by the Microsoft Azure DataMarket to translate text from one language to another.

Step 1: Register the App

To translate text into different languages, first, subscribe to ‘Microsoft Translator’ service. There are various packages, so you can select the one that suits your requirements. For this sample, we can subscribe to the generous free tier, which translates 2,000,000 characters per month for free.

Microsoft Translator Plans

Once you’re subscribed to the plan, visit the ‘My Account’ page and register a new app by navigating to Developer->Register. Enter the information about your app and be sure to copy your Client ID and Client Secret for later.

Register Translator App

Step 2: Create a Translation Service

Let’s add TranslatorService.cs to our Xamarin.Forms project, which will authenticate the app and allow the user to call the service by providing necessary details. To authenticate, we’ll use the Client ID and Client Secret noted in the previous step and send it as encoded body for the request. We then parse the response and extract an AccessToken from it, which we can use to authenticate calls to the Microsoft Translator service.

var properties = new Dictionary<string, string>
{
  { "grant_type", "client_credentials" },
  { "client_id",  _clientId},
  { "client_secret", _clientSecret },
  { "scope", "http://api.microsofttranslator.com" }
};
var authentication = new FormUrlEncodedContent(properties);
var dataMarketResponse = await _client.PostAsync(_dataMarketUri, authentication);
string response;
if (!dataMarketResponse.IsSuccessStatusCode)
{
   response = await dataMarketResponse.Content.ReadAsStringAsync();
   var error = JsonConvert.DeserializeObject<JToken>(response);
   var err = error.Value<string>("error");
   var msg = error.Value<string>("error_description");
   throw new HttpRequestException($"Azure market place request failed: {err} {msg}");
}
response = await dataMarketResponse.Content.ReadAsStringAsync();
var accessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<DataMarketAccessToken>(response);
return accessToken.access_token;

As complicated as translation is, it’s surprisingly easy to use Microsoft Translator to translate text. We can call the APIs in just a few lines of code and parse the XML response which contains the translated string.

string auth = await GetAzureDataMarketToken();
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", auth);
var requestUri = "http://api.microsofttranslator.com/v2/Http.svc/Translate?text=" +
                                System.Net.WebUtility.UrlEncode(strSource) +
                                "&to=" + language;
string strTransText = string.Empty;
try
{
   var strTranslated = await _client.GetStringAsync(requestUri);
   var xTranslation = XDocument.Parse(strTranslated);
   strTransText = xTranslation.Root?.FirstNode.ToString();
   if (strTransText == strSource)
                    return "";
   else
                    return strTransText;
}
catch (Exception ex)
{
              //
}
return strTransText;

Step 3: Call the Translation Service

After we create the translation service, all that’s needed is to create a user interface and call the service.

TranslateThis Microsoft Translator Service App

Wrapping Up

With services like Microsoft Translator, you can now build your own translator app capable of detecting the input language and translating it to another chosen language. You can find more information about these APIs and the languages supported here. You can also download this sample from GitHub.

The post Let Me Translate That For You: Getting Started with Microsoft Translator Service appeared first on Xamarin Blog.

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