The C1Studio Xamarin Edition includes Xuni controls. In this blog post I’ll walk you through getting started using Xuni and Xamarin, from downloading to building an Android, iOS or cross-platform Xamarin.Forms app.
- Parts 1-3 focus on setting up Xuni's Xamarin controls and getting familiar with resources. It's a good read, especially for newcomers
- For part 4, I recorded three videos that dive into development with Xuni for each Xamarin Platform
- Lastly, in part 5, we'll cover licensing your app.
Part 1: Downloading and Setting Up Xuni
Xuni is distributed as NuGet packages for use with the Xamarin Platform. You must download and install Xuni with C1Studio at least once to not only get the latest packages, but to install the GrapeCity NuGet feed. Once you've installed Xuni, you can proceed to use the packages in one of two ways:
- Copy the installed packages (\Documents\Xuni\Xamarin\NugetPackages) to your local NuGet feed. Read more about hosting your own NuGet feeds. This option is ideal if you need strict control over the libraries being used in a project. If that isn't important, then you'll probably prefer the second option.
- Browse and add packages to your projects from the GrapeCity NuGet feed (http://nuget.grapecity.com/nuget/). When you install Xuni, we add this feed automatically to your NuGet sources inside Visual Studio and Xamarin Studio. Updating is very straightforward because you can continue to receive updates directly from NuGet rather than downloading them manually from goxuni.com. The NuGet manager inside Visual Studio lets you install specific versions even, so rolling back is also very easy.
In part 4, we'll look at how to work with the GrapeCity NuGet feed.
Part 2: Getting Familiar with the Documentation
As you continue working with Xuni's Xamarin controls beyond this tutorial, you'll undoubtedly need to check the documentation at some point. So it's good to know exactly where to look since we provide three different versions of the documentation: Xamarin.Forms, Android and iOS.
Keep in mind the Xuni documentation also includes code for Objective-C, Swift and Java, which you won't need to use in any Xamarin app. We provide C# code snippets alongside the Java, Swift or Objective-C code in the Android and iOS documentation.
Part 3: Running the Xuni Samples
If you're evaluating Xamarin Edition for the first time, the simplest and quickest way to test the controls on your personal device or emulator is to run the samples. When you install Xuni, the samples get installed at \Documents\Xuni\Xamarin\Samples\. Or, if you prefer, you can download the latest samples individually from GoXuni on GitHub. You can also just view the code on GitHub without having to download anything. At either location, we have several sample projects: one for each major control. They work in Xamarin Studio and Visual Studio. So long as you didn't remove the GrapeCity NuGet feed, you should be able to just open, build and run these projects. Your IDE will first automatically download the packages. Then you can dig into the code and play with the controls to see how they work. Xuni controls do require a runtime license key, which our samples have included. I'll cover more on licensing in part 4. There's also the Xuni Explorer demo app, which you can install from the app marketplace. This is helpful to quickly browse the capabilities, but it doesn't show the code. So now you can easily run our samples, but eventually you'll want to test the Xuni control in your app with your data. That's next.
Part 4: Working with Xuni in Your Xamarin Project
For this part, I've created three videos one for each Xamarin Platform. These videos walk you through:
- How to add a Xuni library to a Xamarin app
- How to add a Xuni control to a page of your app
- How to license your app to use Xuni (even as Evaluation)
Part 5: Licensing Your App
Licensing is a required step to evaluate or use Xuni's Xamarin controls within your own app. The Xuni controls contain runtime license validation per app. As I mentioned above, the samples already have a license key unique to that sample so they run "out of the box." You can generate runtime keys on componentone.com or goxuni.com. To generate a runtime key for your app:
- Log in to www.componentone.com. If you don't have an account, you'll need to create one. (It's free.)
- Click License Your App. This link can also be found on the Xamarin Edition page.
- Select Evaluation or Full, depending on the type of key you're generating.
- Select C# and enter the name of your app, which should also be the default namespace.
- Click generate.
The videos in part 4 also cover licensing from www.goxuni.com. 6. Take this key and copy it into your project. The simplest way to do this is to create a new class, named License.cs. The outputted text from the website includes the static class declaration so it’s very easy to just paste this into your editor. 7. Finally, in your code, before you initialize the Xuni control, set the Xuni.Core.LicenseManager.Key property to your key.
Xuni.Core.LicenseManager.Key = License.Key;
Now you should be up and running with Xuni in your Xamarin app! When you purchase Xuni, you'll get a serial number. Register that serial number at My Licenses, and when you generate new app keys, you'll be able to select your serial number rather than selecting Evaluation. For full steps on licensing, check out the documentation. Thanks for reading and thanks for evaluating C1Studio Xamarin Edition!