Windows 8 Developer Preview

Recently i have been playing with the Developer Preview of Windows 8 with Visual Studio 11 so i thought that i would write a quick article on my findings to date.

I have been focusing on creating a simple tile for the much anticipated Metro interface with some interesting results. First of all you can create a Metro live tile using either C#, C++, VB, HTML5 or JavaScript, yes you read that correctly, JavaScript.

Microsoft have created there own JavaScript library to help you integrate with Metro called WinJS. WinJS is constructed in a similar way to JQuery so if you are familiar with that framework you should feel at home with WinJS. It basically attempts to simulate the same API that you would use if you was coding in C# or another compiled language.

No matter which language you choose to code with you will soon realise that you are coding in a sandbox. The Metro API’s are cut down versios of the full language API’s with restricted access everything. If you want to communicate with a web service you need to select the correct capability in the application manifest, if you want to read/write a file you need to select that capability etc…. and with those capabilities in place you will only be able to access a limited set of things. Lets take the Document Library as an example of a capability, When selected you will be able to read and write to files ONLY in the Document library and nowhere else.

Interestingly, it seems that all file operations are only acccessibly via Async calls, likewise, performing a WebRequest only has the Async methods BeginGetRequestStream, EndGetRequestStream, BeginGetResponseStream, EndGetResponseStream which makes for some interesting code.

It is possible to write code around the restricted API but as soon as you do you will find that the app will fail the application certification tests.

Thats all for now, but i will write some more later including some example code for a simple Windows 8 Metro Tile.

1 Comment

  1. Sounds like they’re making it work the same way as Silverlight/WP7 with declarative capabilities – maybe so it’s easier to integrate in the near future? Look forward to finding out.

Comments are closed.