IT tutorials
 
Technology
 

Windows Phone 8 : Background File Transfer Sample Code - Retrieving the User’s Windows Live Anonymous ID

3/23/2014 9:23:38 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

To associate a database file on the server with the user of the device, the app retrieves the user’s Windows Live anonymous ID from the Microsoft.Phone.Info.UserExtendedProperties class. The Windows Live anonymous ID is a representation of the user’s Windows Live ID that does not include any user identifiable information. When a user activates a device, he must provide a Windows Live ID. The Windows Live anonymous ID lets you identify the user by his Windows Live account, without actually seeing his details, and there is no way to correlate the anonymous ID with the Windows Live ID.

When retrieving the anonymous ID from UserExtendedProperties by way of the ANID2 key value (see Listing 1), the resulting string is the hashed representation of the anonymous ID.


Note

New to Windows Phone 8 is the ANID2 property that is a hashed version of the Windows Phone 7.5 ANID property. ANID2 is hashed with your publisher ID to ensure that different publishers cannot track users across different apps. You can no longer use the ANID property to retrieve the Windows Live anonymous ID in Windows Phone 8. ANID can be accessed only from Windows Phone OS 7.0 and Windows Phone OS 7.1 apps that use the Microsoft Advertising SDK for Windows Phone.


LISTING 1. DeviceProperties Class


public class DeviceProperties : IDeviceProperties
{
    /// <summary>
    /// Gets the windows live anonymous ID.
    /// This method requires ID_CAP_IDENTITY_USER
    //  to be present in the capabilities of the WMAppManifest.
    /// </summary>
    /// <returns>The string id for the user.</returns>
    static string GetWindowsLiveAnonymousId()
    {
        object result;
        UserExtendedProperties.TryGetValue("ANID2", out result);

        return result != null ? result.ToString() : null;
    }

    string windowsLiveAnonymousId;

    public string WindowsLiveAnonymousId
    {
        get
        {
            return windowsLiveAnonymousId
                    ?? (windowsLiveAnonymousId = GetWindowsLiveAnonymousId());
        }
    }
}



Tip

It is better to associate data with the user of the device rather than the device itself. By relying on the ID of the user, rather than the ID of the device, you can provide a greater level of assurance that if the phone changes ownership, the new user of the phone will not have access to previous owner’s data.


Retrieving the anonymous ID from the UserExtendedProperties does not work on the emulator. For testing purposes, the IDeviceProperties implementation can be swapped with a mock implementation that retrieves a predefined anonymous ID.

 
Others
 
- Windows Phone 8 : Background File Transfer Sample Code - Using URL Rerouting with a WCF Service
- Windows Phone 8 : Performing Background File Transfers - Background Transfer Requests
- Microsoft Lync Server 2013 : Lync Server 2013 Mobility Technical Review - Push Notifications
- Microsoft Lync Server 2013 : Lync Server 2013 Mobility Technical Review - Sign-In
- Microsoft Lync Server 2013 : Lync Server 2013 Mobility Technical Review - Understanding the LyncDiscover Service, Understanding the Mobility Service
- Microsoft Lync Server 2013 : Mobile Clients Overview
- Active Directory 2008 Optimization and Reliability : Saving and Analyzing Data with Performance Logs and Alerts
- Active Directory 2008 Optimization and Reliability : Using Windows Server 2008 Performance Tools (part 3) - Managing Performance Monitor Properties
- Active Directory 2008 Optimization and Reliability : Using Windows Server 2008 Performance Tools (part 2) - Viewing Performance Information
- Active Directory 2008 Optimization and Reliability : Using Windows Server 2008 Performance Tools (part 1) - Deciding What to Monitor
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us