To the Cloud!

NOTE: This is a personal blog post. If you usually come here for technical content, please feel free to skip this one

First, a big thank you to everyone who reached out over Twitter and email after my last blog post. I am humbled that so many of you care about me. The last blog post was, surprisingly, the most popular one on this blog. I promise this will be the last of my blog posts marking this transition in my personal life. However, it will certainly NOT be the last blog post I make about Windows. There’s a lot there I want to talk about. In fact, now that I’m not officially employed by Microsoft (as of midnight tonight) I feel like I can comment on Microsoft’s strategy without the encumbrance of my comments being seen as the official line. But before I do that, let’s talk about what I’m going to be doing next.

As some of you may know I used to work in the team that built and release SQL Server 2012. As I was getting ready to leave that team to come work for Windows we were prototyping a new service that eventually turned into Azure Data Factory. Go check it out, it is pretty cool. Well, that was one of my first run-ins with the world of big data and the cloud.

But Windows Phone beckoned. I plunged myself into Windows Phone and the wonderful world of what is now called Universal Windows Platform. It was everything it promised to be. I ended up learning more about Windows, Android, iOS and Mac OS X than I’d ever known. Somewhere along the way, early 2014 to be exact, all of the operating systems at Microsoft finally got rolled into one. This is what became Windows 10. Thanks to that change I got the chance to contribute to the Universal Windows Platform, a platform that defines the future direction of Windows and hopefully a healthy chunk of client computing. Not just on phones, desktops or laptops either, but on HoloLens, Surface Hub, Internet of Things devices and other things that I don’t even know about. In other words, I had a criminal amount of fun!🙂

Now however it is time for me to go build my cloud muscle. After 9 years at Microsoft I was also hankering for some place with a very different culture. I found both of those things in Salesforce. After all, what better place to learn about the cloud than the place that started it all almost 16 years ago. Imagine trying to convince businesses to put their most critical data on your servers with the knowledge that they’re going to be one of many tenants on your server. Imagine doing this at a time when most businesses ran their own data centers and co-located servers. Imagine doing this at a time when small and medium sized businesses couldn’t even think about using “enterprise-grade” software. Yet that is exactly what Marc Benioff and his team managed to do. I am fascinated by the amount of trust Salesforce has been able to build with their community of users and this is my chance to learn how that works.

I will be helping build out the platform for Salesforce’s Marketing Cloud product. So yes, I will still be working on APIs and my customers, for the most part, will still be developers (both internal and external) but this time they’ll be cloud developers. But building applications at Salesforce is so much more than just trying to bring people who can write code into the fold. It is about giving business analysts, marketers and customer-facing people the ability to define what the software they use looks like. That’s a very different audience from the one I’ve traditionally interacted with so I’m a little scared and very excited.

Finally, there’s a very personal reason Salesforce appeals to me. Years ago when I was in high school I saw my father struggle to manage stock in his wholesale business operation. It was all paper and ledgers and inventory registers. Somehow I convinced him to buy a computer because I thought it would help us do a better job of managing the business. This was 1997 and state if the art in India was a Compaq machine with a Pentium clone processor from Cyrix. This machine cost us almost Rs. 70,000 (about $1200 at the time) which was a lot of money by Indian standards. Well, once we’d bought the computer we had a “now what?” moment. We went looking at commercial software on offer and pretty much the only thing we could find was a product called Tally that clearly did not meet out needs. This made sense because there was no easy way for someone like us to communicate our needs to Tally at the time.

So I ended up building a solution using DBase 3 Plus. It worked, but now I was on the hook to fix all bugs and I had to back the critical data up on floppy disks every week. We also had to have printouts handy just in case the floppies went bad. At the time, I would have killed to have the sort of cloud solutions available to businesses today. We would have loved to manage our customers using a mature CRM system or reach out to them using a decent marketing product. But we were constrained not only by the technology of the day but also the business models in vogue at the time. I really really believe in the cloud and in software being a service rather than something you build and forget about because I’ve been on the other end of the “old” world. I also believe that a smart cloud and client are going to be important parts of every business in the very near future.

