July 6, 2015

Connect to Customers with My Shoppe

By

Does your business have one or more storefronts? With the amount of competition today, it can be difficult to differentiate your shops from the masses. You need a convenient way to promote your business, enable customers to find you, and make it easy to find information about your offerings. What if you could combine all of this in a mobile app that also makes it easy for customers to engage with your stores when they have a great experience or need help?

My Shoppe Template App Hero Small

Introducing the My Shoppe Template App

Our newest template app, My Shoppe, solves this problem. My Shoppe enables you, as business owner or operator, to easily connect with your customer base in several ways. Create a browsable list of shop locations so customers can find the nearest location, call the shop, see shop hours, and even get directions to the shop with a single click. In addition, customers can easily provide feedback on the experience they have in-store.

My Shoppe is based on Xamarin.Forms, so 100% of its code can be shared across iOS, Android, and Windows Phone. Several powerful Plugins for Xamarin are leveraged to provide platform-specific features from the shared codebase.

Built on Azure Mobile Apps

AzureMobileAppsLeveraging Azure Mobile Apps as My Shoppe’s backend enables a super fast online/offline synchronized experience across all platforms from a single code base. Simply set up Azure Mobile Apps as your .NET backend and you’re ready to go.

Highly Customizable

My Shoppe leverages Xamarin.Forms to provide an incredible shared cross-platform user interface that is also highly customizable; for instance, you can adjust the colors to match your shop’s branding. My Shoppe was built to be backend-independent and the data store implements a simple interface, enabling you to swap out your backend for any other solution, such as json, Parse, Couchbase, or a local SQLite database.

And, of course, since My Shoppe is a template app, you can easily add and extend My Shoppe with your own unique features and enhancements using the familiar MVVM architecture that has been implemented.

Administer Easily

My Shoppe is more than a customer facing mobile app. It also includes a complete administration app for iOS and Android that enables you to work with the same source backend as the consumer app. Easily add and manage your shops from your mobile device and reply to customer feedback with a single click, or call them directly from the app.

My Shoppe Template App Admin Hero

In Action

Take a peek at My Shoppe in action:

Give it a Spin

You can build your own mobile app for your shop today by downloading the entire template app source code from GitHub. Want to give it a try without downloading the code? You can download our sample My Shoppe app today on the App Store for iOS Devices, Android’s Google Play or Windows Phone Marketplace.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
July 2, 2015

Xamarin Test Cloud Now Available to All Xamarin Developers

By

We started Xamarin because we want to help developers build apps they can be proud of and provide you with the tools you need to ensure that your apps do what they were designed to do.

A user’s perspective about you or your business is greatly impacted by your mobile app. A crash, a hang, or broken functionality will cause low app ratings or even user abandonment. Most developers aren’t doing systematic testing of their mobile apps because current tools and services are too hard to use.

That’s why we’re happy to announce that as of today, all Xamarin Platform subscriptions include 60 Xamarin Test Cloud device minutes per month. Every Xamarin developer can immediately take advantage of this new benefit to start automating UI testing for mobile apps written on any platform on our industry-leading catalog of over 1,600 real iOS and Android smartphones and tablets.

How it Works

Starting a new app in Xamarin Studio creates a C# Xamarin.UITest project with a basic test to make sure your app loads and give you a starting point for writing additional tests. You can upload your tests directly from Xamarin Studio and Visual Studio, incorporating mobile testing directly into your development processes to quickly verify apps work on a variety of hardware.

Executing a test is now as easy as a build or debug operation in Xamarin Studio or Visual Studio, and your Xamarin.UITest project can reside in the same solution as your Xamarin app, making it easy to keep your app code and tests in sync.

Upload C# Xamarin.UITest mobile tests directly from Xamarin Studio and Visual Studio

Upload C# Xamarin.UITest mobile tests directly from Xamarin Studio and Visual Studio

 

You specify the devices you want to test when initiating a test run, either by market share data we maintain for multiple geographies, or by the extensive filtering available for device type, manufacturer, OS version, processor, and other factors.

Select which devices to test in Test Cloud

Select which devices to test in Xamarin Test Cloud

 

Xamarin Test Cloud makes it easy to quickly find visual inconsistencies by comparing results across dozens of devices at a time after your test has executed, displaying screenshots synchronized to the same test steps. The service also offers video recordings of tests, making it easier to review the overall user experience on a variety of devices.

Xamarin Test Cloud

Xamarin Test Cloud test results

 

