Tuesday 6 November 2012

Microsoft Surface Windows 8 RT: How to deploy/debug application

Windows 8 RT has restriction on launch 3rd party application, which were downloaded/delivered to device not from Microsoft store. Microsoft selected the same strategy as Apple. I already described in previous article what will happen if you launch application, copied to the Surface device manually, even if it is compiled for the ARM processor. Operation system will show alert message:

Windows 8 RT: message "This app can't run on your PC"


The question is obvious: How to develop/deploy and test applications on your personal device?
The answer is "You have to switch you device into developer mode." I am going to describe how to do it in this article.

Development Environment:

Simple scenario (work at an office) - one PC (dev box) and Surface device on the same network segment


Technically, you need one computer with installed Visual Studio 2012 and your tablet, which is connected to the same network segment. You will use 1st one to develop application and debug application and tablet for the user interface interactions.


PC Configuration
Memory: 4Gb
CPU: i5
Operation System: Windows 8 Enterprise
Development Tool: Microsoft Visual Studio 2012
Location: Office

Microsoft Surface Device
Memory: 2Gb
CPU: ARM type
HDD: 64 Gb
Location: Office


Advanced Scenario - work remotely 

There is common scenario when your main development box (powerful one) is located at an office but you are at public place (Starbucks for example) and you need to test something and check-in code to source control system, such as TFS.  In this scenario you have to use VPN access, but it is better if you have additional laptop (any OS, which will support VPN connection and remote desktop). I am using Apple MAC Air in my case.

Here is simple diagram, which shows how it will work:



you will you use VPN connection from your laptop and Microsoft Surface to your office. You laptop will be connected to dev box by RDP (remote desktop). The result will be pretty same.

Additional laptop makes you really mobile developer and you can work from anywhere!!!!
When I am working from home, I prefer to use the same scenario but I also use Apple TV to stream my MAC Air screen to Huge TV. This is a beauty of the Apple technologies!

So....
I am using my MAc to develop applications for the Microsoft Windows 8 RT :-)

Using Apple MAC Air to RDP to MS Windows 8 Enterprise with installed Visual Studio 2012 and debug Windows 8 Rt application on my Microsoft Surface device. Screen from MAC is streamed to TV via Apple TV.



Setup Microsoft Surface device for the development

Microsoft uses the same approach as Apple - make device compatible with development mode. 
The best approach to do it is to install "Remote Tools", which come with Visual Studio 2012.


Simply copy rtools_setup_arm.exe executable file from that folder to your Surface device (ARM determines CPU. in Pro version it will be Intel) and install it. you will be prompted for couple dialog boxes and it is done.

After installation of the remote tools you will see 2 new applications at Metro-style screen: "Remote debugger" and "Microsoft Test Tools Adapter".

Windows 8 Rt with installed "Remote debugger" and "Microsoft Test Tools Adapter"

To allow Visual studio deploy/run application at Microsoft Surface device, you have to configure remote debugger. After run "Remote debugger", you have to setup security (I turned it of in this sample) and management port. If you work from multiple places, I recommend to use port 8080 - it is standard second http port for the web browsing and open in most providers, so you will not have any issues with development. 

Microsoft Remote Debugger configured at Windows 8 RT
when you will start configure remote debugging tool, you will be prompted to switch this device to development mode.



Setup Development computer

I have heterogeneous environment at my office, so i used Hyper-V to setup new instance of Microsoft Windows 8 operation system and installed Microsoft Visual Studio 2012 on it. If you interesting how it will work from learning perspective, you can download trial version of OS and dev tool, which will be valid for 90 days.

You can create any type of Metro-style project  - I used Metro-style Grid template in this sample. Next step is to configure Visual studio for the remote debugging: select project debug properties with option target device "Remote machine". You have to enter your Surface device ip address and port, which you configured in previous step.

VS 2012: setting up remote debug settings

you can also find you computer in network:

VS 2012: search Microsoft Surface with remote debugging tools

Deploy application

Next step is to prepare package and deploy it to Microsoft Surface device. you have 2 options here: manual deployment and automatic deployment during debug mode.

Setup Package Application Manifest

before create package, you have to setup some package parameters, such as application name, release version, certificate etc....
Simply find package.appmanifest file in project, double click on it and it will oped UI with configuration:




Manual deployment

If you have visual studio and don't have connected device, you can prepare package, copy it to usb key and deploy it offline. in this case, you have to do right click on properties and select "Store\Create App package" in popup menu.