So it’s time for me to stick my head into the cloud and see what happens. Wish me luck!🙂

Change

NOTE: This is a personal blog post. If you usually come here for technical content, please feel free to skip this one

Change is wonderful. I have this deal with myself where I evaluate where I am in my career and personal life every 2 years. Sometimes, this evaluation leads me to a new career path but most times it just re-energizes me to go and work even harder at whatever I’m doing at the time. Well, it’s time for another one of those events and this time I’ve decided to leave Microsoft and go pursue a different path.

I love Microsoft and I am very very proud of the products I’ve been part of over my 9 year career here. I started working in Microsoft consulting services selling and educating customers about our products. Implementing solutions based on Microsoft technology. If you’ve ever had freight shipped to you on a Norfolk Southern train you’re indirectly using technology my team built. If you’ve ever had Coca Cola we were part of the bottling process in some small way. I also worked on the team that shipped SQL Server 2012, Windows Phone 8.1, Windows 8,1 and most recently of course Windows 10. I know how unbelievably lucky I am to have had these opportunities and for that I am grateful.

Microsoft gave me the opportunity to be a consultant, a developer and a program manager. Microsoft also helped me achieve my life long dream of coming to the United States and building a career in this fine country. For those reasons and because I firmly believe in Satya’s vision I remain fully invested in Microsoft’s future. In fact, I just bought a house in Redmond which is pretty much a Microsoft town. So in some sense my fate is now even more tied to Microsoft than it was before. Oh, and I already pre-ordered a Surface Book🙂

As far as this blog is concerned, not much will change. I will continue blogging and talking about Windows 10. There’s a LOT of stuff we built into it that still needs discussion and Windows 10 will go to places and do things in the future that will make it even more valuable to be a Windows developer. I’ll still be a Microsoft/Windows fanboy. Only now, it’ll be from the outside.

P.S.: You would not believe how long I spent coming up with a title for this post. In fact, I might still change it. That’s what’s so wonderful about electronic publishing (that’s blogging for you young ‘uns).

Now, for your viewing pleasure, a picture of me looking mock sad as I leave Microsoft and hand over my credentials:

Goodbye Microsoft
Goodbye Microsoft

Finally, the email I sent my colleagues at Microsoft:

Hello!
 
I’m sending you this email because I’m about to leave Microsoft. Yup, it’s one of those messages. I always feel really weird and conflicted when I get one of these messages. Occasionally, it’s a great time to go say goodbye to dear colleague who has decided to pursue a different opportunity. Mostly, it leads to a frantic look up on the address book to figure out who it is and whether I should care about them leaving. If it’s the latter for you, please stop reading now. If it’s the former, keep going.
 
9 years is a long time. That’s nearly how long I’ve been part of Microsoft. People call us the evil empire and I must admit I fully expected to see people hatching conspiracies in cigar smoke filled rooms when I joined. Guess what, haven’t seen any of those rooms yet. What I did realize was that we’re just a collection of engineers trying our level best to build things we (and hopefully others) want to use. In the time I’ve been here I’ve worked with the consulting services team, with SQL server and the last couple of years with Windows. These have been some of the most fruitful and engaging times in my life and you all have made that possible in one way or another. So thank you! Thank you for showing me the way, thank you for calling me out when I was doing something wrong and thank you for putting up with my many foibles. You’ve made me the engineer, the program manager and most importantly the person that I am.
 
This is beginning to sound like an Oscar speech so I’m going to stop right here. If you’d like to reach me, the details are below. I’m still going to be on the eastside (just bought a house here!) so drop me a line if you’d like to meet up and talk. One last thing! If you don’t mind, please put a recommendation for me on my LinkedIn profile. I strongly believe that you, my colleagues, are the best equipped to judge my performance so please take a moment and do it for me J
 
