telerik

January 2, 2012 telerik win8

Your First Metro style App in JavaScript

Your First Metro style App in JavaScript

DISCLAIMER: This post is targeted at the //build/ version of the Windows Developer Preview (aka Windows 8). Things are likely to change with future releases. On your head be it.

A Windows Metro style app” is an application built for the devices running the new Windows user experience of Windows 8. A Metro style app built using JavaScript is a first class Windows application built with the technologies of the web, e.g. HTML, CSS, JavaScript, JSON, SVG, etc. Unlike a web site, a Metro JS app is not deployed page-by-page from a web server, but rather installed locally on the user’s machine. Like any other first class Windows app, a Metro JS app has access to the underlying platform and is able to share information with other apps.

Like any web site, a Metro JS app starts with an HTML file:

<!DOCTYPE html>
<html>
<head><title>Hello, Win8</title></head>
<body><h1>Hello and welcome to Metro style Win8!</h1></body>
</html>

This HTML, if it were loaded in the web browser, would result in the world’s most boring web site. Also, surfing to a web page in the browser is not at all how your customers will execute a Metro style app. Instead, they’ll install it from the Windows Store and execute it from the Start Screen:

image

Further, a web page (or series of web pages, styles, code, resources, etc.) is not a Metro JS app. A Metro JS app includes these things, but also includes metadata and resources:

  • A manifest file to describe your application, including the name, description, the start page, etc.
  • A set of large and small logo images to be displayed by the shell.
  • A store logo to be displayed by the Windows Store.
  • A splash screen to show when your app starts.

The manifest file is an XML file called appxmanifest.xml and a minimal one looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">

  <Identity
    Name="hello"
    Version="1.0.0.0"
    Publisher="CN=Microsoft Corporation, O=Microsoft Corporation,
L=Redmond, S=Washington, C=US
" /> <Properties> <DisplayName>Hello</DisplayName> <Description>Hello</Description> <PublisherDisplayName>csells</PublisherDisplayName> <Logo>images\storelogo.png</Logo> </Properties> <Prerequisites> <OSMinVersion>6.2</OSMinVersion> <OSMaxVersionTested>6.2</OSMaxVersionTested> </Prerequisites> <Resources> <Resource Language="en-US" /> </Resources> <Applications> <Application Id="hello.App" StartPage="default.html"> <VisualElements DisplayName="Hello" Logo="images\logo.png" SmallLogo="images\smalllogo.png" Description="Hello" ForegroundText="light" BackgroundColor="#0084FF"> <SplashScreen Image="images\splashscreen.png" /> </VisualElements> </Application> </Applications> </Package>

The manifest has things in it like the name of the application, the description for the application, a reference to the images and, most importantly, the name of the HTML file that represents the app’s start page.

With the manifest and supporting files in place, getting your super exciting app registered with the system is a matter of starting up PowerShell (which you can do from the Start Screen by typing powershell”), and importing the appx” module (Figure 1).

image

If you’re not familiar with it, Windows PowerShell is the next-gen command line shell built into Windows. Out of the Win8 box, it comes with the appx” module, which allows you to manage the modern applications installed on your computer:

  • Add-AppxPackage: install an application so that it can be launched
  • Get-AppxPackage: get a list of installed applications
  • Get-AppxPackageManifest: get the manifest details of an installed application
  • Get-AppxLastError: get the details for the last appx-related error
  • Remove-AppxPackage: uninstall an application

The appx” part of the command names come from the packaged form of a Metro style app, which is called an appx” after the file extension. To create one, you can use the MakeAppx.exe” command-line tool available via the Developer Command Prompt available on the Start Screen. The job of MakeAppx.exe is to package your application, manifest and all, into a single file with a .appx” extension. An appx file is a file in the Open Packaging Conventions (OPC) format, which essential means it’s a .zip file with a few extras. If you’re going to package and sign your application for submission into the Windows Store, you may decide to use MakeAppx.exe and SignTool.exe as part of that process.

However, to simply test an application on your developer box, Add-AppxPackage gives you all you need:

image

In addition to taking a path to a .appx file, the Add-AppxPackage command allows you to pass in the path to a manifest file using the -Register option, which gives you the ability to install your application for testing without going through the extra step of packaging:

image

You can double-check that your application has been installed using the Get-AppxPackage command.

Once your application has been installed, you can see it in the shell:

image

Launching it will you show the inspirational Hello” message displayed full-screen without any Windows chrome.

Where Are We?

