Build Day 1 Summary

June 26, 2013 Leave a comment

Just wanted to share my notes from day 1 at //build.

 

Day 1 Keynote

8.1 OS Beta Available

One of the biggest announcements was the preview of Windows 8.1 which you can download at http://preview.windows.com. It comes down to your machine as a KB patch that enables the update to show up in the store app on your device. You actually download and install the app through the Store. This is the first time I’m aware of that we’ve distributed an OS-level update through the store.

 

The update is about 2.1 GB and you can continue using the operating system while the update downloads in the background. Once the download is complete you’ll be prompted to reboot. The machine goes through several phases during the boot screen with the spinning white doughnut. The actual upgrade process takes a good 10 minutes after the download is completed (at least that’s how long it took on my Surface RT).

 

After the upgrade is complete you will have to go through the out of box experience again, including associating your device with a Microsoft account. But your data is still there and your apps are still installed. There is no way to revert to Windows 8.0, but the installer claims you will be able to upgrade to the final version of 8.1 when it becomes available.

 

8.1 Platform

The OS received 800 major features and the Windows Runtime received over 5,000 new APIs. These include things like bar code scanning, Bluetooth RFCOMM support and a lot more. I did see a lot of these demonstrated today and they didn’t feel like 5,000 new APIs. I wonder if this number includes the new Bing platform APIs (more below).

 

Apps appear to be much more tightly integrated. A demo showed going from Bing to Weather to Maps to OpenTable. Another demo showed going from a website with various artists to a playlist in XBOX Music. I’m hoping the session Building Apps that Work Together will provide more information.

 

Phones

Sprint finally has a good lineup of Windows Phones coming. The HTC 8XT looks similar to the 8X on AT&T and Verizon. They also have the ATIV S. With Sprint on board we can now claim all major US carriers have support for Windows Phone.

 

Bing as a Platform

To me, by far the biggest announcement in the keynote was Bing as a platform. This ‘platform’ is delivered as a set of controls that developers can just plug into their applications. Two of the most powerful demonstrated was the new map control with full 3D support and optical character recognition with language translation.

 

The map was beautiful and seemed to be even higher quality than the Nokia Here 3D stuff I was raving about a few weeks back. It even apparently supports scripting of the camera location and direction and does smooth animating between points. This was demonstrated with a virtual tour.

 

The OCR demo showed the user ‘scanning’ a business card in another language with the camera. The text was recognized and each word was framed in a border. Then with a touch, the card was translated into English in real time. Impressive stuff.

 

Project Spark

They closed with an updated live demo of Project Spark. I just cannot express how excited I am about this platform / game and when I got to play with it at lunch it blew me away. Multi-touch was just as fluid as could be on the 80” PixelSense screen. We created a few different games on the fly and folks from the product team were on hand to answer tons of questions. Of course it’s already been announced that we’re giving the game away for free, but I got confirmation that there will be new characters and add-ons for purchase. When asked if ‘players’ will be able to profit from their creations, the answer was ‘we have nothing to announce on that at this time’. Another attendee asked how it would be possible to import our own custom objects into the game, from, say 3D Studio. His answer was “We have nothing to announce regarding 3rd party partnerships at this time.” Telling, I think. Exciting for sure.

 

What’s new in the Windows Runtime for Windows 8.1

I was really glad to hear one of the first things they mentioned in this session, which is that they’ve put a bunch of work into improving performance in XAML for 8.1. Not that XAML had terrible performance issues in 8.0, I’m just really glad to see the team continue to invest engineering effort into the XAML UI technology.

 

A number of new controls were demoed, but probably the most important one is the HubView. We finally have a very prescriptive way of creating the fairly standard “Home” page for many Windows 8 applications.

 