Good luck folks!
 
Arun
 
Here’s how you can reach me in the future:

LinkedIn: http://www.arunjeetsingh.com
Twitter: @aruntalkstech
Facebook: https://www.facebook.com/arunjeetsingh
Blog: http://www.aruntalkstech.com
Xbox: Arunjeet Singh2

Launch a WPF (Win32) App from a Universal Windows App

If you want to jump straight into the code go here: https://github.com/arunjeetsingh/SampleCode/tree/master/UniversalAppLaunchingWPFApp

In my last post I talked about launching a Universal Windows App from a WPF app. Today, we go the other way around. Not many people are aware of this but Windows has had support for custom protocol schemes (mailto:, ftp:, skype: are good examples) aka deep linking since about 1996. In fact, the Internet Explorer team introduced the idea in the Platform Developers Conference of ’96. I even talked about it during my Build session here.

What does that mean for us? Well, it means that practically any app can sign up for a custom scheme. That includes apps written in Windows Presentation Foundation (WPF), WinForms, plain old Win32 and even Visual Basic. All an app developer has to do is create a specific set of registry entries to let Windows know that they would like to handle a custom scheme. Of course, if you’re writing a universal app you can simply put that information in your manifest and we’ll take care of creating the registry entries. In this blog post, we will learn how to create a WPF app that registers for a custom scheme. We will then see an example of a universal app that launches the WPF app we created using the custom scheme. Let’s get started!

To follow along, clone the repository at https://github.com/arunjeetsingh/SampleCode and open the solution at UniversalAppLauncherWPFApp\UniversalAppLaunchingWPFApp.sln.

Creating the WPF Protocol Handler

The WPFProtocolHandler project is a simple WPF app. All of the interesting code lives in the MainWindow.xaml.cs file. The first piece of code that warrants our attention is the code that installs a protocol handler. Before you click that button, know that the code requires admin privileges to run. The best way I found to accomplish this was to simply start WPFProtocolHandler.exe as administrator and then install the protocol. Here’s what we do to install a protocol handler:

private void InstallProtocol_Click(object sender, RoutedEventArgs e)
{
    using (var hkcr = Registry.ClassesRoot)
    {
        if (hkcr.GetSubKeyNames().Contains(SchemeName.Text))
        {
            MessageBox.Show(string.Format(“Looks like {0} is already installed.”, SchemeName.Text));
            return;
        } 

        using (var schemeKey = hkcr.CreateSubKey(SchemeName.Text))
        {
            //[HKEY_CLASSES_ROOT\com.aruntalkstech.wpftarget]
            //@=”Url:WPF Target Protocol”
            //”URL Protocol”=””
            //”UseOriginalUrlEncoding”=dword:00000001
            schemeKey.SetValue(string.Empty, “Url: WPF Target Protocol”);
            schemeKey.SetValue(“URL Protocol”, string.Empty);
            schemeKey.SetValue(“UseOriginalUrlEncoding”, 1, RegistryValueKind.DWord); 

            //[HKEY_CLASSES_ROOT\com.aruntalkstech.wpf\shell]
            using (var shellKey = schemeKey.CreateSubKey(“shell”))
            {
                //[HKEY_CLASSES_ROOT\com.aruntalkstech.wpf\shell\open]
                using (var openKey = shellKey.CreateSubKey(“open”))
                {
                    //[HKEY_CLASSES_ROOT\com.aruntalkstech.wpf\shell\open\command]
                    using (var commandKey = openKey.CreateSubKey(“command”))
                    {
                        //@=”C:\\github\\SampleCode\\UniversalAppLaunchingWPFApp\\WPFProtocolHandler\\bin\\Debug\\WPFProtocolHandler.exe \”%1\””
                        commandKey.SetValue(string.Empty, Assembly.GetExecutingAssembly().Location + ” %1″);
                        commandKey.Close();
                    }

                    openKey.Close();
                }
                shellKey.Close();
            }

            schemeKey.Close();
        }

        hkcr.Close();
    } 

    MessageBox.Show(string.Format(“Custom scheme {0}: installed.”, SchemeName.Text));
}

