Company Hub – Private distribution of Windows Phone apps

Company Hub – Private distribution of Windows Phone apps

  • Comments 1
  • Likes

This blog post was authored by McLean Schofield, a Senior Content Developer on the Windows Phone team.

- Adam


In Windows Phone 8 a company can bypass the Windows Phone Store and deploy line-of-business (LOB) apps directly to employee phones. One of the key components of this process is a Company Hub. This is an app that shows employees what company apps are available to them, and then they can install or launch the apps. The Company Hub might also provide entry points to other company-specific experiences on the phone, such as displaying current company news, upcoming company events, and alerts from the IT department.

Companies that use Windows Intune or System Center 2012 Configuration Manager to manage phones use the default Windows Phone 8 Company Portal app provided by Microsoft to distribute company apps to their employees. However, companies that do not use one of these device management tools can create their own Company Hub. To demonstrate how developers can implement a Company Hub, the Windows Phone Developer Documentation team at Microsoft recently published a Company Hub sample. This article provides a high-level overview of the sample’s design.

Understanding company app distribution

If you are not yet familiar with the company app distribution model for Windows Phone 8, take a look at Company app distribution for Windows Phone on MSDN. This article provides a walkthrough of the steps required to distribute company apps, including registering a company account on Windows Phone Dev Center, generating and distributing an application enrollment token (AET) to employee phones, and signing company apps.

Note that companies that use Windows Intune or System Center 2012 Configuration Manager to manage phones follow a slightly different process that leverages the default Windows Phone 8 Company Portal app provided by Microsoft rather than building their own Company Hub. For more info about distributing company apps using one of these device management tools, see the following resources:

Company Hub sample design

Fundamentally, a Company Hub is a standard Windows Phone app that uses several APIs introduced in Windows Phone 8 to install and launch other apps that have the same publisher ID as the Company Hub. There are many different ways to design a Company Hub. How a company chooses to implement a Company Hub depends on what experience it wants to provide to its employees and how the company chooses to host its XAPs.

The Company Hub sample demonstrates one possible implementation. The following steps describe the design and flow of the sample. Most of the tasks described here are implemented in the MainPage.xaml.cs code file.

  1. The company app XAPs and icons are stored in a Windows Azure storage blob along with an XML file that contains a catalog of metadata for the apps (including the URL for each XAP, the URL for each app icon, and the name, description, and version number for each app). The XML file has the following structure.

    XML
    <?xml version="1.0"?>
    <Applications>
      <App Name="CompanyApp1"
           IconUrl="http://contosostorage.blob.core.windows.net/companyapps/CompanyApp1.png"
           XapUrl="http://contosostorage.blob.core.windows.net/companyapps/CompanyApp1_Debug_AnyCPU.xap" Version="1.0.0.0"
           ProductId="{f42567e5-14d8-4bfc-ad05-9dc2150c7614}" Description="This is CompanyApp1" />
      <!-- Additional App elements for each company app.-->
    </Applications>
    
  2. When the Company Hub starts, it downloads the XML file from the Windows Azure storage blob and parses the XML to populate a ViewModel (in the Model-View-ViewModel design pattern) that represents the available company apps. To review the ViewModel implementation, see ..\ViewModels\CompanyAppViewModel.cs in the sample).
  3. The Company Hub uses the InstallationManager.FindPackagesForCurrentPublisher method to determine which company apps are already installed on the phone, and it updates the ViewModel to specify whether each app is already installed or not. The InstallationManager.FindPackagesForCurrentPublisher method finds all installed app packages that have the same publisher ID as the Company Hub.
  4. The Company Hub binds the company app metadata to a LongListSelector. The user can scroll through this list to review the list of available company apps.
  5. When the user taps an app, the Company Hub does one of the following:
    • If the app is not installed yet, the Company Hub uses the InstallationManager.AddPackageAsync method to start the app installation process. In the IAsyncOperationWithProgress object returned by this function, the Company Hub also assigns Progress and Completed callback methods. These methods are called asynchronously during the app installation process to display a progress bar during the app installation.
    • If the app is already installed, the Company Hub uses the Package.Launch(String) method to launch the app.

Again, this sample demonstrates just one way to implement a Company Hub. For more design guidance and information about the APIs provided by Windows Phone 8 for creating Company Hubs, see Developing a Company Hub app on MSDN.

1 Comments
You must be logged in to comment. Sign in or Join Now
  • Hi,

    I suppose this article is written at right time, for me atleast, as i am in middle of company hub app dev and testing.

    I had implemented the company hub app, but while downloading an app multiple times, i receive an error in message box as "cant install the company hub app". After this neither i am able to reinstall the company hub app, nor any app from inside company hub app. I have to soft reset the handset in order to continue working on it. The number of downloads is random in nature... Sometimes its 5, sometimes its 10, and once it was giving error after downloading the app only once. I am not using Windows Intune or any other device management system.

    This issue has really messed up a lot of things. Can you please guide me if i am doing something wrong at some place?