Telerik UI for Windows Phone by Progress

The following topic will guide you through the process of setting up a Telerik Cloud Controls powered Windows Phone application by using the Telerik Cloud Powered Windows Phone App template in Visual Studio 2012.

Create a Telerik Cloud Controls powered Windows Phone app

The Telerik Cloud Controls enhanced installation package of Telerik UI for Windows Phone adds a couple of new project templates in Visual Studio 2012 which help you get started using the Telerik Cloud Enabled components. The following screenshot of the Visual Studio Add New Project wizard shows the new Telerik templates:

Synchronization-Cloud Wizard 1

  1. Create a new Windows Phone app using the Telerik Cloud Powered Windows Phone app Visual Studio project shown on the picture above.
  2. On the first windows of the Telerik Cloud Powered Windows Phone app Project Wizard, enter your Telerik credentials. Use the credentials you have created on the Telerik website:

    Synchronization-Cloud Wizard 2

  3. On the second Window choose a project to integrate with the newly created Windows Phone application:

  4. If you want to create a new Everlive project, use the Create new... button which opens a dialog asking for the name and description for the new Everlive project:

    Synchronization-Cloud Wizard 4.1

    If you want to continue with an existing project, select it from the list and finish the wizard.

The new Telerik Cloud Powered Windows Phone application

After finishing the Project Wizard a new Windows Phone application project is created that is prepared to work with the Telerik Everlive Cloud Services. If you open the App.xaml.cs file of your Windows Phone application project you will notice that it has been extended with the following code:

CopyC#
private void InitializeProvider()
{
    EverliveProviderSettings settings = new EverliveProviderSettings();
    settings.ApiKey = "$EverliveApplicationKey$";
    CloudProvider.Init(settings);
}

This code initializes the Cloud connection needed by all Telerik Cloud controls. Currently only the Telerik Everlive Cloud Services are supported. This project allows you to use the Telerik Cloud Controls for Windows Phone without taking care of writing Cloud connection logic.

Building and deploying a Telerik Cloud Controls-powered Windows Phone application

The project templates that come with the Telerik Cloud Controls CTP installation package create a fully functional Windows Phone projects that have all needed assembly references. Two types of build configurations are available:

  • x86 - used if you want to deploy and debug your application on the Windows Phone emulator
  • ARM - used to deploy on a real device. Should be used when you publish the XAP package on the Windows Store.

Manually creating an app that uses Telerik Cloud Controls for Windows Phone

If you don't have the cloud powered wizard or you want to create the application manually, you can create a simple Windows Phone application and add the connection to your preferred Cloud Service anually. The example below uses the Telerik Everlive Cloud Services as a Cloud Service provider.

Note
Currently only the Telerik Everlive Cloud Services are fully supported.

  1. First, add references to the necessary assemblies:

    • Telerik.Windows.Core
    • Telerik.Windows.Data
    • Telerik.Windows.Controls.Primitives
    • Telerik.Windows.Controls.Input
    • Telerik.Windows.Controls.Data
    • Telerik.Windows.Controls.ImageEditor
  2. You will also need to add the following assemblies from the correct folder ARM (if you deploy on device) and x86 (if you deploy on emulator):

    • Newtonsoft.Json
    • Telerik.Everlive.Sdk
    • Telerik.Windows.Core.Cloud
    • Telerik.Windows.Core.Cloud.Everlive
    • Telerik.Windows.Controls.Cloud
  3. You also need to make sure that the correct platform (ARM or x86) is selected as Active Solution Platform in the Configuration Manager:

    Cloud Controls Configuration Manager
  4. Now in order to create the storage application, go to Everlive.com and create a new application. When the application is created you will be able to select "API Keys" from the right-side menu. You will need that key to create the connection between the application that you have created with Visual Studio and the storage application created on Everlive.

  5. Then go to the App.xaml.cs file of your application and add the following method:

    CopyC#
    private void InitializeProvider()
    {
        EverliveProviderSettings settings = new EverliveProviderSettings();
        settings.ApiKey = "$EverliveApplicationKey$";
        CloudProvider.Init(settings);
    }

    Make sure you execute this method in the constructor of the App and replace the api key with the one that you have obtained at Everlive. This code initializes the Cloud connection needed by all Telerik Cloud controls. Currently only the Telerik Everlive Cloud Services are supported.