As you can see, all that code is doing is creating a bunch of registry entries. The file at UniversalAppLauncherWPFApp\SolutionItems\InstallWin32ProtocolHandler.reg presents the registry entries in a slightly more readable format. By creating these registry entries, we instruct Windows to register whatever text was in SchemeName.Text as a custom scheme. We then point this custom scheme at the WPFProtocolHandler executable. The Uninstall button’s click handler simply finds the registry key corresponding to SchemeName.Text and remove it.
So what happens when WPFProtocolHanlder is activated with a custom scheme? That’s where the MainWindow() constructor comes in. In here, we take apart the incoming custom scheme URI and present it to the user. Note that the custom scheme URI comes in as a command-line argument to the WPF app. This is because we put the little %1 when we were setting up the command registry key’s default value above. Here’s what MainWindow() looks like:

public MainWindow()
{
    InitializeComponent();

    var args = Environment.GetCommandLineArgs();
    if (args.Length > 1)
    {
        Uri argUri;
        if (Uri.TryCreate(args[1], UriKind.Absolute, out argUri))
        {
            var decoder = new WwwFormUrlDecoder(argUri.Query);
            if (decoder.Any())
            {
                InputUrI.Text = string.Empty;
                foreach (var entry in decoder)
                {
                    InputUrI.Text += entry.Name + “=” + entry.Value + “,”;
                    inputs[entry.Name] = entry.Value;
                } 

                InputUrI.Text = InputUrI.Text.Remove(InputUrI.Text.Length – 1);
            }
        }
    }
}

We simply break apart the incoming URI and put key/value pairs in the query string into the InputUrl textbox.

The Windows10Launcher App

Now that we’ve built the WPF app we want to launch, lets take a quick look at the Universal Windows App that will be doing the launching. The Windows10Launcher app is exceedingly simple. It has a textbox where the URI we want to launch goes and a button that takes the text, converts it into a URI and launches it using our old friend Launcher.LaunchUriAsync. Here’s the click handler for the Launch WPF App button:

private async void LaunchWpfApp_Click(object sender, RoutedEventArgs e)
{
    var launchUri = new Uri(UriToLaunch.Text);
    await Launcher.LaunchUriAsync(launchUri);
}

It’s that simple! It is easy to imagine a WPF or Win32 app that might start up and establish a connection back to the universal app that launched it by way of an app service as described here. This makes it really easy to pair your Win32 and universal apps together and have them communicate with each other. It also gives us a way to slowly migrate code from a WPF app over to a universal app over time without having to rewrite the whole thing in one go.
As always, happy hacking!

Launch a Universal App from a WPF App

If you want to jump straight to the code, it lives here: https://github.com/arunjeetsingh/SampleCode/tree/master/WPFAppLaunchingUniversalApp.

The Windows Win32 APIs have been around for a long time. A lot of very useful technology like Windows Forms and Windows Presentation Foundation (WPF) have built on top of Win32 APIs over the years. WPF and WinForms also power many applications around the world. With the introduction of the Universal Windows Platform (UWP) an app developer can now reach pretty much any device that runs Windows 10. However, there are times when one needs to connect an existing desktop Windows application built in WPF or WinForms to newer universal apps. In a previous post, I talked about how a WPF or WinForms app can call into an app service provided by a Universal Windows App (UWA). In this post, I’d like to talk about how a WPF or WinForms app can launch a UWA.

The process of launching a universal app from a WPF/WinForms app actually looks very similar to launching a universal app from another universal app. To follow along with this blog post, clone the repo https://github.com/arunjeetsingh/SampleCode and open the solution at WPFAppLaunchingUniversalApp\WPFAppLaunchingUniversalApp.sln.