There’s an update to WebView that allows it to correctly play in screen compositing (previously it only displayed on the top of the Z-Order, so flyouts and things were drawn under it. That’s been fixed. And we now have the ability to put islands of WebGL content in even our XAML apps if we wanted to.

 

There’s an interesting new option for writing apps that directly support dual screen systems. So, for example, you could have an app where a cashier sees one thing and a customer sees another but it’s all just a single app.

 

Speaking of Point of Sale, we now have native APIs for barcode readers and mag stripe readers. The mag stripe reader is obviously a sensitive resource. You don’t want another app stealing it away from you when the user is about to swipe their credit card. The device is actually shared across apps, but apps have the ability to capture it and hold onto it during critical times. It’s an interesting API.

 

There’s a new HttpClient. It looks just like the .Net HttpClient but it’s a WinRT component so it can be used in C++ and WinJS applications now as well.

 

They demonstrated speech synthesis. The API looks similar to the API on Windows Phone in that you create a synthesizer and tell it to SynthesizeText. What was interesting in the demo is that the text was synthesized to a stream. They then played the stream in a MediaElement but they also said it could be saved to a file or stored in the cloud. One of the things I thought was interesting is that because it’s played through a standard MediaElement it could also be “remoted” via PlayTo.

 

Finally, they attempted to demonstrate Bluetooth but the demo failed. They were going to control a Sphero robot but they couldn’t get it to pair.

 

Building an App That Connects to Devices

In this session I was hoping to see a lot of code and demos on connecting to various devices, but it was more of an overview about what’s possible. With 8.1 now supports the following:

 

· Fingerprint readers

· Barcode readers

· Mag stripe (credit card) readers

· Geofencing (trigger when the user enters or leaves an area)

· Virtual Smart Cards

· 3D Printing

· Image Scanning

 

In addition to “well-defined” interfaces for known devices, 8.1 also adds support for “custom” devices by supporting industry standard protocols like

 

· Bluetooth RFCOMM

· Bluetooth Smart / Low Power

· HID

· USB

· Wi-Fi Direct

 

This mode of talking to a device is analogous to opening a socket or a serial port and sending bytes. You have to know what packets the device is expecting (i.e. the “shape” of the data) and then you can communicate. They encouraged device developers to wrap protocols into WinRT components so that they’re easier for application developers to consume.

 

There is also now an official process that hardware manufacturers can go through so that the first time a user plugs in a device, Windows will download and launch the companion application. This is all hooked through the Auto Run infrastructure and the device manufacture has to go through an extra registration process, but it looks pretty cool.

 

Applications now have a new trigger that they can run on when they’re associated with a device. Applications that run on the custom device trigger can run for up to 10 minutes in the background, allowing for things like data sync or even potentially firmware updates while the app is not in the foreground.

 

In the end I felt like I would have better benefitted from attending one of the more in-depth sessions like Apps for Bluetooth, HID and USB Devices.

 

Developing Neural Networks Using Visual Studio

This was the last session I attended and it was mainly out of a curiosity I’ve had for a long time with Artificial Intelligence. The guy was from MS Research and he was pretty entertaining to listen to. He demystified some of the verbiage around the topic and tried to give the audience a kick start, but I still felt you needed to have some basic understanding of the subject matter to benefit from his talk. I was pretty disappointed that the title of his talk included the words “Using Visual Studio” and yet he spent less than 5 minutes running code and didn’t even explain how it worked.

 

 

 

Anyway, so far I’m having a great time and really looking forward to Day 2.

Categories: Cool, Development, Mobile Tags:

Thoughts on PCLs (Portable Class Libraries)

June 4, 2013 1 comment

I’m working with a number of partners right now that want to target both Windows Phone and Windows 8 using a single codebase. This post is a copy of an e-mail I send to them when they’re getting ready to start development using Portable Class Libraries.

First, I’d like to share some libraries that I’ve found to be invaluable during PCL development:

 

HttpClient for PCL

http://blogs.msdn.com/b/bclteam/archive/2013/02/18/portable-httpclient-for-net-framework-and-windows-phone.aspx

Windows 8 has the most advanced client for reading data from the web asynchronously. That client is called HttpClient. Unfortunately HttpClient doesn’t exist on Windows Phone, so the moment you check the box to include Windows Phone support in your PCL you lose the ability to leverage HttpClient and have to use the older WebClient. This library adds the awesome tool back into your PCL project.

 

MVVM Light PCL

http://nuget.org/packages/Portable.MvvmLightLibs

MVVM Light is one of the most popular libraries for implementing the MVVM pattern on Windows Phone and Windows 8. Until recently they had one library for Windows Phone and another library for Windows 8. This made it impossible to create ViewModels in a PCL project. Now that they have a PCL library you can create all of your ViewModels in PCL and use them on both platforms. The only trick is make sure you reference the PCL version of this library in you Windows Phone and Windows 8 projects as well (not the platform-specific versions).

 

 

Finally, are PCLs the right approach for your project? Though I’m a fan of PCLs, I have found there are times when it takes more effort to work around the limitations of PCL than it does to just share (link) code across projects.

 

For example, let’s say you want to remember a setting between application runs. On Windows Phone you use a class called IsolatedStorageSettings and on Windows 8 you use ApplicationData.Current.LocalSettings. If you wanted to abstract this difference in a PCL you would have to create an interface (let’s call it ISettingManager) and inject that interface from the host application down into the PCL when the application starts up. This is called "Dependency Injection" and you can read more about this approach in Portable Class Libraries: A Primer.

 

Although dependency injection absolutely will solve this problem, it’s also somewhat complicated to implement. You have to define the interface, create two platform-specific implementations of the interface (one for WP and one for Win8) and then you have to remember to pass the implementation into the PCL on application start. It’s not rocket science, but it is a lot of effort to solve for such a minor difference.

 

Another approach is to link a .CS file into both projects and take advantage of conditional compile statements. Here’s a short article on conditional compilation in Visual Studio.

 

With this approach we could easily write the following class and use it in both projects:

 

static public class SettingManager

{

    static public void SetValue(string name, string value)

    {

        #if WIN_RT

            var settings = ApplicationData.Current.LocalSettings;

            settings.Values[name] = value;

        #elif WINDOWS_PHONE

            var settings = IsolatedStorageSettings.ApplicationSettings;

            settings[name] = value;

        #endif

    }

 

    static public string GetValue(string name)

    {

        #if WIN_RT

            var settings = ApplicationData.Current.LocalSettings;

            return (string)settings.Values[name];

        #elif WINDOWS_PHONE

            var settings = IsolatedStorageSettings.ApplicationSettings;

            return (string)settings[name];

        #endif

    }

}

 

Notice that the compiler takes care of including the right lines of code for each platform. In my opinion this is a lot simpler than creating interfaces and dealing with dependency injection. However, if PCLs make sense for your project using shared files and conditional compilation can be very helpful when creating the interface implementations (wrappers).

Office Hours

February 15, 2013 Leave a comment

I hold weekly Office Hours on Wednesdays from 12pm to 2pm. On the 1st and 3rd Wednesdays of the month I hold them at the Microsoft store in the Galleria mall. On the 2nd and 4th Wednesdays I hold them online.

 

What are Office Hours?

Simple, it’s a time where I’ll be available for folks who are working on Windows 8 apps to come by and ask questions, show off apps in progress, and in general get help getting their apps in shape for publishing to the Windows Store. I’ll also will be able to help with Windows Phone 8 apps and Windows Azure questions… I just may have to do additional research before I can get you an answer.

 

Schedule

 

Please sign up for a slot via the ohours.org button above so that I can manage my time more effectively, and let me know if you’re coming to get some questions answered (and a heads-up on the questions will give me some time to do any needed homework) or just to spend some quiet time coding. Feel free to email me at jbienz [at] microsoft.com.

Windows 8 App Madness

February 14, 2013 Leave a comment

clip_image002 

We’re excited to announce the new Windows 8 App Madness Challenge for Students. With this challenge we hope to excite and motivate thousands of students to build Windows 8 apps over the next 2 months!

Overview:

· $100/app for up to five Windows 8 apps students publish to the Store.

· Accelerator: 4 sprints during the challenge. The student who publishes the most apps during the sprint wins a trip for 2.

o Facebook poll of students will determine the trip destination. Get voting!

· Timing: From February 12th – April 11th.

 

Here’s the link to get started:

http://aka.ms/Windows8AppMadness

Categories: Development, Mobile Tags:

Two Nokias for the Price of One

February 6, 2013 Leave a comment

Wiliam Fink wrote in to share: “While this is not specific to developers, Nokia is running a buy-one 920, get the second 920 for free.  On AT&T this comes out to two Nokia 920s for $99.  For people wanting to develop for Windows Phone 8, this deal might be the icing on the cake.”

Link: http://www.nokia.com/us-en/products/phone/lumia920/

Ends: 2/21/2013

Categories: Cool Tags:

Student Store Accounts FREE

February 5, 2013 Leave a comment

Students, did you know that you can get your Windows Phone and Windows 8 developer accounts for free?

Here are all the details, step-by-step:

How to get your free student Windows 8 store account

How to get your free student Windows Phone store account

Categories: Cool, Development Tags: ,

Incentives for App Developers

February 5, 2013 Leave a comment

There are so many incentive programs for our developers right now that I needed a list just to keep track of them all. Below is what I have so far, thanks in large part to Jeff Blankenburg and Ryan Lowdermilk.

I’m sure we’ve missed other incredible opportunities, so if you know of anything that should be on the list please e-mail me and let me know.

 

Student Store Accounts (Students Only)

Students, did you know that you can get your Windows Phone and Windows 8 developer accounts for free?

Here are all the details, step-by-step:

How to get your free student Windows 8 store account

How to get your free student Windows Phone store account

 

Generation App

clip_image001

Generation App is an ongoing loyalty program for developers of Windows 8 and Windows Phone 8 store apps.

Link: bit.ly/winappsupport

Platforms: Windows 8 and Windows Phone 8

Ends: Ongoing

Phone: 1-800-895-4212

Hours: M-F 6:30 AM to 5:00 PM Pacific

Incentives:

  • Up to 30 minutes with a Windows 8 design expert to review your app and provide guidance on creating a stunning user experience.
  • Up to 30 minutes with a Windows 8 architect to assist with building on Windows 8.
  • More incentives to be announced soon…

Windows 8 App Madness (Students Only)

clip_image002[7]

With this challenge we hope to excite and motivate thousands of students to build Windows 8 apps over the next 2 months!

Link: http://aka.ms/Windows8AppMadness

Platforms: Windows 8

Ends: 4/11/2013

Incentives:

  • $100 gift card per app! (limit 5)
  • Accelerator: 4 sprints during the challenge. The student who publishes the most apps during the sprint wins a trip for 2.
  • Facebook poll of students will determine the trip destination. Get voting!

Ultimate Experience

clip_image003

Ultimate Experience has some cool prizes and it’s more like a raffle than a competition.

Link: generationapp.com/ultimateexperience

Platforms: Windows 8 and Windows Phone 8

Ends: 2/28/2013

Incentives:

  • 1 App: Store account fees reimbursed and a copy of Halo 4
  • 1+ Apps: Every app increases the chance of winning one of 12 XBOX consoles with Kinect
  • 1+ Apps: Every app increases the chance of winning one of 3 trips to visit Microsoft Game Studios

WP Next App Star

clip_image004

Your chance to be on TV, win devices and more!

Link: bit.ly/wp8appstar

Platforms: Windows Phone 8

Ends: 3/5/2013

Incentives:

64 Winners Receive:

  • A Nokia Lumia 920 Windows Phone
  • Featured promotion in the Windows Phone Store
  • Exposure via online media
  • A 1-year free Dev Center subscription

Grand Prize:

  • All of the above, PLUS Featured placement of your app in a Windows Phone primetime TV ad in the U.S

Nokia DVLUP

image

This Nokia developer loyalty program keeps the fun and prizes coming year round. This program is currently in beta and a code is required to join, so you can e-mail me and I’ll see if I can get you a beta code.

Link: dvlup.com

Platforms: Windows Phone 8

Ends: Ongoing

Incentives:

  • Get credit for old phones (any make and model) toward a new Nokia
  • Submit applications to challenges and win experience points
  • Cash in experience points for prizes like Nokia phones, gift cards (Amazon, Starbucks, etc.), XBOX consoles and more
  • New challenges and new prizes every month

Nokia Buy 1 Get 1 Free

While this is not specific to developers, Nokia is running a buy-one 920, get the second 920 for free.  On AT&T, this comes out to two Nokia 920s, for $99.  For people wanting to develop for Windows Phone 8, this deal might be the icing on the cake.  — Thanks to Wiliam Fink for the tip!

Link: http://www.nokia.com/us-en/products/phone/lumia920/

Platforms: Windows Phone 8

Ends: 2/21/2013

Incentives:

  • 2 phones for the price of one!

Social Good Contest

image

Windows 8 Apps for Social Good invites both new and seasoned developers to create an app for “social good”.

Link: bit.ly/win8socialgood

Platforms: Windows 8 and Windows Phone 8

Ends: 2/28/2013

Incentives:

  • Best Overall Windows 8 App: $15,000 + Windows Phone
  • Best Overall Windows Phone 8 App: $15,000 + Windows Phone
  • People’s Choice: $10,000 + Windows Phone


Dev support, design support and more awesome goodness on the way: bit.ly/winappsupport


Categories: Cool, Development, Fun Tags: ,

Advanced Text Formatting in Windows Store Apps

February 4, 2013 2 comments

A developer asked me recently how to format text in Windows Store apps. Specifically he wanted to add bullet points to some article text he was displaying.

 

The sample templates like GridApp include a special class called RichTextColumns under the Common folder. This class wraps a normal RichTextBlock (which would run off the screen if its text got too long) to splits it into multiple columns by generating more RichTextBlocks for any overflow. There’s a property on RichTextColumns where you specify the content to be displayed called RichTextContent. It’s where any child markup in Xaml gets stored at runtime. So, in order to format the text, we need to change the content of the RichTextContent property.

 

It turns out the RichTextContent property is a RichTextBlock, so anything you can do with a RichTextBlock can be spread across multiple columns. That makes sense. The trick is usually to convert from some standard markup you know (let’s say HTML) to the child elements supported by RichTextBlock. There are several ways to do this but my favorite is to make a new control called HtmlRichTextColumns that inherits from RichTextColumns and can parse HTML content. Here are the steps:

 

  1. Remove sealed from RichTextColumns so we can inherit from it.
  2. Change ResetOverflowLayout to protected instead of private so we can call it from our inherited class.
  3. Create a new class called HtmlRichTextColumns and inherit from RichTextColumns.
  4. Add a dependency property called Markup with a type of string. Use the version of PropertyMetadata that calls a method whenever the value changes and have it call a private method MarkupChanged.
  5. In MarkupChanged, parse the text into Runs, Images, etc. and add them to the RichTextContent property. Then call ResetOverflowLayout to generate the columns.

 

Parsing the HTML itself is outside the scope of this article (maybe I’ll cover it in a later post). For now I’ll point you to the forum thread How to Convert Html to a RichTextBlock content. To the specific question about bullet points, well unfortunately the List tag isn’t supported in Windows 8. Shane Melbourne found a decent workaround by using indented paragraphs and symbols. You can read how he did it in the forum thread RichTextBlock Bullet list.


Dev support, design support and more awesome goodness on the way: bit.ly/winappsupport


Categories: Development Tags:

Personal Win 8 Developer Help

November 12, 2012 Leave a comment

Interested in some 1:1 help to get your Windows 8 app to the finish line? Let me offer some assistance!

 

If you live in Houston or surrounding areas, consider joining me and other local developers for Coffee and Code at the Microsoft office. This will take place on 12/12 from noon to 4:00 PM Central time.

Register for Houston Coffee and Code

 

Not in Houston? Don’t want to wait till December? I hear you! Join me online on 11/22 from 10 AM to 4 PM Central for 1:1 help over Lync. We can whiteboard, share desktops, send files, etc.

Register for Online Assistance

 

Hope to see you there!

Categories: Development Tags:

How to Share Your Windows 8 App with Friends for Testing

October 26, 2012 2 comments

Sometimes you’d like to share an app with friends or family for testing purposes before submitting it to the store. And many times those friends or family won’t have Visual Studio installed. This blog post walks you through the steps for building and shipping your app to another person for testing purposes.

 

First, make sure to change the project build to ‘Release’ instead of ‘Debug’. This can be done from the Visual Studio toolbar.

image9

 

Now, under the Debug menu, clean and then rebuild the solution.

image14

 

After the build completes, right-click on the project in the Solution Explorer window and choose Store –> Create app packages…

image19

 

When prompted if you want to build the app for the store, say no.

image176

 

When the app packages are finished building you’ll be presented with the option to run the certification kit.

image

Do NOT launch the Certification Kit. Instead, click OK.

 

After dismissing the dialog:

  1. Go into your project folder
  2. Then into the AppPackages folder
  3. Then into the <AppName>_<AppVer>_<AnyCPU | ARM | x86 | x64>_Test folder
  4. Select the .ps1, .appx and .cer files and add them to a zip file
  5. Send the zip file to your friends and family
  6. Ask them to unzip the zip file into its own folder (under My Documents is fine)
  7. Ask them to right-click the .ps1 file and choose Run with PowerShell (just double-clicking the .ps1 file may not work)
  8. Ask them to follow the on-screen prompts and accept the installation of the developer certificate (installing a developer certificate will require a Windows Live ID)
  9. The application should now appear on their Start Experience, ready to test
  10. . When they’re done testing they can uninstall the app like any other Store app (just right-click and choose Uninstall from the Start Experience App Bar)

image5

Categories: Development Tags: