RSS
 

Posts Tagged ‘Microsoft’

Build the Mobile Web with WebMatrix

24 Jul

Build mobile web sites that adhere to W3C Mobile Web Best Practices using the new WebMatix web development tool.  This tool introduces simple-to-use ASP.NET Web Pages which don’t follow the MVC pattern nor do they include server controls like WebForms.  It also introduces the “Razor” templating engine and a model where you have HTML and inline code where needed.  This way to building sites is easy and flexible and takes me back to the golden age of Microsoft ASP web development in the late ‘90’s.

Our favorite mobile database, SQL Server Compact 4.0 finds it’s way to the web with this tool providing a simple way to give your mobile web site a database.  It’s been beefed up and tuned for the stress of providing data services to Internet and supports 256 concurrent connections.  Since it’s a file-based database, you just copy it along with your web pages to your on-premise server, web hosting provider or Azure.

Last but not least, you get IIS Express which is a welcome replacement for the Cassini development web server currently used by Visual Studio.  This gives all developers the power of IIS 7.x without needing Administrator access to their box, even if they’re running on Windows XP.

The lightweight, inline-code nature of developing with WebMatrix makes it easy to build low-bandwidth sites that follow XHTML Basic 1.1 recommendations so you can target any mobile web browser.  From there, it’s up to you to determine if you want to support more advanced features found in mobile browsers like IE Mobile, Opera, or Webkit (iPhone, Android, webOS or Blackberry).

- Rob

 
 

Windows Phone 7 Jump Start Session 3

22 Jul

Check out the Windows Phone 7 Jump Start Session 3 @ https://www0.livemeeting.com/cc/microsoft/join?id=Win7072210&role=attend&pw=webcast

 

Get the New Windows Phone Developer Training Kit

14 Jul

Now that you’ve downloaded the Windows Phone Developer Tools beta, head on over the Microsoft Download site to get the refreshed Windows Phone Developer Training Kit to go with it.