We’ve been using Xamarin Test Cloud internally on our sample apps to make sure they run properly and look great. One of these test runs uncovered that the screen rendered correctly on an iPhone 6, but had unexpected whitespace on an iPad. Bugs like these wouldn’t have been found without Xamarin Test Cloud, which enabled us to quickly diagnose the issue and correct the code.

Xamarin Test Cloud

What’s a Device Minute?

Device minutes are only consumed when the test runs on an actual device, regardless of whether you’re running tests serially on one device, or parallelized for faster results. If you need more minutes, you can sign up for one of our Xamarin Test Cloud plans.

Get Started

To start using your Xamarin Test Cloud device time today, visit testcloud.xamarin.com. Our online documentation also has great guides on how to write mobile tests in C# to test any app, whether or not it’s built with Xamarin.

We’ll be doing a live webinar on Wednesday, July 8 at 8:30 am PT covering different mobile testing methodologies and providing an in-depth overview of how Xamarin Test Cloud works. We’ll also discuss the exciting plans in our product roadmap. Click here to register.

Keep building great apps!

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
July 1, 2015

iOS 9 Preview Now Available

By

ios9 iconWe’re excited to announce that we have just published our first iOS 9 API preview release in Xamarin.iOS. This preview includes support for an array of exciting new features that you can start developing with today, including CoreSpotlight, Model I/O, and ReplayKit as well as improvements to Contacts APIs.

Installing the iOS 9 Preview

You can download the iOS 9 Preview for Xamarin Studio directly from the Xamarin Developer site. Upcoming previews will add even more support for iOS 9, including support for Visual Studio.

Important: Service Release for iOS 9 Compatibility

In addition to our iOS 9 preview release, we have also published an iOS release to our update channels addressing two issues that cause many Xamarin apps to crash on startup on Apple’s OS preview for iOS 9.

At WWDC last month, Apple announced that a public preview of iOS 9 will be made available to iOS users this July. To ensure your published apps run smoothly on Apple’s iOS 9 public preview this month, we recommend that Xamarin.iOS developers download the latest release from our Stable updater channel and rebuild and resubmit their apps to the App Store using Xcode 6. This will enable your apps to run on the iOS 9 OS preview and ensure your apps are ready for the public release of iOS 9 this fall.

You can read more about these updates in our iOS 9 Compatibility Guide.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 30, 2015

Summer Fun with Xamarin Events in July

By

It’s July already! The year is already half over, so there won’t be a better time to get out and meet fellow Xamarin developers in your area to learn about crafting beautiful, cross-platform native mobile apps in C# at one of the local conferences, workshops, or user group events happening around the world!

meetup-banner-july2

 

Here are a few events happening this month:

Geek-a-Palooza! ad

  • Sant Julià de Lòria, Andorra: July 4th
  • Hands on Lab: Xamarin & Push Notifications

Mobile & Cloud Hack Day br

  • Hauer, Boqueirão Curitiba, Brazil: July 4th
  • A FREE event on how to create cross-platform apps for Android, iOS, and Windows using C#, Xamarin, and Visual Studio

Seattle Mobile .NET Developers us

  • Seattle, WA: July 7th
  • Introduction to Xamarin.Forms: iOS, Android, and Windows in C# & XAML with Xamarin Evangelist James Montemagno

Montreal Mobile Developers ca

  • Montreal, Canada: July 8th
  • Azure Mobile Services & Mobile Apps with Xamarin

XLSOFT Japan Japan

  • Tokyo, Japan: July 8th
  • Windows Phone / iOS / Android Cross-Platform App Development Using Xamarin.Forms

Birmingham Xamarin Mobile Cross-Platform User Group Flag of the UK

  • Birmingham, UK: July 8th
  • Developing for iBeacons with Xamarin

Introductory Training Session to Xamarin Germany

  • Hanover, Germany: July 13th
  • Xamarin Workshops by H&D International

DC Mobile .NET Developers Group in

  • Washington, DC: July 14th
  • NEW GROUP! Getting Started with Xamarin.Forms by Xamarin MVP, Ed Snider

Sydney Mobile .NET Developers au

New York Mobile .NET Developers us

  • New York, NY: July 28th
  • Building Native Cross-Platform Apps in C# with Xamarin by Xamarin MVP, Greg Shackles

 

Even more Xamarin events, meetups, and presentations are happening this month! Check out the Xamarin Events Forum to find an event near you if you don’t see an event in your area in the list above.

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

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 29, 2015

What’s New in Google Play services

By

