Tech in the 603, The Granite State Hacker

Rise of the Smart App

Microsoft didn’t talk much about the Windows Phone at Build 2016.  If you think that’s news, you’re missing the point.

As Microsoft re-defines “Mobile First, Cloud First” they declare shenanigans on the idea that the tech world revolves around phone and tablet.  Yes, tablet and smartphone are mature, first-class citizens, now, but they’re not above laptops, PCs, or other computing devices, as Apple (and perhaps even Samsung) might have you believe.

There’s no denying that Microsoft lost the battle for smartphone market share.  RIM’s Blackberry, considered a relic of the primordial smartphone market, is all but forgotten. Microsoft was pushing Windows Phone as significant competitor, yet, with about the same market share as Blackberry, no one really took their smartphone offering seriously. 

Until Windows Phone’s recent convergence with the PC on the universal Windows 10 OS, Windows Phone had no more competitive edge than Blackberry, either.  Sadly, this new competitive edge comes too little, too late. Or has it?

Several years ago, in a very sly move, Apple narrowed and laser-focused the global technology mindset on a much smaller battle… one that it was well positioned in. Apple then equated the battle to the war… They made it all about the smartphone/tablet market.  (I don’t think Apple counted on Android, but it didn’t matter… in terms of market share, Android won, but in terms of profitability, Apple won.)  Billions of dollars can’t be wrong, so Microsoft tried to position itself in Apple’s vision, and let itself get dragged around for years… 

Until now.

By connecting Mobility with Portability, Microsoft is driving the scope of technology mindshare again, and are driving it back out to a scale Apple will have to struggle to position itself in. Apple made good smartphones.  Cool beans.

With its converged “Universal” Windows 10 platform, Xamarin portability, and mature cloud offerings replete with machine learning, Microsoft is targeting a much broader “smart app” market… Smart Apps are apps that make any device (keyboard, mouse, display/touchscreen, microphone, pen, scanner, camera, video recorder/editor, audio mixer, cell phone, media player, whiteboard, virtual/augmented reality, what have you) into a smart device.  (Notice anything missing here?  perhaps cars…  but it’s hard to imagine that won’t change in the next few years…  after all, cars (e.g. BMW) did get mentioned at Build.) 

The smartphone isn’t irrelevant, it’s just not the whole pie. The reality is that Microsoft is not going to exclude phones from Windows 10 now or any time soon. 

Smartphone prominence is not innovation superiority.

So, how does this make you feel?

Tech in the 603, The Granite State Hacker

Tribute to the TI 80-something Graphing Calculators

Rummaging thru a box of stuff in storage, I ran across my old Texas Instruments TI-85 calculator.  I had to stop and fiddle it for a moment. I grabbed some AAA batteries, only to discover that the CR1616 backup had given up… the calculator operates like new, as in factor reset… but sadly, that means a game program I wrote for it 20 years ago was finally gone forever.

Back in the early 90’s, Exeter Area High School had an advanced math course that required a TI-81 calculator. I gladly used the course as an excuse to get my hands on this relatively expensive (near $100 in 1990 dollars) but amazing piece of hardware at the time.

In short order, I added its programming language to the list of languages I had already taught myself.  I loved using trigonometric functions to create pictures. I used to program it to do my trig and pre-calc homework for me. (In retrospect, my attempt at “cheating” was a hack that I learned more from than any lecture or textbook ever would teach me… you see, in order to program the calculator to do advanced math for me, I had to thoroughly understand it, myself.)

My own TI-85, which I upgraded to
for calculus at UNH. It’s a bit dusty today.
It cost about $100 when I
purchased it in the early 90’s.

The TI-8x calculators were my “gateway drug” to my love of mobile development.  I was already developing software for PCs, but I loved the challenges imposed by yet more limited footprints and hardware capabilities. 

I kept my TI with me to the point that my sister nicknamed it a “porta-geek”…  (There was even a girl who stole it from me, thinking to wound me for the fact that I wasn’t interested in dating her. It had no effect; I obliviously assumed I’d misplaced it in my own absent-mindedness. The story came out several years later, after I’d purchased a replacement.)

The term “porta-geek” is a term I still whimsically apply on occasion to my current daily driver mobile device, my Lumia 950XL running Windows 10.  My sister’s jibe didn’t phase me, either.

By coincidence, I was also in Target’s electronics department today. I was surprised to notice that they still had several 20+ year old TI-80-somethings…  but rather than the price being lower, the prices are actually higher.

A selection of same-generation TI calculators at Target today (3/20/2016).  Notice the TI-80-somethings still going for about $100+.

I can’t really say why 20+ year old calculators should still cost more than they originally did…  clearly normal technology market forces are not in effect for them.  My spidey-sense for socialistic-driven monopoly tingles.  I’m not the only one to have noticed the… discrepancy… over the past couple decades.  ( https://www.quora.com/Why-does-a-TI-83+-calculator-cost-the-same-as-it-did-12-years-ago )

That said, they were, and are great devices.

I’d love to see a Windows 10 emulator app made out of them….  maybe some day I’ll find enough spare time…  🙂

Tech in the 603, The Granite State Hacker

Alaska, Undiscovered Country

There’s been a note of surprise in the money news of late about Alaska. 

It’s become a bit of a surprise that the most sparsely populated state in the US has suddenly become the hottest opportunity for corporate growth.  Alaska is a place where consumers have been largely ignored and fully under served…  yet suddenly logistics technology caught up with economists.  The change in tide has come about so suddenly that there’s actually a race to get established there before the market gets saturated by competition.  (For Example)

What’s a tech blogger doing, pointing out an economics topic?  Well… here’s where the post turns into a geek post…  🙂

I can’t help but notice a parallel between the Alaskan boom and the Windows Phone boom that’s also under way.  Corporations in saturated markets (IOS and Android) meet the growing, underserved market, and the realization that both past investments and new technologies can be leveraged…  and suddenly there’s a whole new customer base waiting to be conquered in terms of apps and customer attention and loyalty in the company’s native space.

Unlike Alaska, the Windows Phone market is global.  It’ll likely literally take something earth shattering to make Alaska a bigger part of the US market than one of fifty states.  Windows Phone Store is already serving over 100 markets world wide.

Unlike Alaska, the Windows Phone market growth opportunity is virtually unlimited.  A company that conquers an Alaskan market will see growth, but it will not likely ever exceed the established markets in the lower 48.   In the Windows Phone market, a company could make it’s big break there in the relative scarcity of competition, and even as the Windows Phone platform market share grows, could end up seismically shifting the landscape in their market.

Unlike Alaska, there’s no logistics challenge.  Many companies already have all the elements required to make the jump to Windows Phone…  the talent pool, the code base, the infrastructure, very likely existing network services and even binaries.

Microsoft and Nokia have already taken the Windows Phone platform to the many Alaska’s of the world, and the platform’s already beating out the likes of both IOS and Android in many of them.   The US market is critical, but Microsoft (and Nokia) know that these the Alaska’s they’re winning in will eventually unite, and overwhelm from the edges as the incumbent platforms fade past their maturity.  Those with vision beyond this quarter’s numbers would be wise to jump on board before their competition saturates their market.

Tech in the 603, The Granite State Hacker

The Lumia 1020: Threat to the Status Quo

I stopped by my local AT&T store today [Saturday, July 27, 2013] (the corporate store at the Mall of NH in Manchester) to check out the Lumia 1020.  I’d heard lots about it so I was pretty psyched…  I already have (and love) my Lumia 920… it was released back in December, so it hasn’t been a year yet.  No real hope of upgrading just yet, but being a founding member of the NH Windows Phone Users Group, I take the supposed obligation to checked it out, as I did with Verizon’s 928, and T-Mobile’s 925.    🙂

I know the competition between mobile devices is a bit hot, despite the decline in popularity of iPhones, the non-restart of the Blackberry, the fragmentation of the Android, and the slow rise of the Windows Phone, but I never thought the competition might be this hot until today…  I came to hypothesize that there might be sales reps who, for whatever reason, have their favorites, and possibly….  just maybe… feel threatened by devices that rival them.  

Walking into the store, I was really happy to see the Lumia 1020 display…. they had a yellow and a black unit out.  

Getting closer, I had to second guess myself that these were actually 1020’s.  They looked much like my 920, and these units looked… worn…  like they’d been on display since… December of the year before.   The yellow unit was powered on, at the start screen.  The black unit was off.  Both had been scratched pretty heavily, especially at the point where the security device attached to the face of the display…. (hindering some of the UI, I noticed… the search button was fully obscured.)  especially the black one.   Given how tough the surface is… I can only imagine that someone spent some time working at scratching up the unit.   (If you examine the image below carefully at full resolution, you can just about make out the scratches… I wasn’t able to spend a lot of time taking the picture with my 920’s great-but-not-1020-awesome camera…. but they’re there.)  

I ignored the scratches for the time being… these were brand spanking new units that clearly almost no customers had been shown in the less than 24 hours since it was unboxed and put on the shelf.  I was just excited to see the 1020.

But still, I was unsure… could these be 920’s?   I had to pick it up and look at the back to see the 1020’s camera spot…  yes, clearly 1020’s.   It was the yellow unit I’d picked up, since the black unit was not powered on.   I asked my son to pose for me, so I could take his picture with the awesome 41MP camera.

The unit powered itself off almost as quickly as I fired up the camera.

OMG….  Did it just crash?

No…  this unit is not charging.  It has this big honkin’ lit-up security device attached to it, but that’s not providing any power to the Lumia.   Someone had failed to provide power to the devices;  they were on the factory charge and had run dead.  Yes, batteries on both Lumia’s were dead as doornails.

 A rep finally approached me, and asked if he could help.   I asked him if we could please get some power to these Lumia 1020’s so that I could take a look at them.   After a few minutes, the rep returned with the power cords (as seen attached to the USB ports in the image, below.)

I waited several minutes for the devices to charge enough for the power to come back on, and played with them for a few moments.   There was a box on the left of the display bay designed to allow you to take a picture of a picture within it, simulating various lighting conditions.  It wasn’t much more than a simple box, but it was misassembled, and the point of it was lost unless you read a bit.

I enjoyed playing with the camera a bit, taking a few different photos, and experimenting with the new zoom gestures & such… and was duly impressed with it.   It was also lighter than my 920, and I found myself wishing I could just bite the bullet and upgrade.  🙂

Most Windows Phone devices, I’ve noticed, when put on display, get set up with demo accounts so you can download apps from the app store and try them out.  I often like to see how my apps behave on newer devices.  Neither of these units were set up with connectivity… no cellular, no Wi-Fi.

The final bit that really got me thinking about how someone at this store might really feel threatened somehow by the Lumia 1020 was because I realized, as I looked around the store….  no other unit in the store had a big honkin security device obscuring part of the UI as both these 1020’s did.   The security devices for every other unit in the store was entirely attached to the back of the devices with nothing else on the faces of them…  so it felt like someone spent time to fit these particular devices with these old security rigs that they used that also damaged the devices and hindered any demos…

Really, I’m a big Windows Phone fan and Nokia Lumia fan, but this display was almost enough to make me think AT&T doesn’t want folks to see this as the flagship upgrade in the Windows Phone lineup.   In any case, I don’t think I’ll send friends & family to that store to check them out.

So my only problem with my hypothesis…  why, really, might a rep at a mobile store want to sabotage their own products?   Could they really feel the 1020’s a threat to… iPhone?  Android?   Any other hypotheses on that level?

[Edit: 7/30:  I got a response from this… (Surprised… unexpected… humbled… but appreciated!)   If I understand it correctly, the suboptimal demo experience was officially deemed “accidental”, and the units have been replaced…  and so have the security devices… so that the demo experience will be as it should be… and I’ll be happy to recommend to friends & family to go to the AT&T store & check the 1020 out.  🙂   ]

Tech in the 603, The Granite State Hacker

D11: What’s Wrong with Devices Everywhere?

Reports coming back from D11 indicate that most companies are focusing on (according to a report attributed to Mary Meeker)  “Wearables, Drivables, Flyables, Scannables”.

Simply put, I tend to disagree still. 

While all these brilliant minds are gathering, I think the feedback leaking out feels as out of touch as the iPhone…  I’m not sure it even sounds different anymore.

With respect to wearables, I believe the pre-backlash against Google Glass is telling, and has more to do with the fact that people are very comfortable with their smartphones… and not so comfortable with the Borg-like assimilation of them.  

I think Apple will run into the same sorts of issues with the iWatch.  I’d rather put an iPhone on an arm- or wrist- band than have both an iPhone and an iWatch…  that makes two devices to manage the care & feeding of…  this goes directly against the premise of the SmartPhone… the idea that *one* device is your buddy and your complete “away-mission” kit.

The idea of drivables is similar.  Computers in cars is one thing.  I don’t want to have another computer interface in my car. 

Blame it on R2-D2 and the Borg.

No one wants to be assimilated. 

Further, why carry an X-Wing (or Y-Wing or B-Wing) fighter around when you can have your astromech (smartphone) follow you from fighter to fighter?

While I fully agree…  any company worth their salt should be looking at making everything have a well connected computer in it,  they should not, necessarily, be looking at having a human interface on those devices.  These should be control & reporting processors built into devices, not redundant smartphones built into devices.

Let the interface be our beloved astromech… I mean smartphone.

I love where some auto manufacturers are going with things like Ford SYNC.

The ten year cycle on the smartphone is only just beginning, and wearables, drivables, flyables and scannables probably won’t work as stand-alone products, but as extensions of the smartphone era.

Tech in the 603, The Granite State Hacker

Hedging Against The Risk of Becoming A Monopoly

First Microsoft with their late entry into the mobile market (and flubs leading up to it)… then Apple… now Facebook…  anyone notice that they kinda suck lately?  

Apple, clearly getting bored with it’s iPhone, is now turning its attention to it’s iWatch… which doesn’t make much sense to me;  I purposely gave up all other devices, including a wristwatch, in favor of a single unified mobile device.  It will take a lot to convince me to add a wristwatch back in, and I’m sure having to pay for it will be a deterring factor.   (Next thing you know, they’ll add electroshock notifications, and make it so that authorities will have the ability to lock it to the wearer’s wrist and cause it to electromagnetically bind to the nearest metal object in order to detain people… (but that’s another whole story)).

I’m always toying with social media, so when I ran across a Facebook post from an entrepreneurial acquaintance recently, wondering if his content was being suppressed, I had to check it out.   As an experiment, he posted a really cute puppy, and it picked up a fair number of responses.  His concern was that his regular posts were not getting the response he’d grown accustomed to.  To add yet more anecdote, there was recently a post on the New York Times’ blog about similar observations, tied to tweaks Facebook has made recently.  It seems posts that are engaging or paid for are prioritized, and posts that are not quite as popular are at best “deprioritized”.  It seems likely that even engaging posts tied to commercial products are likely suppressed unless paid for.  Anyone who dabbles in trying to build an audience through Facebook must pay or make sure their content is very engaging.   I like knowing about the books friends of mine are publishing.  I like knowing about their small mom & pop shop.  These posts are getting hidden from my newsfeed.  It’s not the most engaging stuff, but it’s part of what I use Facebook for.  Having this stuff drop off my radar makes Facebook start to suck more.  Yes, they want to make money, but I think there may be even more to it.

I digress.

But I have to ask…  with all the Big Data that companies like Apple, Intel, Microsoft, Qualcomm, Facebook, Google, and the rest have…  and rest assured, they have it… the analytics.  How can they really not recognize the things that are hurting their business? 

Is it intentional?

If modern history has shown us anything, it’s that free markets do not tolerate monopolies.  In every case, any time a company takes advantage of its own strength in the market, the market has pushed back, forcing one of a number of “bad” things upon the company.  Just about every global company has seen this.  I recall hearing about the Rockefeller oil breakup, but in our time, it was the Microsoft / Internet Explorer shakedown…. and there have been many others.

I long suspected the reason Linux existed and was not thoroughly stomped on by the powers that be (Microsoft) was to allow Linux to be a “competitor” in the market… something that would never have a unified corporate focus that could actually unseat Microsoft.  I know that Microsoft even supported some Linux components, which anecdotally supports my theory.  I’m sure they supported it as much as they felt they necessary in order to make sure Linux was a viable competitor.

When it became clear that Linux’s strength was flagging, a more corporate competitor became necessary.  It seems Apple filled that gap very nicely in the PC market for some time.

While Apple began to dominate the mobile market, Google stepped up to become a competitor there, partially because Microsoft wasn’t committed to the market space.  (It wasn’t enough of a threat to the PC market.)  Android has the same problems as Linux… too decentralized to be a lasting threat, so while Apple had it’s heyday and now lets itself slip in the market, Microsoft will target Google.  Eventually, I predict Apple and Microsoft will take turns with market dominance with Google there to provide another safety net.

So back to Facebook…  It seems like Twitter has become a haven for market bots, but not much more of real use to the average person.  Facebook’s power grew to near monopolistic levels over 2012, but I predict that Facebook will actually allow this unhappy situation to persist for entrepreneurial folks, encouraging them to explore Google+.  This leadership transference to Google+ will bolster Google+ as a competitor, enabling Facebook to remain free of  the shackles of being a monopoly.  I suspect they’ll both start taking turns with market dominance, but despite the market competition, I bet both will claim better results in their marketing campaigns, thus leading to higher advertising prices on both.

The nasty part, here, is that the reason for preventing and sanctioning monopolies is to prevent them from strong arming their markets.  Unfortunately, what it seems like we’re getting instead is very small oligarchies taking turns to be the dominant, but not quite monopolistic force in the market.  They take advantage of each other to develop brand loyalty which improves their profit margins and gives them near monopolistic power among their followers, yet they maintain their monopoly-free, unsanctioned status.

Tech in the 603, The Granite State Hacker

No Kid Hungry, Resolution To Renew My Commitment

It’s New Years Day, 2013. 

My kids made a comment, this morning, about how commercials on the TV were the same today as they were yesterday.  Without thinking about it, I flatly told them that it doesn’t really work that way; that today isn’t really much different from yesterday. 

I realized right away, even without my wife’s reproving look, that I’d blundered a bit as a dad just then.  I remember being disappointed when I was a kid by how things failed to change over night between New Years Eve & New Years Day.  I had to explain to my kids that the real difference between 2012 and 2013 was not the messages in TV commercials, but what they, themselves, resolved to change…. and the work they put into making that happen.

That, of course, got me thinking about my resolutions for 2013..  I’d tweeted a couple cute ones last night, on New Years Eve…  but there’s one that I’ve been thinking about for a while now that I’ve only hinted at otherwise.

In 2012, I saw how much deeper problems seem to be running, economically….  how even some of my extended family would consider my immediate family’s lackluster financial situation to be a blessing compared to what they’re facing. 

Media news reports that the economy is improving.  That may be true on Wall Street, but it seems hollow on Main Street.  Indeed, the so-called improvements of 2012 feel like they’ve come at the expense of folks who have been on the brink of needing help.  Clearly trickle down economics have failed.  News of improvement only means that people are slower to give… because we’re not in such financial distress, anymore…  right?  Well… worse, with fiscal cliffs and inflation factors threatening to take hold in 2013, who can give?   Sadly, trickle up poverty seems to be in full effect.  

In the meantime, one thing that didn’t work out the way I’d hoped in 2012, was the results from my charity project. 

As a product, I’m very pleased with what I was able to publish in my spare time.  It’s an honest to goodness Sudoku puzzle game for Windows Phone…  no spyware, no malware, no ads, no personal information used or transmitted…   just the kind of game I wanted to play, and something I wanted to share.   I built it using tools that I wanted to work with.  I published it globally for free, and also for the U.S. for $5 with my own personal commitment to donate all proceeds to charity.  (Folks in the U.S. have a choice…  there’s no difference between the free and the paid editions of the app… it’s just if you want to donate to charity or not.)

As a tool for charity to raise funds and/or awareness…  well…  I’m hoping to change it’s past performance.  I understand that it looks bad that I can’t market the app with official cause logos & such from the charity I’ve committed to support…  I asked for permission for that, and for legitimate reasons, I couldn’t.  My hope was that the app would earn the privilege by the contributions it generated.  It’s been tempting to shoot first and apologize later, but in a world of “no good deed goes unpunished”, I didn’t want to take risks I couldn’t back up.

After an experimental social media campaign that mostly just annoyed friends & family on Facebook, I gave up.  There was too much real work that needed my attention.  I couldn’t let an effort that was getting nowhere cause me to fail at stuff like my job.  

I’ve decided to renew my efforts with the hope that it gains some traction at some point… I’m not fighting for the product; I have nothing to prove there. 

It’s the cause.  Helping hungry kids. 

I have yet to figure out exactly what this means… I don’t want to annoy friends & family… but the cause needs hands.

Even if you have no interest in my charity project as a fundraiser, please seriously consider contributing to the cause. Even if you can’t do that…  please help spread the word. 

This is their website:
No Kid Hungry

Tech in the 603, The Granite State Hacker

Getting at Office 365 SharePoint Lists In Windows Phone 7 Silverlight Apps

[Edit 7/8/2013:  I’ve tweaked this to note that this was for WP7.  WP8 has a whole new set of SDKs for SP integration, and it’s a different, and much easier story to use them.]

As promised from my presentation at SharePoint Saturday New Hampshire, I owe a code listing on the meaty part of the chat…  the Office 365 authentication component, especially.  It allows a Windows Phone Silverlight app to access things the lists.asmx service behind the Windows Live ID authentication.  (Frankly, the technique is the same, no matter what kind of client you’re using, but the demo I was doing was using Silverlight 4 for Windows Phone 7.

I also owe slides:
[office src=”https://r.office.microsoft.com/r/rlidPowerPointEmbed?p1=1&p2=1&p3=SD90A564D76FC99F8F!274&p4=&ak=!ABO7SzieOkx6gtY&kip=1″ width=”402″ height=”327″]

Here’s the activity rundown:

1)  The client app (“Windows Phone App”) makes a SAML SOAP request to https://login.microsoftonline.com/extSTS.srf
2)  The SAML response comes back, allowing the app to parse the SAML token.
3)  Make another call, this time to  {your Office365 team site}/_forms/default.aspx?wa=wsignin1, posting the token.
4) The response that comes back need only be checked for errors, the magic is in the cookie container.  It contains an HTTPOnly token (which the development tools do a terribly good job of hiding.)
5)  Assign your cookie container from your previous result to the ListSoapClient that you’re using to make your service calls from.
6)  Profit!