After seeing what files and tools used to build and install a Metro style app, you’re probably already hoping for a tool to help you create, edit, package, launch and debug. For that, we’ve got Microsoft Visual Studio 11 Express for the Windows Developer Preview (aka VS11), which we’ll talk about next time.

Portions Copyright © 2011 Microsoft Corporation. Reproduced with permission from Microsoft Corporation. All rights reserved.

December 13, 2011 spout telerik

Goodbye Microsoft, Hello Telerik!

Goodbye Microsoft, Hello Telerik!

I have gotten to do a ton of really great things at Microsoft:

  • I got to write a column on WPF and turn that column into not one, but two books.
  • I got the excitement for every blog post in the first two years wondering if this was the one that was going to get me fired. (It was close a few times.)
  • I got to throw several Developer Conferences (DevCons).
  • I got to spin up a completely new community from scratch (“Oslo”).
  • I got to stay up all night erasing the word WinFS” from all of microsoft.com.
  • I got to be part of a Microsoft product team from incubation through startup to product and then to kaput.
  • I got to get ordained as a minister so that I could marry a PM from the WPF team to a PM on the WCF team as part of the talk I gave with Doug Purdy at the 2008 PDC.
  • I got to prepare for that talk with Doug until 4am, then walk back to the hotel, causing people to cross the street to stay away from us. And then I got to give that talk with Doug the next morning right after restoring my copy of Windows that had crashed 30 minutes before.
  • I got to drag Lars Wilhelmsen up on stage to read Norwegian from the Oslo Tour Guide book, only to find I was pointing him at German.
  • I got to throw an SDR.
  • I got to play poker with Microsoft power brokers far above my level (and take their money : ).
  • I got to sleep at Don Box’s house and become an adjunct part of his family.
  • I got to have two design reviews with Bill Gates (as hard as I tried, I could never see him actually enter the room).
  • I got to turn developer feedback into hundreds of bugs across dozens of products.
  • I got code into Vista (and I assume into Windows 7 and Windows 8 as well).
  • I got to work on the team that built the most ambitious set of templates ever shipped with Visual Studio.
  • I got a very quick, very deep education on JavaScript and CSS.
  • I got to help drive the developer story for an entirely new platform: WinRT, WinJS and Win8.
  • I got to lead two product teams through two PDCs (OK, one PDC and one //build/).
  • I got to give the //build/ keynote launching the Visual Studio 11 tools for Windows 8 with Kieran Mockford, who will forever be my //build/ buddy.
  • I got to see how the sausage is made for SQL Server, WCF, WPF, Silverlight, Windows Phone 7, Windows 8 and a host of others. I am forever changed.

Those and dozens more have all been extraordinary experiences that have made my time at Microsoft extremely valuable. But, like all good things, that time has come to an end.

telerikLogo-web-450x180pxAnd now I’m very much looking forward to my new job at Telerik!

Telerik is an award-winning developer tools, UI controls and content management tools company. They’re well-known in the community not only for their top-notch tools and controls, but also for their sponsorship of community events and their free and open source projects. Telerik is a company that cares about making developer’s lives better and I’m honored that they chose me as part of their management overhead. : )

My division will be responsible for a number of UI control sets — including WinForms, WPF, Silverlight and ASP.NET — as well as a number of tools — including the Just line, OpenAccess ORM and Telerik Reporting. I’m already familiar with Telerik’s famous controls and am now ramping up on the tools (I have been coding with JustCode recently and I like it). My team is responsible for making sure that developers can make the most of existing platforms, knowing that when you’re ready for the next platform, we’ll be there ready for you.

These controls are already great (as is the customer support — holy cow!), so it’ll be my job to help figure out how we should think about new platforms (like Windows 8) and about new directions.

And if you’ve read this far, I’m going to ask for your help.

I’m going to be speaking at user groups and conferences and blogging and in general interacting with the community at lot more than I’ve gotten to do over the last 12 months. As I do that, please let me know what you like about Telerik’s products and what you don’t like, what we should do more of and what new things we should be doing. Telerik already has forums, online customer support, blog posts and voting — you should keep using those. In addition:

Feel free to reach out to me directly about Telerik products.

Of course, I can’t guarantee that I’ll take every idea, but I can guarantee that I’ll consider every one of them that I think will improve the developer experience. I got some really good advice when I first arrived at Microsoft: Make sure that you have an agenda.” The idea is that it’s very easy to get sucked into Microsoft and forget why you’re there or what you care about. My agenda then and now is the same:

Make developers’ lives better.

That’s what I tried to do at Intel, DevelopMentor and Microsoft and that’s what I’m going to try to do at Telerik. Thanks, Telerik for giving me a new home; I can’t wait to be there.