There are a plethora of amazing APIs built right into the core operating system to take advantage of when developing for Android, and Google Play services (GPS) allows for the addition of even more unique experiences.

What is Google Play services?

GPS LogoGPS is a continuously updated library from Google that enables adding new features to Android apps without waiting for a new operating system release. One of the most well known feature of GPS is Google Maps, which allows developers to add rich, interactive maps to their apps. Since GPS is a separate library that’s updated regularly, there are always new APIs to explore. The most recent release, 7.5, has tons of great new features.

Getting Started with Google Play services

In previous releases of GPS, everything was bundled into one huge NuGet and Component Library to be added to an app. However, this has now changed and each API has been broken into its own unique NuGet package, so you can pick and choose which features to add to an app without increasing app size or worrying about linking. To get started with GPS, simply open the NuGet Package Manager and search for “Xamarin Google Play services”. A list of new packages available for Android apps will be displayed, and you can choose to install the “All” package or select only the ones you want.

GPS

To learn more about the changes to the GPS packages and APIs, Xamarin Software Engineer Jon Dick’s blog post on the topic is a great place to start.

Once you have GPS installed, you can take advantage of tons of new APIs for your Android app, including some that I’m particularly excited about, outlined below.

Google Fit

fitness_64dpDevelopers of fitness apps will be excited to see that Google Fit has been updated with a brand new Recording and History API that enables gathering estimated distance traveled and calories burned in a simple API. This is in addition to the other APIs already available to discover sensors, collect activity data, and track a user’s fitness.

Android Wear Maps

Maps Android WearUntil now, there wasn’t a good way to show users their current location on a map on their Android Wear devices. The latest release, however, brings the entire Maps API to Android Wear, including support for interactive maps and non-interactive maps in Lite mode.

Google Cloud Messaging Updates

GCM
One of my favorite features of GPS has to be Google Cloud Messaging (GCM) for sending push notifications to Android devices, and there have been several updates to GCM in Google Play services 7.5. The new Instance ID tokens enable a single identity for your app across its entire lifetime instead of having a unique registration ID for each device. This simplifies the process of sending push notifications to all of the devices on which an app is installed.

So Much More

These aren’t the only additions to GPS with this release. Several new APIs have been added, including App Invites, Smart Lock for Passwords, and updates to Google Cast. The full list can be found in in the Google Play services documentation.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 26, 2015

Build and Debug C++ Libraries in Xamarin.Android Apps with Visual Studio 2015

By

Today, the Microsoft Hyperlapse team shared the story of how they developed their app with C++ and Xamarin. Microsoft Hyperlapse Mobile turns any long video into a short, optimized version that you can easily share with everyone. It can transform a bumpy bike ride video into a smooth and steady time-lapse, like this one from Nat Friedman that was shot using GoPro and processed with Microsoft Hyperlapse Pro.

The core algorithmic portions of Hyperlapse are written in Visual C++ Cross-Platform Mobile and the majority of the app business logic was retained in a .NET portable class library. Using Xamarin, the Hyperlapse team was able to leverage the core C++ code and app logic, while providing C#-based native UIs so users of the app feel at home on each platform. Leveraging C++ code in your Xamarin app is easy, as outlined in the below explanation on implementing C++ in your Xamarin.Android apps.

Using Native Libraries

Xamarin already supports the use of pre-compiled native libraries via the standard PInvoke mechanism. To deploy a native library with a Xamarin.Android project, add the binary to the project and set its Build Action to AndroidNativeLibrary. You can read Using Native Libraries for more details. This approach is best if you have pre-compiled native libraries that support either or all architectures (armeabi, armeabi-v7a, and x86). The Mono San Angeles sample port explains how the ibsanangeles.so dynamic lib and its native methods are accessed in Xamarin.Android.

In this approach, dynamic libraries are typically developed in another IDE, and that code is not accessible for debugging. This imposes difficulty on developers, as it becomes necessary to context switch between code bases for debugging and fixing issues. With Visual Studio 2015, this is no longer the case. Through our collaboration with the Visual C++ Cross-Platform Mobile team at Microsoft, Xamarin developers in Visual Studio now have the power to write, compile, debug, and reference C/C++ projects in Xamarin.Android from within their favorite IDE.

Using Visual C++ Cross-Platform Mobile

As stated above, Visual Studio 2015 supports the development of C/C++ projects that can be targeted to Android, iOS, and Windows platforms. Be sure to select Xamarin and Visual C++ for Cross-Platform Mobile Development during installation.

Visual C++ for Cross Platform Mobile Development