I broke up the “Activation” line on the client side to point out that the calls are Async.

In any case, I have a very rough SPAuthenticationHelper class that I also promised to post.

Here’s an example of how you can use it:

    class SPTasksList

    {
 
        SPAuthenticationHelper _authenticationHelper;
        ListsSoapClient _listsClient;
        bool isBusy = false;

        TaskItem currentUpdate = null;

        string _taskListUri = “http://spsnh.sharepoint.com/TeamSite/Lists/Tasks/AllItems.aspx”;

        public SPTasksList()

        {
            _authenticationHelper = new SPAuthenticationHelper(_taskListUri);
            _listsClient = new ListsSoapClient();
            _listsClient.GetListItemsCompleted += newEventHandler<GetListItemsCompletedEventArgs>(_listsClient_GetTasksListCompleted);
            _listsClient.UpdateListItemsCompleted += newEventHandler<UpdateListItemsCompletedEventArgs>(_listsClient_UpdateListItemsCompleted);
        }
 

        public voidBeginGetTasksList()

        {
            if (!_authenticationHelper.IsAuthenticated)
            {
                _authenticationHelper.OnAuthenticated += newEventHandler<EventArgs>(_authenticationHelper_OnAuthenticated_GetTasks);
                _authenticationHelper.SigninAsync(Configuration.UserName, Configuration.Password);
            }
            else if (!isBusy)
            {
                isBusy = true;
                XElement query = XElement.Parse(“Completed”);
                string ListName = “Tasks”;
                string ViewId = “{f717e507-7c6e-4ece-abf2-8e38e0204e45}”;
                _listsClient.GetListItemsAsync(ListName, ViewId, query, null, null, null, null);
            }
        }

        void_authenticationHelper_OnAuthenticated_UpdateTask(objectsender, EventArgs e)

        {
            _listsClient.CookieContainer = _authenticationHelper.Cookies;
            BeginUpdateTask(currentUpdate);
        }

……
} 

