Kevin Ashley's Blog at Microsoft

Kevin Ashley's Blog at Microsoft

February, 2013

Blog - About

About Kevin Ashley

Kevin Ashley is a Microsoft Architect Evangelist and a Windows Phone champ.
He has a strong industry and business experience. In his role, Kevin works with
partners, advising on software design, business and technology strategy and project
management. Prior to Microsoft, he was a founder of CloudOLAP an early-stage
cloud and business intelligence software startup. In his role as a senior
software developer and architect, Kevin developed grid, data warehousing and real-time
trading solutions for Fortune 500 companies and hedge funds worldwide: US, UK,
Europe and Asia. Kevin has degrees in Mathematics, Computer Science and MBA
from the University of Connecticut.    

  • Kevin Ashley's Blog at Microsoft

    Best ski apps 2012-2013 for Windows Phone–WINTER SKI & RIDE

    • 0 Comments

    Last year I did a review of ski and snowboard apps for Windows Phone, but this season we have a star app, it’s better than anything iPhone or Android have by an order of magnitude, which makes Windows Phone a leader in snow sports industry. Don’t believe me? This app is endorsed by professional ski and snowboard instructions association of America (PSIA-AASI), which includes more than 30,000 ski instructors. The app is beautifully designed and has everything a skier or snowboarder needs on the mountain, including tracking of ski runs, thousands of resorts, rapidly growing global social community, friends features and a great design. The app is incredibly battery efficient, you can ski the whole day, go to apres-ski party and call your friends.

     

    clip_image002

    UPDATES ABOUT WINTER SKI & RIDE:

    Microsoft Windows Phone blog about WINTER

    WPCentral about WINTER

    Windows Phone now has the best app in ski industry, leaving Apple and Google far behind, and raising the bar for ski apps very high: the app is called WINTER SKI & RIDE. For now the app is exclusively available on Nokia Windows Phones. WINTER SKI & RIDE app deserved recognition from association of professional ski and snowboard instructors of America (PSIA-AASI), as an official app recommended by association of more than 30,000 US ski and snowboard instructors. You can download it today from NOKIA Collection, if you are lucky to have a Windows Phone 8.

    Stay warm! Skiers no longer need to take hands off their gloves in the cold, WINTER SKI AND RIDE is especially optimized for use with gloves in the cold, and NOKIA Lumia devices have glove sensitive screen, so you don’t need to take off your gloves in the cold to use the app. The app is optimized to run through your skiing day without draining your battery, and instead of punching buttons in the cold you can simply speak to it: “WINTER, Show me snow reports” for example.

    WINTER SKI & RIDE is a unique app in many ways, it is developed by a Microsoftie, a professional ski instructor and a startup in Silicon Valley, an extremely powerful combination. The app is built in the US and Canada, and tested through snowstorms in the mountains of Colorado, Utah, California and British Columbia. Apparently, instead of spending time at Starbucks in Cupertino, Microsoft reached out to the field, and has developers who can ski and ride in the mountains, in cold and snow, to make the best app for skiing.

    Instead of a bunch of different apps for weather, ski tracking and lessons, WINTER SKI & RIDE combines all features a skier needs in the mountain in one powerful app: snow reports, resort maps and information, such as the number of open trails, beautiful ski analytics and activity tracking, and lessons for skiing, telemark, snowboarding, freestyle and cross-country from professional ski and snowboard instructors.

    SKI AND SNOWBOARD ACTIVITY ANALYTICS

    Apparently, it takes a ski instructor and a Microsoftie to get a ski app right, finally! WINTER SKI & RIDE has an activity tracking switch, just turn it on when you are at ski resort, and you can put the phone back in your pocket. The smart app will automatically track your runs and present them in beautiful charts: you can see you runs by season, daily or even drill into the run details to see run details, such as speed, duration and vertical drop.

    Not only that, WINTER SKI & RIDE motivates you to ski or ride more, and improve endurance, by setting goals. You can currently set vertical and run goals, and if you reach a goal, ta-da: your run is marked with an achievement pin, and you move closer to the leaders of the mountain.

    LEADERBOARD OF BEST SKIERS AND RIDERS

    WINTER SKI & RIDE is a very social app that lets you ski with your buddies and see the best skiers on the mountain.  You can also invite your friends and once you become friends with someone, you can share the runs and excitement about skiing.

    SNOW REPORTS AND MAPS

    WINTER SKI & RIDE automatically updates snow reports and you can view reports by proximity, by best conditions, powder, and maximum snow base. You can pin your favorite resorts as tiles to the start screen. The app beautifully presents resort information, shows vertical, open lifts and other information..

    LESSONS: SKI, SNOWBOARD, TELEMARK, OH-MY…

    Because WINTER SKI & RIDE is endorsed by Professional Ski Instructors of America, it has professional lessons from the best ski instructors on the planet. Lessons are carefully selected, adhering to the highest standards of the sport, lucky Windows Phone owners can now ski and learn.

    SOCIAL

    WINTER SKI & RIDE connects you with a social network of skiers and riders, making millions of ski buddies interconnected. This technology is based on Microsoft Windows Azure powerful cloud service. Do you want to see what runs your buddy did in Vail, or Whistler, or Chamonix? Just look him up on the Winter!

    FOR SKI TEAMS AND COACHES

    WINTER SKI & RIDE app changes the way coaches and ski instructors communicate with their students. By using the NFC technology available in Windows Phone, a ski instructor can instantly have a group of students join a team, and make recommendations based on a ski day, and individual runs.

    WITH WINTER SKI & RIDE APP WINDOWS PHONE BECOMES TOP PLAYER IN WINTER SPORTS

    With WINTER SKI & RIDE, Microsoft Windows Phone becomes a top player in the Winter sports. Forget the aging iPhone or battery-hungry Android. With the app endorsed by Professional Ski Instructors or America, Windows Phone becomes a very powerful player in the snowsports industry.

    DOWNLOAD WINTER

    ...
  • Kevin Ashley's Blog at Microsoft

    Data, Files and Networking in Windows 8 apps: examples from my book

    • 0 Comments

    If you are looking for code examples for Professional Windows 8 Programming: Application Development with C# and XAML book, specifically for the section on handling data, files and networking, you can get them directly from Wiley:

    Chapter 6 code for Pro Windows 8 Programming
    11.23 MB
    Click to Download

    These examples include everything: from managing local and remote settings, to networking and proximity.

    ...
  • Kevin Ashley's Blog at Microsoft

    Monetizing Windows 8 apps: examples from my book

    • 0 Comments

    If you are looking for code examples for Professional Windows 8 Programming: Application Development with C# and XAML book, specifically for the monetization section, you can get them directly from Wiley:

    Chapter 11 code for Pro Windows 8 Programming
    563.02 KB
    Click to Download

    What I’ve done in that example is helping you put all monetization techniques together: from unlocking the trial, to using in-app purchase. There’re some neat ideas implemented with the example, for example I use an MVVM model to wrap store licensing schema.

    I recommend reading the book first, about the ideas implemented here. This snippet illustrates the first technique of using an MVVM model to wrap the store objects. This may be necessary if you need to expose them later through data binding.

     

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using CatalogShoppingAppCS.Data;
    using Windows.ApplicationModel.Core;
    using Windows.ApplicationModel.Store;
    using Windows.Foundation;
    using Windows.UI.Core;
    
    namespace CatalogShoppingAppCS
    {
        public class AppLicenseDataModel : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
    
            private bool _licensed = false;
            private string _price;
    
            public AppLicenseDataModel()
            {
                if (CurrentAppSimulator.LicenseInformation.IsTrial)
                {
                    CurrentAppSimulator.LicenseInformation.LicenseChanged += OnLicenseChanged;
                    GetListingInformationAsync();
                }
                else
                    _licensed = true;
            }
    
            private async void GetListingInformationAsync()
            {
                var listing = await CurrentAppSimulator.LoadListingInformationAsync();
                _price = listing.FormattedPrice;
            }
    
            private async void OnLicenseChanged()
            {
                if (!CurrentAppSimulator.LicenseInformation.IsTrial)
                {
                    _licensed = true;
                    CurrentAppSimulator.LicenseInformation.LicenseChanged -= OnLicenseChanged;
    
                    // need this to the license change occurs on a different thread
                    // to update UI bound elements from the data model
                    CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        if (IsLicensed)
                        {
                            var groups = CatalogDataModel.GetGroups("AllGroups");
                            foreach (var group in groups)
                                foreach (var item in group.Items)
                                    item.IsAdDisplayed = false;
                        }
    
                        if (PropertyChanged != null)
                        {
                            PropertyChanged(this, new PropertyChangedEventArgs(String.Empty));
                        }
                    });
                }
            }
    
            public bool IsLicensed
            {
                get { return _licensed; }
            }
    
            public bool IsTrial
            {
                get { return !_licensed; }
            }
    
            public string LicenseInfo
            {
                get
                {
                    if (!_licensed)
                        return "Trial Version";
                    else
                        return ("Valid until " + CurrentAppSimulator.LicenseInformation.ExpirationDate.LocalDateTime.ToString("dddd, MMMM d, yyyy"));
                }
            }
    
            public string FormattedPrice
            {
                get
                {
                    if (!String.IsNullOrEmpty(_price))
                        return "Upgrade to the full version for " + _price;
                    else
                        return "Upgrade to the full Version";
                }
            }
        }
    }
    
    ...
  • Kevin Ashley's Blog at Microsoft

    Retrieving more data from Azure Mobile Services using paging and LoadAllAsync extension

    • 0 Comments

    Azure Mobile Services allow you to take 50 records at a time by default, or 1000 records at maximum. What if you have more records and want to retrieve the entire table? I just created this beautiful extension method to help you get any amount of data you want, given any page size you want. This simple call to LoadAllAsync will asynchronously load ALL data from a WAMS table in pages of 1000 (or whatever number you specify) records (may also be good for bandwidth reasons):

    var updatedReports = await azureTable.Where(r => r.complete == true).LoadAllAsync();

    And this is an extension method, which elegantly does exactly what it says: loads all data. Enjoy:

            public async static Task<List<T>> LoadAllAsync<T>(this MobileServiceTableQuery<T> table, int bufferSize = 1000)
            {
                var query = table.IncludeTotalCount();
                var results = await query.ToEnumerableAsync();
                long count = ((ITotalCountProvider)results).TotalCount;
                if (results != null && count > 0)
                {
                    var updates = new List<T>();
                    while (updates.Count < count)
                    {
    
                        var next = await query.Skip(updates.Count).Take(bufferSize).ToListAsync();
                        updates.AddRange(next);
                    }
                    return updates;
                }
    
                return null;
            }
    
    ...
Page 1 of 1 (4 items)