For this post, we’re using the same San Angeles port sample referenced earlier in the Using Native Libraries section. However, its original C++ code is ported to a Dynamic Shared Library (Android) project in Visual Studio. When creating a new project, the Dynamic Shared Library template can be found under Visual C++ → Cross-Platform.

Mono San Angeles Demo

San Angeles is an OpenGL ES port of a small, self-running demonstration called “San Angeles Observation.” This demo features a scenic run-through of a futuristic city with different buildings and items. The original version was made for desktop with OpenGL, and the current version is one of Google’s NDK samples optimized for Android. The source code is available here, ported to Visual Studio.

Now that the Dynamic Shared Library that contains the source code has been directly referenced from the Xamarin.Android project, it works as smoothly as any other supported project reference.

Visual Studio 2015 VC++ Cross-Platform Mobile

To interop with native libraries in your Xamarin.Android project, all you need to do is create a DllImport function declaration for the existing code to invoke, and the runtime will handle the rest. Set the EntryPoint to specify the exact function to be called in the native code.

[DllImport ("sanangeles", EntryPoint = "Java_com_example_SanAngeles_DemoGLSurfaceView_nativePause")]
static extern void nativePause (IntPtr jnienv);

Now, to call the native function, simply call the defined method.

public override bool OnTouchEvent (MotionEvent evt)
{
	if (evt.Action == MotionEventActions.Down)
	nativePause (IntPtr.Zero);
	return true;
}

Refer to Interop with Native Libraries to learn more about interoperating with native methods.

One More Thing…

Now that you have access to the native source code, it’s possible to debug the C/C++ code inside Visual Studio. To debug your C/C++ files, choose to use the Microsoft debugger engine under the Android Options of Project properties.

VC++ Native Debugging options

Enable a breakpoint inside your C++ project, hit F5, and watch the magic happen!

Learn More

Refer to the VC++ team’s blog post at MSDN for a step-by-step guide to building native Android apps in Visual Studio 2015. The source code for the Mono San Angeles port explained in this post is available for download in our samples.

Discuss this post in the Xamarin Forums.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 23, 2015

Android M Preview Now Available

By

Today, we’re excited to announce the preview release of Xamarin.Android featuring support for Android M’s developer preview. Android M is an exciting release, that introduces several new features for Android developers including new app Permissions, Fingerprint Authorization, enhanced Notifications, Voice Interactions, and Direct Sharing.

Android M

Installing the Android M Preview

  • Starting with Android Lollipop, Java JDK 1.7 is required to properly compile apps. You can download one for your system from Oracle’s website.
  • Update your Android SDK Tools to 24.3.3 from the Android SDK Manager
  • Install the latest Android SDK Platform and Platform and Build-tools

mnc-preview-tools

  • Download the Android M (API 22, MNC preview) SDKs
  • mnc-preview-packages

Getting Started

With this preview installed, you should have the new APIs available to use in your Xamarin.Android apps. Check out our release notes, download links, and more details on our Introduction to Android M documentation to guide you through setup and the new APIs.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone

Live Webinar: Why Mobile Quality Matters

By

This live webinar will cover how to create a successful and sustainable mobile development strategy that enables quick delivery of great apps that work on across today’s diverse device landscape. Key to this process is a mobile quality solution like Xamarin Test Cloud that identifies bugs, visually compares results from hundreds of devices at once, increases delivery agility and velocity by eliminating manual testing, and integrates with your Continuous Integration (CI) systems.

The webinar will cover the different approaches and advantages to mobile testing, from manual testing, device remoting, and simulators to fully automated testing with real devices and how to create quality consumer-grade mobile apps.

Wednesday, July 08
8:30 AM – 9:30 AM PT

Register

TestCloudReport
All of the registrants for the webinar will receive a copy of the recording, so please feel free to register even if you won’t be able attend the day of the event.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 22, 2015

Extending Xamarin.Forms Controls with Custom Renderers

By

Xamarin.Forms allows you to build native UIs from a single, shared codebase with over 40 pages, layouts, and mix-and-match controls. One of the most powerful aspects of Xamarin.Forms is that you not only have access to the controls that we surface, but you have 100% access to all of the native APIs on each platform as well.

Moments Sign Up Page

Accessing Native APIs in Shared Code

Accessing native APIs using Xamarin.Forms is done in one of three ways: the dependency service, custom renderers or through plugins for Xamarin. The dependency service in Xamarin.Forms allows shared code to easily resolve interfaces to platform-specific implementations, so you can easily access platform-specific features like text-to-speech, geo-location, and battery information from your PCL or Shared Project.