I ported this from a few other examples I found online to Silverlight for Windows Phone.  I apologize,  I haven’t had time to polish it, and I’m having a hard time with the embedded SOAP litteral, but here’s the SPAuthenticationHelper class:





using System;

using System.Net;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
 
namespace SPSNH_SPConnector.Implementation
{
    public class SPAuthenticationHelper
    {
        public CookieContainerCookies { get; set; }
        public boolIsAuthenticated { get; privateset; }
        public event EventHandler<EventArgs> OnAuthenticated;
 
        private bool_isAuthenticationInProgress = false;
 
        const string_authUrl=“https://login.microsoftonline.com/extSTS.srf”;
        const string _login=“/_forms/default.aspx?wa=wsignin1.0”;
       
        //namespaces in the SAML response
        const string _nsS = “http://www.w3.org/2003/05/soap-envelope”;
        const string _nswst = “http://schemas.xmlsoap.org/ws/2005/02/trust”;
        const string _nswsse = “http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd”;
        const string _nswsu = “http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd”;
        const string _nswsa = “http://www.w3.org/2005/08/addressing”;
        const string _nssaml = “urn:oasis:names:tc:SAML:1.0:assertion”;
        const string _nswsp = “http://schemas.xmlsoap.org/ws/2004/09/policy”;
        const string _nspsf = “http://schemas.microsoft.com/Passport/SoapServices/SOAPFault”;
        const string _samlXml =@” http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue http://www.w3.org/2005/08/addressing/anonymous https://login.microsoftonline.com/extSTS.srf {0} {1} {2} http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey http://schemas.xmlsoap.org/ws/2005/02/trust/Issue urn:oasis:names:tc:SAML:1.0:assertion “;

