Get your App Package Family Name

In this blog, i’ll show you how to get you App PackageFamilyName in Windows 10 in C# Code without Store, because it’s not available yet for Windows 10 

Before:

In Windows and Windows Phone, we used to get App PackageFamilyName from the Store by “Associating the App, and get the unique PFN of the App”

Why do i need PFN:

If you are intending to use communication between Apps, or using App Services, you’ll absolutely need the PFN to connect the App and Service you are using or whatever the scenario you are building.

Let’s Get Started:

  1. Open Visual Studio 2015 CTP, Create new project, select Windows 10 (Blank Template)
  2. Open MainPage.xaml.cs and these namespaces.
    using Windows.ApplicationModel;
    using Windows.UI.Popups;
    

    The first, because we will be using a class inside it called Package
    and the second, to show MessageDialog.

  3. Then, in Public MainPage() add this code.
    var currentPack = Package.Current;
    var pfn = currentPack.Id.FamilyName;
    new MessageDialog("PFN = " + pfn).ShowAsync();
    

    This code to show the PFN in a Message Dialog using Package Class.

  4. Now, run the demo, and the PFN should appear in a Message Dialog as shown:
    pfn

Now, you have got your App PFN, you can use it to connect to other App using App Services.
Here’s the Code Sample.
Feel free to contact me, if you face any problem.

Integrating Cortana | Part 3

Cortana

In the two previous blog posts, you should be finished of the first two steps of integrating Cortana.

So, in this blog post, you will perform the last step of integrating Cortana and the most important one which is How to Handle the voice commands.

What we did in the two past blog posts is:

  1. We Created the VCD file which contains the Voice Commands Which the user should say to Cortana.
  2. Then, we registered this VCD file on App Startup to let the System/Cortana recognize which command is activated by the user later.

And Now, we will walk through How to Handle the Voice Command when the user Activate it by saying it to Cortana,  in other words, What the action should be performed when the user say a specific Command. Continue reading