VS 2012: Create application package


VS 2012: package creation - local mode



Next screen is very important for the package creation. You should setup release version, select checkbox if you want to increase release version automatically or not and you have to select compilation option for the platforms (select ARM for the Windows 8 RT).

VS 2012: package creation - release version/ compilation option  
VS 2012: package complete


After you copy package from "AppPackages" (folder can contain different releases. select which you want) to device, you have to run deployment script by right mouse click on file "Add-AppDevPackage" and select "Run with PowerShell".

Windows 8 RT: deploy package via PowerShell

Next step is magic step, which close Windows 8 RT eyes on all deployment policies and allows install application on device:

Windows 8 RT: changing the execution policy via PowerShell
After package is deployed, you should be able to see application at metro-Style style.


Automatic deployment

Automatic deployment is a beauty - you just need start Visual Studio in debug mode( press "F5" key) and application will be automatically deployed to remote device. If you did previous step, you will be alerted that such application was already deployed but you still have an option to re-deploy and run it.

Next step is to setup break points in solution and use your fingers on device touch screen.

Summary

As always, Microsoft shows that Visual Studio is very powerful tool, which allows developers to use the same tool to create/debug new types/styles of applications. I would wish if it would be the same for the rest :-)

Happy debugging!!!




Saturday 3 November 2012

Microsoft Surface Windows RT 8 - 64GB as is - My review

If you visit Microsoft store (today is 2 Nov 2012), home page says
"Experience Surface at a Microsoft Store near you". What I did, I went to "Eaton Centre" - Toronto downtown, where Microsoft opened retails store and bought it !!!

Microsoft Surface: Windows 8 RT


In this article I am going to review it from my point of view. I heard and read many news about windows 8. I even downloaded it and developed couple apps with "Metro style" but never used it on real device. My decision to purchase was to test it in my hands.

I am technical person and have computers at home and at work. The reason only to buy mobile devices such as tablets is to use it for work or for entertainment, so I will compare my purchase with some Apple products. I am not covering everything, but only what I found during a day (I will describe UI features in next article).

Price

Retail store didn't have 32Gb version, so I bought 64Gb version of Microsoft Surface Win-RT. Retail price on it was 719CAD + taxes = 812.47 (hate taxes). As you can see it is not so cheap - It is price of the pretty good laptop nowadays. Let's see what is inside.

(as I said, I bought 64GB version, which is 100 CAD more expensive then 32GB). Technically speaking I bought 32GB for the 100CAD + taxes!!! Awesome profit for manufacturer.

Device

Device weight


It is pretty heavy for mobile device. If you hold device by one hand and type text you will be tired very soon. It is one of the reasons why Apple is releasing mini iPad (sweet thing is that it will have 4G, so I can use cellular data plan), which I am going to buy.

Device hardware



Microsoft Surface: hardware information


CPU: ARM (not intel) - it means that all apps, should be compilable with ARM option
Memory: 2GB - well, Windows and 2GB sounds dangerous, but take into consideration that it is RT version it could be good :-)
Ports: microSD, USB 2.0 (pro version should have USB 3.0), Micro HD Video (Pro version should have display port). If you want connect device to your monitor, you have 3 options - use micro HD Video and use adapters: USB->HDMI or USB->VGA, which you can buy right as MS Store for "only" :-) ~44CAD

HDD: 64Gb but in reality
OS shows 54GB only, where 10GB eaten by OS. In a fact I have 46Gb free only. I only updated existing apps (described below) - It is definitely catch for end users.

Microsoft Surface: Windows 8 RT -  hdd catch

Device keyboard


Device has attachable keyboard. I liked idea to have keyboard to be attachable to device by magnet, but is has its own issue - it doesn't highlight symbols when it is dark, like it Apple does with laptops. I am a person who work day and night and it is very critical to see symbols on a keyboard :-)

Do you see it on next picture?

Microsoft Surface: Windows 8 RT - keyboard is not visible in dark


Screen Zoom


What disappointed me is that screen zoom doesn't work everywhere. It works inside of running applications if they support it, but not in desktop mode. When I brought my device to work, we tried to use it right away to customize desktop and use RDP (remote desktop access) to manage other computers but it is not possible with touch screen - you can easily press wrong menu item and delete files instead of copying them.

Surface: Windows 8 RT - zoom is not working.
It is not possible to select small menu items and objects.


It works good only when you RDP to another Windows 8, which has metro style :-) I made picture of that to show:

Windows 8 RT: using Remote Desktop Connection to another Windows 8,
where I run metro style application :-)



Another option is to use mouse pad, located at keyboard but I found it working not very good (my personal feeling - I use many laptops with no issues but this keyboard has an issue from user experience perspective - in general).

Applications


Every technical person would be happy to have fully functioning windows on mobile device, even if device is not so powerful, but Windows 8 RT restrict use 3rd party applications. You can only download new apps from Microsoft Store (which is very weak at this point of time). Another thing - you cannot even use this device to debug applications. I copied application to this device, which was developed by VS and compiled for the ARM CPU, but here is a message:


"This app can't run on your PC. To find apps for this PC, open the Windows Store. "
Microsoft is fully controlling applications, which will be coming to this operation system. Developers in the same situation as on Apple's platform. I have read couple of articles that MS already rejected some popular applications to be on MS store. I am pretty sure that very soon new hack will be releases, which will allow to to run ARM compiled application not via MS Store.


Windows 8 RT is coming with Office 2013, but it is Home/Student edition. The fact is that it has missing Visio stops me from creating technical documents with diagrams by using this device.

Applications' updates

Staring from this point, all applications which you downloaded by using "Store" will be auto-updated by Store (the same idea as Apple store).

Windows 8 RT: app updates via Microsoft Store


At the same time, you shouldn't forget about "Windows Update". Here is what was Updated right after I bought it:

Windows 8 RT: Windows updates after I bought new device

Internet Browsing - Flash


I expected to see working flash in internet explorer, but flash is working only on approved by Microsoft sites - sucks.


XBox 360 control - SmartGlass


Yes, you can use this device to manage XBox 360. I downloaded XBox SmartGlass application and tried it. It sounds sweet in promo but in reality it sucks.

SmartGlass requirements:

You have to login with the same account on SmartGlass as you currently logged in on XBox. if you have multiple profiles on XBox and switch them, you have to switch them on SmartGlass - it is becoming nightmare.

Use tablet as additional information screen:
SmartGlass application can display details about what is going on on XBox while you are watching movie/playing music or playing game:

XBox SmartGlass on Windows 8 RT.
Picture shows game info/stats while my son is playing it.

First of all, I experienced latency between my actions on device and response from XBox screen.
When I used "Remote Control/Controller" feature and tried to navigate between XBox tabs and select particular item on screen, screen could easily jumped from one tab to another, like from "games" to "Tv and movies".




Another part, which I hated is that you have to swipe left to move right tab on a screen (really confusing).

Internet Explorer on XBox

I also tried Internet Explorer on XBox - awesome!!! But is is not related with Surface/Win 8 RT success at all - it is cool thing/application, which Microsoft enabled on XBox (after all these years!!!!!! MS would have bigger success if they would enable it long time ago, but it is another discussion). The biggest risk is that hackers can start develop new js scripts/worms for the XBox. It is start to develop Antivirus for the XBox :-)

In any way, here is picture of typing urls via SmartGlass on Xbox




Generally, it is great idea to control XBox via mobile devices, but it should be much simpler from end-user perspective and cheaper. I have simple question: "Why should I connect to XBox via additional  (not cheap) device to use keyboard, which has internet explorer itself????????????"

Here is what I am talking about: XBox has its own keyboard, which you can attach to a game controller. I bought this one for 6.99CAD (6.99CAD vs 800CAD - what do you think about it?):

XBox 360 game controller with attached keyboard: browsing internet

Video/Music

Windows 8 RT doesn't have windows media player, but it still has Metro style apps, which allow to play video and music. I really was happy when found that I don't need to convert my .avi files to new format like in case with other mobile devices :-) It is definitely great advantage for the end-user.



Microsoft already had services to sell Video/Music via XBox and they brought it to mobile device, like Apple did it with iTunes.

I really laughed when I tried to play music sample from XBox store via "Music" application and got this message:



Summary


The fact is that device is heavy and doesn't have 3G/4G makes this device not mobile device but stationary. List of applications is pretty small at this point of time, which makes purchase of this device is very expensive. As I said, you can buy pretty good laptop for the same price, which can host fully functioning OS. I would wait fully functioning operation system "Windows 8 Pro" with device, which has large memory and intel CPU. It will make life easier (mine at least).

P.S.
I used Apple Mac Air to work on this article and used iPhone to make pictures :-) I am going return Surface (if it is possible).