Videos and labs for the new training kit include:

  • Using Windows Phone Launcher and Choosers In Your Applications
  • Understanding the Windows Phone Application Lifecycle (handling Tombstone)
  • Push Notification Services
  • Hello Phone
  • Building Your First Windows Phone Application
  • Windows Phone Navigation and Controls
  • Game Development with XNA Framework for Windows Phone
  •  

    Use this kit to learn how to use Microsoft Visual 2010 Express for Windows Phone and Expression Blend to build Silverlight apps and XNA games for Windows Phone.

    -Rob

     

    Don’t forget to Encrypt your Windows Phone 7 Data

    02 Jul

    Whether you’re targeting Mobile Line of Business apps for the Enterprise or B2C apps for consumers, ensuring that sensitive data is encrypted is a must.  These days, I can’t have a serious discussion with a CIO unless I can assure her that my mobile device can protect data-in-transit and data-at-rest.  You already know that Windows Phone 7 secures data-in-transit via SSL whether you’re using Internet Explorer or calling a Web Service from a Silverlight app.  What you may not know is how it covers the other bases.  A quick look over at http://msdn.microsoft.com/en-us/library/ff402533(v=VS.92).aspx lists the following cryptographic algorithms supported by Windows Phone OS 7.0:

    • AES
    • HMACSHA1
    • HMACSHA256
    • Rfc2898DeriveBytes
    • SHA1
    • SHA256

    I thought I’d take some of these algorithms for a spin by building a sample app using Microsoft Visual Studio 2010 Express for Windows Phone.  All I really wanted to do is use AES to encrypt and decrypt some data so I could save it to Isolated Storage.  Doing this would definitely check some of my security checkboxes and those of Microsoft’s customers.

    Below are screenshots of the simple app I created.  A TextBox is used to enter the data to be encrypted by AES.  Below that, a PasswordBox control is used to enter a password that works in conjunction with Rfc2898DeriveBytes and HMACSHA1 + a salt value to create a key.  Tapping the Encrypt button calls the Encrypt() method which performs the AES 256 magic and displays the resulting Base64 encrypted data in the Encrypted data TextBox.  Tapping the Decrypt button does the reverse by calling the Decrypt() method to unscramble the data and display the resulting data in the Decrypted data TextBox.

    ContosoEncryption1 thumb1 Don’t forget to Encrypt your Windows Phone 7 Data ContosoEncryption2 thumb1 Don’t forget to Encrypt your Windows Phone 7 Data

    I also threw some buttons on there to save the newly encrypted data to Isolated Storage as an ApplicationSetting.  As shown in the screenshot on the right, clicking the Retrieve button pulls the encrypted data from Isolated Storage and displays it in a MessageBox.  Keep in mind that you can save this encrypted data to Isolated Storage many different ways including saving it as a file or as part of an XML serialization of a collection of objects.

    So let’s take a look at some code. 

    The Encrypt() method below takes the data you want to encrypt as well as a password and salt value as arguments.  It uses the AesManaged object with the default values of a 256-bit key and 128-bit block size.  With the help of your supplied password, the encryption key is created using the Rfc2898DeriveBytes object with a dash of salt.  Finally, the MemoryStream and CryptoStream objects work with the AesManaged object to convert your supplied data into an encrypted array of Bytes.  I convert that array into a Base64 string that you can display on the screen, cache in memory, send to a WCF service or save to Isolated Storage.

    public string Encrypt(string dataToEncrypt, string password, string salt)
    {
        AesManaged aes = null;
        MemoryStream memoryStream = null;
        CryptoStream cryptoStream = null;

        try
        {
            //Generate a Key based on a Password, Salt and HMACSHA1 pseudo-random number generator
            Rfc2898DeriveBytes rfc2898 = new Rfc2898DeriveBytes(password, Encoding.UTF8.GetBytes(salt));

            //Create AES algorithm with 256 bit key and 128-bit block size
            aes = new AesManaged();
            aes.Key = rfc2898.GetBytes(aes.KeySize / 8);
            aes.IV = rfc2898.GetBytes(aes.BlockSize / 8);

            //Create Memory and Crypto Streams
            memoryStream = new MemoryStream();
            cryptoStream = new CryptoStream(memoryStream, aes.CreateEncryptor(), CryptoStreamMode.Write);

            //Encrypt Data
            byte[] data = Encoding.UTF8.GetBytes(dataToEncrypt);
            cryptoStream.Write(data, 0, data.Length);
            cryptoStream.FlushFinalBlock();

            //Return Base 64 String
            return Convert.ToBase64String(memoryStream.ToArray());
        }
        finally
        {
            if (cryptoStream != null)
                cryptoStream.Close();

            if (memoryStream != null)
                memoryStream.Close();

            if (aes != null)
                aes.Clear();
        }
    }

     

    As you can see below, the Decrypt() method looks remarkably similar to the Encrypt() method except that it does just the opposite.  It accepts your AES-encrypted Base64 data plus a password and salt value as parameters to the method.  The big difference is in the CryptoStream where you have the AesManaged object call CreateDecryptor() instead of CreateEncryptor().  This does the trick and then I convert the unencrypted Byte array into a string.

    public string Decrypt(string dataToDecrypt, string password, string salt)
    {
        AesManaged aes = null;
        MemoryStream memoryStream = null;
        CryptoStream cryptoStream = null;

        try
        {
            //Generate a Key based on a Password, Salt and HMACSHA1 pseudo-random number generator
            Rfc2898DeriveBytes rfc2898 = new Rfc2898DeriveBytes(password, Encoding.UTF8.GetBytes(salt));

            //Create AES algorithm with 256 bit key and 128-bit block size
            aes = new AesManaged();
            aes.Key = rfc2898.GetBytes(aes.KeySize / 8);
            aes.IV = rfc2898.GetBytes(aes.BlockSize / 8);

            //Create Memory and Crypto Streams
            memoryStream = new MemoryStream();
            cryptoStream = new CryptoStream(memoryStream, aes.CreateDecryptor(), CryptoStreamMode.Write);

            //Decrypt Data
            byte[] data = Convert.FromBase64String(dataToDecrypt);
            cryptoStream.Write(data, 0, data.Length);
            cryptoStream.FlushFinalBlock();

            //Return Decrypted String
            byte[] decryptBytes = memoryStream.ToArray();
            return Encoding.UTF8.GetString(decryptBytes, 0, decryptBytes.Length);
        }
        finally
        {
            if (cryptoStream != null)
                cryptoStream.Close();

            if (memoryStream != null)
                memoryStream.Close();

            if (aes != null)
                aes.Clear();
        }
    }

     

    Please keep a few things in mind when encrypting data on the Windows Phone 7 platform.  The OS doesn’t include framework support for storing your passwords and salt values securely nor does it come with any kind of built-in key management.  This means the only way to ensure your encrypted data is actually secure is to make sure your password, salt values and keys are not stored on the phone.  As shown in my example, I require you to enter a password and a salt value each time you want to encrypt or decrypt data. I do not attempt to save those cleartext values anywhere in the system because there is no secure way to store them.  One other thing to think about is that the cleartext password and salt value you entered on the screen can remain in memory at least until the next garbage collection.

    Beyond the two Crypto methods above, I created a pair of methods to save and load your encrypted ApplicationSettings to Isolated Storage as shown below:

    public void SaveState(string Name, string Value)
    {
        if (IsolatedStorageSettings.ApplicationSettings.Contains(Name))
        {
            IsolatedStorageSettings.ApplicationSettings[Name] = Value;
        }
        else
        {
            IsolatedStorageSettings.ApplicationSettings.Add(Name, Value);
        }
    }

    public string LoadState(string Name)
    {
        if (IsolatedStorageSettings.ApplicationSettings.Contains(Name))
        {
            return IsolatedStorageSettings.ApplicationSettings[Name].ToString();
        }
        else
        {
            return "null";
        }
    }

     

    As you can see from the code samples above, encrypting the sensitive data you use in your Windows Phone 7 apps is completely within your reach.  When you combine this with the following security elements:

    • Apps are tested, digitally signed and securely delivered via the Windows Phone Marketplace
    • No side-loading of potentially insecure apps
    • SSL for data in transit
    • Managed apps run inside secure sandbox
    • Apps have private, inaccessible Isolated Storage
    • Exchange Policies including PIN lock enforcement + Remote wipe

     

    It’s clear that Windows Phone 7 has an excellent app security story that’s not only good for consumers, but also means that this mobile app platform is prime-time ready for the Secure Enterprise.

    Keep coding,

    Rob

     

    Microsoft by the Numbers

    01 Jul

    With Windows 7 selling more than 600,000 per day, it’s interesting to look at all our numbers and see how they stack up against the competition:

    150,000,000
    Number of Windows 7 licenses sold, making Windows 7 by far the fastest growing operating system in history.[source]


    7.1 million
    Projected iPad sales for 2010. [source]

    58 million
    Projected netbook sales in 2010. [source]

    355 million
    Projected PC sales in 2010. [source]


    <10
    Percentage of US netbooks running Windows in 2008. [source]

    96
    Percentage of US netbooks running Windows in 2009. [source]


    0
    Number of paying customers running on Windows Azure in November 2009.

    10,000
    Number of paying customers running on Windows Azure in June 2010. [source]

    700,000
    Number of students, teachers and staff using Microsoft’s cloud productivity tools in Kentucky public schools, the largest cloud deployment in the US.[source]


    16 million
    Total subscribers to largest 25 US daily newspapers. [source]

    14 Million
    Total number of Netflix subscribers. [source]

    23 million
    Total number of Xbox Live subscribers. [source]


    9,000,000
    Number of customer downloads of the Office 2010 beta prior to launch, the largest Microsoft beta program in history. [source]


    21.4 million
    Number of new Bing search users in one year. [Comscore report – requires subscription]


    24%
    Linux Server market share in 2005. [source]

    33%
    Predicted Linux Server market share for 2007 (made in 2005). [source]

    21.2%
    Actual Linux Server market share, Q4 2009. [source]


    8.8 million
    Global iPhone sales in Q1 2010. [source]

    21.5 million
    Nokia smartphone sales in Q1 2010. [source]

    55 million
    Total smartphone sales globally in Q1 2010. [source]

    439 million
    Projected global smartphone sales in 2014. [source]


    9
    Number of years it took Salesforce.com to reach 1 million paid user milestone. [source]

    6
    Number of years it took Microsoft Dynamics CRM to reach 1 million paid user milestone. [source]

    100%
    Percent chance that Salesforce.com CEO will mention Microsoft in a speech, panel, interview, or blog post.


    173 million
    Global Gmail users. [source]

    284 million
    Global Yahoo! Mail users.[source]

    360 million
    Global Windows Live Hotmail users.[source]

    299 million
    Active Windows Live Messenger Accounts worldwide. [Comscore MyMetrix, WW, March 2010 - requires subscription]

    1
    Rank of Windows Live Messenger globally compared to all other instant messaging services. [Comscore MyMetrix, WW, March 2010 - requires subscription]


    $8.2 Billion
    Apple Net income for fiscal year ending  Sep 2009. [source]

    $6.5 Billion
    Google Net income for fiscal year ending Dec 2009. [source]

    $14.5 Billion
    Microsoft Net Income for fiscal year ending June 2009. [source]

    $23.0 billion
    Total Microsoft revenue, FY2000. [source]

    $58.4 billion
    Total Microsoft revenue, FY2009. [source]

     

    Good stuff!

    -Rob

     
     

    Discover the future of Windows Phone 7 in the Enterprise at Tech Ed North America 2010

    05 Jun

    Ten years ago, we created the Pocket PC and Compaq launched the iPAQ.

    This would become the most compelling Mobile Enterprise Application Platform of the last decade.  In 2006 I created the Windows Mobile Line of Business Accelerator to help jumpstart the efforts of corporate developers + enterprise ISVs with advanced tools and technologies like the .NET Compact Framework, SQL Server Compact and Visual Studio.

     

    It’s a new decade and we’ve created the most powerful Mobile Enterprise Application Platform ever with Windows Phone 7.  Next week at Tech Ed North America 2010, I will begin the process of jumpstarting your enterprise development efforts again with Silverlight, WCF, Azure and Visual Studio 2010.  Give yourself an edge and come check out my sessions:

     

    Developing Occasionally Connected Applications for Windows Phone 7

    The Silverlight development environment has proven itself to be a rich, capable, and adaptable runtime that has reached across platforms to support Windows, the Mac and the Web. Silverlight has now become the application platform for Windows Phone 7, which is great news for new and existing Silverlight developers looking to support this exciting new phone platform. To ensure the best experience for mobile users, apps built for Windows Phone 7 must implement an occasionally-connected pattern of development that Silverlight developers for the other platforms may find unfamiliar. In this session, learn how to build mobile apps that adjust their behavior based on changing network conditions. Also learn how to conquer unreliable wireless networks by implementing RESTful principles to ensure your messages are both compact and fast. Then take those WCF REST services and use them to retrieve database tables, rows, and columns in order to drive the behavior of your mobile applications. Finally, learn how to build an in-memory database that you can query with LINQ and save its data to Isolated Storage to ensure that your Windows Phone apps keep working regardless of network conditions.

     

    ContosoBottling thumb Discover the future of Windows Phone 7 in the Enterprise at Tech Ed North America 2010 

    Microsoft’s Next Generation Mobile Enterprise Application Platform (MEAP)

    A Mobile Enterprise Application Platform (MEAP) allows corporate IT departments to support multiple mobile applications on a single platform. Gartner states that this market currently tops $1 billion and forecasts that 95% of the world’s organizations will standardize on a single MEAP offering by 2012. Companies looking for a better ROI are moving to reusable platforms instead of building tactical, ad-hoc mobile solutions that support only a single app. Attendees of this session will learn how to save money by steering away from point solutions and on to Microsoft’s MEAP stack. Come see what Microsoft’s Next-Gen Mobile Enterprise Application Platform looks like and learn how it will support a broader range of mobile platforms and operating systems including Windows Phone 7 and Azure.

     

    image thumb Discover the future of Windows Phone 7 in the Enterprise at Tech Ed North America 2010

     

    See you in New Orleans!

    - Rob

     

    The KIN is Here

    12 Apr

    Today, Robbie Bach and my good friend Derek Snyder launched Microsoft’s newest Windows Phones at an event in San Francisco.  Two phones for the socially-connected crowd with multi-touch screens and slide-out keyboards.  We worked with Sharp on the hardware plus Verizon and Vodafone for the wireless networks.

    KIN ONE

    Compact keyboard for one-handed texting + 5 megapixel camera + shoots standard video + mono speaker + 4 GB of storage for 1,000 songs + Zune

    one settings web thumb The KIN is Here   one loop web thumb The KIN is Here

    KIN TWO

    Large keyboard for two-handed texting + 8 megapixel camera + shoots HD video + stereo speakers + 8 GB of storage for 2,000 songs + Zune

    two settings web thumb The KIN is Here   two loop web thumb The KIN is Here

    KIN STUDIO

    Cloud storage to keep all those photos, videos, contacts and texts so you’ll never run out of space on your phone and lose a memory

    studio 2 web thumb The KIN is Here

    If you’re a heavy texter and a regular on Facebook and Twitter then these phones are for you.

    - Rob

     
    No Comments

    Posted in KIN

     

    Finding your Windows phone on the CBS Early Show

    27 Dec

    Microsoft’s My Phone service got its first public showing on the CBS Early Show when CNET’s Senior Editor Natali Del Conte put the system through its paces in New York.  Natali tossed her HTC Pure running Windows Mobile 6.5 into a taxi to simulate a real-world scenario where a passenger loses her phone. 

    While you probably knew that My Phone backs up your photos, contacts, text messages, music, documents and IE favorites to the cloud, you might not have known that My Phone can be used to locate and secure a lost phone.  You can ring, lock, erase, and locate your lost phone on a map.  On the CBS Early Show, Natali was able to display a message on her lost Windows phone instructing whoever found it to contact her and return it.  Pretty cool stuff and a great example of Microsoft tying the cloud to the third screen.

    Best Regards,

    Rob