        Uri _uri;  
        HttpWebRequest _getTokenRequest = HttpWebRequest.CreateHttp(_authUrl);
        HttpWebRequest _submitTokenRequest = null;
        string _token;
 
        public SPAuthenticationHelper(string uri)
        {
            _uri = new Uri(uri);
            Cookies = new CookieContainer();
        }
 
        public voidSigninAsync(string userName, string password)
        {
            if (!_isAuthenticationInProgress)
            {
                _isAuthenticationInProgress = true;
                getTokenAsync(userName, password);
            }
        }
 
       
        private  void getTokenAsync(stringuserName, string password)
        {
            string tokenRequestXml = string.Format(_samlXml, userName, password, _uri.Host);
 
            _getTokenRequest.Method = “POST”;
            _getTokenRequest.BeginGetRequestStream(newAsyncCallback(Get_GetToken_RequestStreamCallback), tokenRequestXml);
        }
 
        private voidGet_GetToken_RequestStreamCallback(IAsyncResultresult)
        {
            string tokenRequestXml = (string)result.AsyncState;
            var reqstream = _getTokenRequest.EndGetRequestStream(result);
            using (StreamWriterw = new StreamWriter(reqstream))
            {
                w.Write(tokenRequestXml);
                w.Flush();
            }
            _getTokenRequest.BeginGetResponse(new AsyncCallback(Get_GetToken_ResponseStreamCallback), null);
        }
 
 
 