User interfaces built with Xamarin.Forms look and feel native because they are native — they’re rendered using the native controls for each platform. For example, if you use an Entry control in Xamarin.Forms, on iOS this will be rendered as a UITextField, on Android as an EditText, and on Windows Phone as a TextBox. Developers can easily tap into these native renderings of Xamarin.Forms controls by using custom renderers, which can be used to do everything from small tweaks of the existing control or building entire pages.

Implementing a Custom Renderer

In Moments, a Snapchat clone built with Xamarin.Forms and Microsoft Azure, I made extensive use of the built-in Xamarin.Forms controls. However, there were a few places I wanted a finer level of customization. Let’s look at how easy it is to tweak the Entry control’s placeholder font and color using custom renderers in the sign up page featured above. Each custom renderer has two main parts: a subclass of the control being extended and platform-specific implementations that are used to customize a control’s appearance.

Subclassing Existing Controls

In the Shared Project or PCL where your Xamarin.Forms user interface logic resides, create a subclass of the control that you wish to extend, as seen below:

public class MomentsEntry : Entry
{
    public MomentsEntry ()
    {
        TextColor = Color.White;
    }
}

Platform-Specific Implementation
To customize the control’s appearance, we must create custom renderers on each platform for which we wish to customize the given control. Each Xamarin.Forms control has a renderer class that can be subclassed on each platform, such as EntryRenderer.

public class MomentsEntryRenderer : EntryRenderer
{
}

Next, override the OnElementChanged method. This method is where all the customization for the control takes place. All customization is done using the Control property, which is just an instance of the native mapping for the particular renderer subclassed. For example, on iOS, this would be a UITextField and on Android an EditText. Altering the placeholder color and font was as easy as altering a few properties, as seen below in both the iOS and Android implementations:

iOS

public class MomentsEntryRenderer : EntryRenderer
{
    protected override void OnElementChanged (ElementChangedEventArgs<Entry> e)
    {
        base.OnElementChanged (e);
        if (Control != null)
        {
            Control.BackgroundColor = UIColor.FromRGB (119, 171, 233);
            Control.BorderStyle = UITextBorderStyle.None;
            Control.Font = UIFont.FromName ("HelveticaNeue-Thin", 20);
            Control.SetValueForKeyPath (UIColor.White, new NSString ("_placeholderLabel.textColor"));
            Control.Layer.SublayerTransform = CATransform3D.MakeTranslation (10, 0, 0);
        }
    }
}

Android

public class MomentsEntry : EntryRenderer
{
    protected override void OnElementChanged (ElementChangedEventArgs<Entry> e)
    {
	    base.OnElementChanged (e);
	    if (Control != null)
        {
	        Control.SetHintTextColor (ColorStateList.ValueOf  (global::Android.Graphics.Color.White));
	        Control.SetBackgroundDrawable (null);
        }
    }
}

Finally, to enable Xamarin.Forms to properly find and render your custom control, you must add the [assembly] attribute above the class. The first parameter references the Xamarin.Forms control you wish to alter the renderer for, while the second parameter references the platform-specific renderer for the custom control:

[assembly: ExportRenderer (typeof (Moments.MomentsEntry), typeof (Moments.iOS.MomentsEntryRenderer))]

The Results

Before and after custom renderer

Wrapping It All Up

Custom renderers in Xamarin.Forms make it easy to extend existing Xamarin.Forms controls, create your own controls, or even build entire pages using native APIs. To get started, be sure to check out the docs or watch this video from Xamarin’s Mark Smith, and you’ll be up and running with custom renderers in no time!

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone
June 19, 2015

Newest Content from our Community

By

When Xamarin developers aren’t building amazing iOS and Android apps in C#, they’re helping out fellow Xamarin developers with engaging blog posts and articles, creating open-source projects, and building cross-platform plugins or components. The links below will take you to some of our favorite content from our community over the past few weeks.

Podcasts

Prism for Xamarin.Forms

Prism for Xamarin.Forms with Brian Lagunas

Great Community Posts

Jesse Liberty: Lists in Xamarin Watch

Lists on the Apple Watch

Azure Offline Editing and Syncing

Azure Offline Editing and Syncing

Tools and Frameworks

 

Thanks to these developers for sharing their Xamarin knowledge with the rest of the developer community. If you have an article or blog post related to Xamarin development that you would like to share, please let us know by tweeting @XamarinHQ, and it may be featured in an upcoming community content roundup.

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someone