Putting Together the Universal Target App

We start with the UniversalTargetApp project. This project is a Windows 10 universal app that implements a protocol handler. It does so by declaring the windows.protocol extension in it’s package manifest. Open the Package.appxmanifest file in this project to see the extension declaration. Normally, it should open in the manifest designer which presents declaration information in the Declarations tab. As you will see, we sign up for the protocol scheme name com.aruntalkstech.universaltarget. Using the reverse domain naming convention like I do here is just a good idea because it lowers the odds of your custom scheme colliding with someone else’s. I own aruntalkstech.com so I know someone else is unlikely to use the same scheme randomly. I also talked about this in my Build talk this year.

Another thing we do in the UniversalTargetApp is print out the Package Family Name of the app on it’s main page. Here’s the code to do that:

UniversalTargetApp\MainPage.xaml.cs

protected override void OnNavigatedTo(NavigationEventArgs e)
{
  PFN.Text = Windows.ApplicationModel.Package.Current.Id.FamilyName;
}

We will use the Package Family Name (PFN) later when we launch the UniversalTargetApp from our universal app. In addition to this, we have the UniversalTargetApp go to a different page (ProtocolActivationPage.xaml) when it is activated with a protocol scheme. The code to do that lives in UniversalTargetApp\App.xaml.cs:

protected override void OnActivated(IActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
string uri = string.Empty;
var protocolArgs = args as ProtocolActivatedEventArgs;
if(protocolArgs != null)
{
uri = protocolArgs.Uri.ToString();
}
rootFrame.Navigate(typeof(ProtocolActivationPage), uri);

  // Ensure the current window is active
  Window.Current.Activate();
}

All this code does is figure out whether the app was “protocol activated” and if it was it pulls out the URI it was activated with and navigates to the ProtocolActivationPage with the URI as a parameter. On the ProtocolActivationPage we pull out the URI and present it to the user in a TextBlock. Code for that is in UniversalTargetApp\ProtocolActivationPage.xaml.cs.

The WPF Launcher App

Next, lets take a look at the WPF project that contains the app that will do the launching. I use a WPF project here because that is the .NET user interface technology I am most familiar with. However, code along similar lines should also work for WinForms or plain old Win32 applications.

First, we must ensure we can reference Windows 10 APIs inside our WPF app. To do that, I updated the project file for the WPF project (WPFLauncherApp.csproj) to add a reference to Windows 10 metadata. You can see the additions yourself. Right-click the project, then selecting Unload Project, then right-click again and select Edit WPFLauncherApp.csproj. Here’s what the new references look like:

<!– Light up Windows 10 features –>
<Reference Include=System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL>
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.dll</HintPath>
</Reference>

<Reference Include=System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL>
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.WindowsRuntime.dll</HintPath>
</Reference>

<Reference Include=Windows>
<HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd</HintPath>
</Reference>
<!– Light up Windows 10 features –>

Now we can reload the project and reference any Windows 10 APIs we want to. In the WPF project we have a button in MainWindow.xaml that will be used to launch the universal target app we built. Before we launch the universal target we also try and detect whether it is installed. We do this in the OnActivated handler for MainWindow.xaml. The code lives in WPFLauncherApp\MainWindow.xaml.cs. Here’s what it looks like:

protected override async void OnActivated(EventArgs e)
{
  //Test whether the app we want to launch is installed
  var supportStatus = await Launcher.QueryUriSupportAsync(uri, LaunchQuerySupportType.Uri, TargetPackageFamilyName);

  if (supportStatus != LaunchQuerySupportStatus.Available)
    {
     Status.Text = “Can’t launch com.aruntalkstech.universaltarget: because the app we need is “ + supportStatus.ToString();
    }
}