        private voidGet_GetToken_ResponseStreamCallback(IAsyncResultresult)
        {
            _token = null;
 
            varresponse = _getTokenRequest.EndGetResponse(result);
 
            var xDoc = XDocument.Load(response.GetResponseStream());
 
            var body=xDoc.Descendants(XName.Get(“Body”, _nsS)).FirstOrDefault();
            if (body != null)
            {
                var fault = body.Descendants(XName.Get(“Fault”, _nsS)).FirstOrDefault();
                if (fault != null)
                {
                    var error=fault.Descendants(XName.Get(“text”, _nspsf)).FirstOrDefault();
                    if (error != null)
                        throw new Exception(error.Value);
                }
                else
                {
                    var token = body.Descendants(XName.Get(“BinarySecurityToken”, _nswsse)).FirstOrDefault();
                    if (token != null)
                    {
                        _token = token.Value;
                        SubmitTokenAsync();
                    }
                }
            }           
        }
 

        private  void SubmitTokenAsync()
        {
 
            UriBuilder bldr = newUriBuilder(_uri.Scheme, _uri.Host, _uri.Port);
            _submitTokenRequest = HttpWebRequest.CreateHttp(bldr.Uri + _login);
            _submitTokenRequest.CookieContainer = Cookies;
            _submitTokenRequest.Method = “POST”;
            _submitTokenRequest.BeginGetRequestStream(newAsyncCallback(Get_SubmitToken_RequestStreamCallback), null);
        }
 
        private voidGet_SubmitToken_RequestStreamCallback(IAsyncResultresult)
        {
            var requestStream = _submitTokenRequest.EndGetRequestStream(result);
            using (StreamWriterw = new StreamWriter(requestStream))
            {
                w.Write(_token);
                w.Flush();
            }
            _submitTokenRequest.BeginGetResponse(newAsyncCallback(Get_SubmitToken_ResponseCallback), null);
        }
 
        private voidGet_SubmitToken_ResponseCallback(IAsyncResultresult)
        {
            UriBuilder bldr = newUriBuilder(_uri.Scheme, _uri.Host, _uri.Port);
 
            varresponse = _submitTokenRequest.EndGetResponse(result);
            string responseString = (newStreamReader(response.GetResponseStream())).ReadToEnd();
           
            bldr.Path = null;
            Cookies = _submitTokenRequest.CookieContainer;//.GetCookies(bldr.Uri);
            _isAuthenticationInProgress = false;
            IsAuthenticated = true;
            if (OnAuthenticated != null)
            {
                EventArgs args = new EventArgs();
                OnAuthenticated(this, args);
            }
        }
    }
}
 
 

Tech in the 603, The Granite State Hacker

Facebook’s People Hub Problem

I’ve had this thought cross my mind, too… some time ago, actually.   My smartphone, a Windows Phone, is a natural social network browser; a mature response to “how to make social networking easy, practical, and physically portable”. 

I would roughly guestimate that a good 50% of the OS, fresh out of the box, is dedicated to it (particularly the part known as the “People Hub”).   Interestingly, the People Hub isn’t a Facebook app.   It’s exactly what it sounds like…  a contacts hub, a leads hub, management hub, a communications hub, a social hub…   your people hub.   Twitter, Facebook, LinkedIn, multiple Exchange domains, even Windows Live.

Some time ago I actually deleted the Facebook app from my phone, because I couldn’t think of a good reason to let it take up space on my phone.  That was when it hit me.  Aside from the basic description in settings here & there, the Facebook brand did not really exist on my phone.  Nor did any of its advertisements.   My phone became the better part of the Facebook experience… without Facebook.

It doesn’t surprise me in the least that this has come to light in the recent IPO.  I gather that Facebook intends to start adding ads to news feeds.  I wonder how long it will be before Facebook starts offering subscriptions to remove them.   Or how long it will be before someone figures out how to filter them out again.
http://www.insidermonkey.com/blog/the-problem-of-mobility-and-facebook%E2%80%99s-battle-for-revenue-10985/

I have to say, though, the Facebook 2.5 update (relatively new) for Windows Phone does offer a couple features that make it worth keeping on the device.

The latest Facebook app can be found here:
http://www.windowsphone.com/en-US/apps/82a23635-5bd9-df11-a844-00237de2db9e

Tech in the 603, The Granite State Hacker

Windows Phone Live Tiles… What’s happening right now?

The first thing you see when you see a Windows Phone is the start display.  In fact, it’s so distinct, that it becomes the most identifiable feature of a Windows Phone at a distance.  Typically, the start display is populated with a number of application icons…  only on Windows Phone (and Metro) they’re all square or rectangles and are called Tiles.  

On second glance, you start to notice that many of these tiles have some form of light animation to them, typically communicating basic information.  The Tiles that open messaging apps indicate the number of new messages, for example.

When I first started playing with my Windows Phone, the live tiles seemed like a nifty gimmick… important for messaging features, but not really useful for anything else.

As I’ve dug in on app development for Windows Phone, I’ve come to see the Live Tiles as a really under-leveraged feature, communicating with users on a level that previously couldn’t be achieved.  They’re terribly simple, but terribly engaging.  I now see that they are the addictive component of Facebook’s classic “What’s on your mind?” status updates… statuses provided by the apps on your phone. 

In some cases, this literally translates to status update from your friends, since Tiles can be put on your start display for any contact.  (Since contacts are linked via the People Hub to their Facebook, Twitter, and Linked In…  voila!  one tile gets status updates for that individual covering all the bases.)

What’s really cool is that, like I said before, getting status updates is not limited to contacts.  I’ve got apps that have live tiles that… display current weather conditions including radar maps.  …show stock quotes & notifications.  …display photos from various sources.  … even shows your XBox avatar fully animated.

I’m in the process of adding a new feature to my hobby project, Jimmy Sudoku, to make use of live tiles to show the progress of the “current” puzzle.  

A new hobby project I’m working on has to do with the Granite State (NH) SharePoint Users Group that I am a principal organizer of.   This app will eventually be a hub for group information, offering member users easy access to schedules, speaker info, weather delay notifications, registration info, and even Power Point presentation slides.   Interestingly enough, a key feature will be to provide a live tile which will poll a webservice to get updates… the live tile will then let the user know they have important information to review, thus engaging the user.  (Sure, push technology’s available, but in this case, polling will be sufficient.)

The uses for this being able to re-engage a user after they’ve “quit” the application itself are significant.   I can easily imagine a time when the marketing significance of them makes building Windows Phone apps far more attractive to companies than iPhone or Droid apps.  Even if companies aren’t trying to hock a specific product…  imagine corporate “investor information” apps, for example, that provide easily accessible information about a company… but most importantly, providing “status updates” to investors to re-engage interest.

I’ll admit, at some level, this reminds me of electronic kids toys that attempt to re-engage kids in play after the kid has put it down and walked away by flashing a few lights & making a little noise.  There’s reasons those kids toys do that, though, and anyone paying attention with a mind for marketing will get what they are.

This is another Non-App for Windows Phone… one of the many cool features built into the device in an accessible, but non-cluttering way… and another reason I keep seeing Windows Phone as the IBM Compatible of smart phones.

So the above is why you want Live Tiles…   Here’s a code snippet that illustrates how:

using Microsoft.Phone.Shell;

… 

public static void UpdateAppTile(JimmySudoku4.Puzzles.SudokuState state)

{
    ShellTile appTile = ShellTile.ActiveTiles.First();

    if (appTile != null)
    {
        StandardTileData data;
        if (state.GetElapsedTime().Ticks == 0)
        {
            data = new StandardTileData()
                {
                    BackContent = “Game Complete”,
                    BackTitle = “Try again!”, Count = 0
                };
        }
        else
        {
            int completeCellCount =
                state.MasterList.Where(c => c.Value != 0).Count();
            int percent = (int)((decimal)((decimal)completeCellCount / (decimal)81)
                * (decimal)100);
            if (percent < 100)
            {

                data = new StandardTileData()
                    {
                      BackContent =
                            string.Format(“Elapsed Time:\n{0:hh:mm:ss}”,
                                 state.GetElapsedTime()),
                        BackTitle = string.Format(“{0}% complete”, percent)
                    };
            }
            else
            {
                data = new StandardTileData()
                    {
                        BackContent = string.Format(“Completion Time:\n{0:hh:mm:ss}”,
                            state.GetElapsedTime()),
                        BackTitle = “You Won!”
                    };
            }
        }

        appTile.Update(data);
    }
}