Launcher.QueryUriSupportAsync is a new Windows 10 API. This API lets us check whether a specific custom scheme (com.aruntalkstech.universaltarget in our case) is supported on a device. What’s more, we can use the PackageFamilyName of the universal target app to ask it whether the app that supports it is indeed the universal target app we just built. This is great because now we can be sure we are launching exactly the app we wanted to launch. If the app is not available we show the user a message.

When the user clicks the Launch Target App button on MainWindow.xaml we launch the universal target app in the button’s Click handler. Here’s what the click handler for the Launch Target App button looks like in WPFLauncherApp\MainWindow.xaml.cs:

private async void LaunchTargetApp_Click(object sender, RoutedEventArgs e)
{
  var options = new LauncherOptions { TargetApplicationPackageFamilyName = TargetPackageFamilyName };
bool success = await Launcher.LaunchUriAsync(uri, options);
Debug.WriteLine(success);
}

That’s it! Note that we use the Package Family Name of the universal target app here as well to make sure we launch the app we want. Also bear in mind that you can use app services to continue communicating with the universal target app once you’ve launched. This post goes into details about how that would work.

Happy hacking!

@aruntalkstech

A Tweet for the Future of Twitter

NOTE: This post was also published on Medium: https://medium.com/@aruntalkstech/a-tweet-for-the-future-of-twitter-3b7eeae6f5e2

I love Twitter. I use it everyday. So the recent news about Twitter’s less than stellar market performance has me worried. I have long felt that Twitter has a unique place in the online milieu. Unfortunately, it’s a place that everyone except Twitter seems to understand. So I’m putting my amateur product manager hat (turban for me?) on and putting together a set of speculative feature ideas for Twitter to use. I don’t really know if anyone from Twitter will ever read these but here they are nevertheless.

0. Open up the API Floodgates!

This is idea #0 because it’s just that important. All great products eventually turn into great platforms if they want to survive long enough (iPhone, PCs, Government). That’s because a platform is a marketplace that gives those outside the organization that built the product a means to express themselves. It is a tacit acknowledgement of the fact that not all good ideas will come from within your organization. And it is good. I hear this is already being addressed so I won’t say more about it.

1. Embrace Your Place as the World’s Breaking News Source

Over the years, Twitter has become a wonderful place for breaking news. Unfortunately, Twitter has not embraced their fate as the breaking news destination for the planet like I imagined they would. When terrorist struck Mumbai in November 2008 Twitter was the best source of breaking news about the event. Long before the TV journalists woke up, people who were there were already tweeting about the incident. The strange thing was that back then, Twitter wasn’t even that big in India. My girlfriend at the time (my wife now) lived in Mumbai and I found myself better informed than she was while sitting hundreds of miles away from Mumbai.

Eventually I figured Twitter would learn to surface world events based on geography. In fact, I was doubly sure that would happen when modern smartphones with location tracking abilities started showing up. None of that happened. Instead, we got the little “trending” tab/pivot which is a poor substitute for what I was looking for. Twitter needs a News view. In fact, I would argue that ought to be the main view of the app. The view needs to be hyper-local and in my face when I wake up in the morning. Human beings are rapacious consumers of news, especially news even remotely relevant to them, just ask CNN. Twitter has the best news sources in the world. So good in fact that CNN, NBC and many other mainstream news sources feed off of Twitter’s feed.

So, idea #1: Build a news view and put it front and center in the main app. If that sounds like too much of a risk, build a Twitter News app and promote the shit out of it. Take my location, interests (who I follow) into account and present the most relevant news that matter to me here. Track engagement and figure out what I care about and then take that data, rinse, repeat.

2. Live Tweeting Shouldn’t be Something Someone Has to Do

Live tweeting events has become a “thing”. Every time an event I care about happens I feel like I must choose which feed to follow. If I follow The Verge’s coverage of an Apple event I know I’m getting a biased albeit in-depth view. To balance out the coverage I also follow live tweets from other publications. But there’s so many, how do I choose? Well, the answer is I shouldn’t have to.

Idea #2: Poach the best editors from online publications, especially those that specialize in pithy, short form content and put them to work curating live tweet sessions from major public events. Imagine a live tweet stream of the next presidential inauguration, or a session of congress about to vote on a major bill, or even a supreme court hearing (are phones allowed in the supreme court?). Remember, everything that is tweeted on Twitter is public by default and Twitter has THE best view on all this data. Again, promote this on the News pivot/app I suggested previously and watch Twitter turn into a true second-screen experience.

3. In Depth Reporting

Twitter has become my go to news source over the years. Despite it’s shortcomings, the fact that I can follow people whose views I respect means that it is the best place for me to find content I am likely to care about. But guess where every link on my Twitter timeline leads: SOMEWHERE OTHER THAN Twitter!

Now I’m not saying Twitter ought to outlaw links to other sites on it’s timeline. No sir! What I am saying however is that Twitter should become a possible destination for long form content. Part of what this will require is for Twitter to acknowledge that human beings sometimes need more than 140 characters to express their thoughts. It is okay to limit what shows up on the timeline to 140 characters. But Twitter has one of the best sources of detailed information about any newsworthy event: the actual testimonies of people on the ground. I find it strange that Twitter does not want to leverage these testimonies and the people behind them.

Idea #3: This is what I like to call guerilla journalism. Some people might know it as citizen journalism, as in the idea pioneered by CNN’s iReport. But Twitter has something CNN does not have. For any given event Twitter knows the most well-informed people on the ground. It also knows the most influential people on the ground. What if Twitter were to turn these people into ad-hoc reporters and pay them to write pieces covering the event after the fact. Because Twitter would give them special access and good tools they will be able to mine tweets for real testimony about what was happening during the event. In many cases, these people are already journalists or influential bloggers trying to drive traffic to their sites. They drive traffic because they expect to be paid by way of advertising dollars or a salary. Well why can’t that money come from Twitter.

The other ancillary benefit this has is that it makes Twitter not only a source for breaking news but a source for analytical pieces that come AFTER the event. Look at all the pieces that were written about the riots in Ferguson after the fact trying to analyze exactly what happened there. Why can’t those pieces live on Twitter properties. A lot of them are ALREADY using quotes from Twitter.

I want to believe that Medium is an effort to plug this gap but the lack of a clear ramp from Twitter to Medium makes me think that might not be the case. Also, what’s my incentive to write long form content on Medium versus my own blog or my employer’s blog?

4. A New Source for Relevant Video

This idea follows from the previous one. Today, if you follow a link for long form video coverage of an event it invariable leads to YouTube or the news outlets own video player. Yet, at least some of these people would gladly record the video as part of their tweet. I had hoped Vine would grow out of it’s stupid 6 second limit to fill this gap but it took the coming of Meerkat/Periscope for Twitter to wake up to the power of video.

To be honest, while I criticize Twitter it does look like they are addressing the news video gap with Periscope. However, the way Periscope has been presented to the public isn’t right. For one thing, it has been relegated to a separate app and second, it is presented as something that has to do with frivolous live content. This is easily rectified however. Twitter needs to get the guerilla journalists I talked about above to cover news events using tools like Periscope. They also need to make it possible for people to get already recorded videos into Periscope and indeed the main Twitter timeline. If a guerilla journalist took a nice video camera to a newsworthy event they should be able to get it into Twitter easily and quickly.

Idea #4: Bring long form video (including live video) into the main Twitter app and work with the likes of GoPro to get it easy to tweet a video. Invest in Hyperlapse like technology to make the job of amateur videographers easier. Hire news video editors, take videos from influential tweeters and edit them down into mainstream news style vignettes with the tweeters consent of course. And pay the tweeters a cut of the revenue they generate for their efforts.

Conclusion

I would love for an enterprising product manager in Twitter to pick up these ideas and use them. Smarter people than myself will see that all of the ideas above are monetizable either by advertising or other means. Really, all of these ideas are nothing new. These are things that mainstream journalism has been doing for years. But I’d like to see Twitter use it’s unique place in the world to enrich investigative journalism, hyper-local reporting, breaking news coverage and news video. ALL of these things are within reach. Twitter has the potential to become the news source of record for the whole planet.

In the end, I feel like Twitter spends too much time competing with the likes of Facebook on their own turf. Twitter is a social network yes, but that’s only part of it. There is so much that is unique about Twitter and they need to learn to play to their strengths. I’d be very very sad if Twitter became to Facebook what Ebay became to Amazon. That is, wait so long to leverage their unique strength that the other guy just came in and took their potential from them.

@aruntalkstech

How do I style the DragAndDrop adorner for Windows Universal Apps

Windows 10 adds support for dragging and dropping content into Universal Windows Apps. This is a feature that was previously only available to Classic Windows Apps (think WPF or WinForms). To get started with Drag/Drop support on your universal app, take a look at this excellent video: https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/22?wt.mc_id=player. Andy talks about drag/drop about 30 minutes in.

Drag/drop is great, but a question came up recently thanks to Lance McCarthy. How does one control the icon and text that shows up as a user is dragging an item into a universal app? Well, I reached out to some folks on the team with that question and the answer proved useful for Lance. That got me thinking. Maybe it would be useful to have that information up here as well🙂 So here goes.

The icon (named “glyph” in the API) part of the Drag and Drop feedback cannot be customized:
• when the cursor is not over a drop target, the glyph indicates that no operation will take place if the user releases the pointer
• when the cursor is above a drop target, the drop target can hide the glyph by setting IsGlyphVisible=False on the DragUIOverride member of the event args (see https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.drageventargs.draguioverride.aspx) but the glyph’s shape is hard-coded and depends on the AcceptedOperation returned by the target (Copy, Move, Link or None)

So there you have it. The shape of the glyph while it’s NOT over a drop target can’t be controlled. I would expect that because Windows doesn’t know what to do with the dragged content yet. But once it’s over a target, it can use the API described above to mess around with the glyph. I hope this helps you if you’ve been looking for more details on drag/drop in Windows 10.

Happy hacking!

@aruntalkstech

ChatMessageManager.ShowComposeSmsMessageAsync Crashes on Windows 10 Desktop

Some of you read that title and thought: “Of course it crashes on desktop! You can’t send text messages on desktop!”.  However, as you’ll notice here, the Windows.ApplicationModel.Chat.ChatMessageManager is a universal API. That means a universal app can use this API without having to add any mobile specific extensions. This is great, because it allows you to build a single app that can light up text message features on Windows 10 versions where sending text messages is supported while still making all the other features available elsewhere.

Problem is, as @yortw pointed out in this tweet:

the ChatMessageManager.ShowComposeSmsMessageAsync API crashes the app on desktop. Even worse, it isn’t the kind of crash that can be handled by an app. Anyway, having to swallow an exception in order to find out whether sending texts is available would be a pretty crappy way to handle this. What if I don’t want to draw the Send Text Message button unless text messaging is available. Well, worry not, for ChatMessageManager.GetTransportsAsync is riding to the rescue!

The GetTransportsAsync API simply returns a list of chat messaging transports available on a device. What this means that at the moment this API will return an empty set on desktop and a set of 1 or more transports on mobile. So, it should be straightforward to write code to check if a transport is available before calling ShowComposeSmsMessageAsync (or drawing the button). That’s exactly what the sample at https://github.com/arunjeetsingh/SampleCode/tree/master/ComposeTestMessage does. Note that your app will have to have the “chat” capability to use the ChatMessageManager.GetTransportsAsync API. The sample app does this by declaring the capability in it’s package.appxmanifest. Thanks to Maurizio Manca for pointing that out in the comments.

As always, feel free to reuse the code in there in your app and send in a pull request if you find a bug.

Happy hacking!

@aruntalkstech