From //learn/ to Jumpstart for Windows Phone 8.1

From //learn/ to Jumpstart for Windows Phone 8.1

For those that couldn’t attend today’s //learn/ event the full jumpstart material is going to be presented online next week by Andy and Mattias. Register now at http://www.microsoftvirtualacademy.com/liveevents/building-apps-for-windows-phone-8-1-jump-start

XAML and Databinding Debugging for Windows and Windows Phone

XAML and Databinding Debugging for Windows and Windows Phone

A question that came up today during the //learn/ event was how to debug data binding in Windows and Windows Phone projects.Normally I start by checking out the Output window – in most cases any issue with data binding is usually a naming issue, which will result in a bindingexpression path error in the Output window as follows:

Error: BindingExpression path error: ‘test’ property not found on ‘App4.MainViewModel, App4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. BindingExpression: Path=’test’ DataItem=’App4.MainViewModel, App4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’; target element is ‘Windows.UI.Xaml.Controls.TextBlock’ (Name=’null’); target property is ‘Text’ (type ‘String’)

I was reminded that Xmlspy is a great tool for diagnosing XAML issues, as well as data binding expressions. I downloaded the latest version and was surprised to see that there is full support for all types of Windows Phone 8.1 applications. The only issue I saw was getting it to attach to Windows Phone applications but this was due to my firewall getting in the way. Here’s how you can check and fix this issue:

  • Open the XAML Spy Explorer window (View menu–> Other Windows –> XAML Spy Explorer)
  • Click on the “cog” icon in the window toolbar
  • Find the “Enable remote debugging” option and set it to Yes. You’ll be prompted to permit elevated privileges (I assume to configure firewall).

image 

Now you should be good to debug your application on the emulator/device. The XAML Spy Explorer window will automatically populate with information about your application

image

Note that you can debug much more than just XAML, including sensors, storage and package deployment information.

//LEARN/ Sessions for Tomorrow

//LEARN/ Sessions for Tomorrow

Tomorrow (24th April) we kick off the //LEARN/ event with 9 sessions delivered in English, in the Australian EST time zone. If you haven’t already registered, make sure you follow these instructions to locate the right event information on http://publishwindows.com.

I wanted to quickly share the schedule for tomorrow – you don’t need to attend the whole thing, just drop in for the sessions you want to watch. A reminder these times are for Australian Eastern Standard Time on April 24th (tomorrow from 11am!)

 

Start AEST Duration Session Presenter
11:00 AM 50mins Introduction to Windows Phone 8.1 Michael Samarin
12:00 PM 50mins Getting Started Building Windows XAML Apps William Wegerson
1:00 PM 25mins Page navigation and Data Binding Kelly White
1:30 PM 25mins Page Layout Controls & Transition Animations Nico Vermeir
2:00 PM 25mins Adapting UI for Different Screens Lwin Maung
2:30 PM 25mins Windows Runtime XAML App Lifecycle Andrei Marukovich
3:00 PM 25mins Localization, Globalization in Windows XAML Apps SENTHIL KUMAR
3:30 PM 50mins Tiles, badges and toasts and Action Centre Rob Keiser
4:30 PM 25mins Background Tasks Andrej Radinger

Debugging WebView in a Windows Phone application

Debugging WebView in a Windows Phone application

In a previous post, Debugging Internet Explorer on Windows Phone 8.1, I covered how you could use the new debugging support for IE on Windows Phone to diagnose rendering issues. What I didn’t cover is how you could debug web pages when they’re hosted within an application using the WebView control.

As we’re now building for Windows XAML, we can actually use the same mechanism that’s available for Windows 8 applications (see http://www.jonathanantoine.com/2013/04/05/win8-xaml-app-how-to-debug-the-javascript-in-a-webview/ for instructions). All we need to do is change the Application process option under Debug.

image

Set this to Script and when you debug your XAML application Visual Studio will attach to the WebView allowing you to debug your script and DOM.

//learn/ Windows Phone – How to Register

//learn/ Windows Phone – How to Register

Following a conversation with another developer last week I realised that it’s not particularly obvious how to register for the upcoming //learn/ Windows Phone event. If you haven’t heard about this event it’s an online webcast series hosted by Microsoft and delivered by MVPs in a number of different languages (hopefully one that suits you!). Over 6 hours you’ll learn about a lot of the key new features of Windows Phone 8.1 and how you can build awesome Universal applications for the Windows platform. If this sounds interesting, here’s how you register.

Step 1:    Go to https://publishwindows.com/

Step 2:    Scroll down until you find the section entitled “Find events and consulting times”

image

Step 3:    Select your preferred language (in this case English)

image

Step 4:    Select “Online” from the second dropdown

image

Step 5:     DON’T select Country as this will most likely eliminate all online events

image

Step 6:     Scroll down to see the list of available events and click through on the appropriate Register button for the //learn/ event

image

Note:    If you want to see the full list of languages available for //learn/ reset the Language dropdown, whilst leaving the middle dropdown set to “Online”.

image

Look forward to seeing you all online on the 24th April.

Important: Please make sure you have the correct times in your calendar – The English series starts at 11am Australian EST on the 24th (which is 6pm US PST on the 23rd!!!)

Debugging Internet Explorer on Windows Phone 8.1

Debugging Internet Explorer on Windows Phone 8.1

The desktop version of Internet Explorer now has quite a good selection of developer tools available on any site by just pressing F12

image

Unfortunately on Windows Phone it’s been quite difficult to debug websites and so developers typically had to resort to alert(‘hello’); style debugging. With Update 2 for Visual Studio 2013 there is a new Debug menu item “Debug Windows Phone Internet Explorer”

image

This gives you the option to select the device/emulator and specify a launch site to debug.

image

The debugging experience is pretty cool as it’s actually in Visual Studio and includes the ability to set breakpoints and inspect variables.

image

Do also get the DOM Explorer

image

And the Javascript Console

image

This has got to make our jobs easier!

Upcoming Windows Platform Events for Windows and Windows Phone

Upcoming Windows Platform Events for Windows and Windows Phone

Hot off the heals of //Build/ are a whole slew of local activities to get you updated and building for the new Windows platform (aka Windows and Windows Phone). Here they are:

24th April 2014    //Learn/ 

Whether you are a New Windows App Developer or an Experienced one- we have something for you!

Join us and take a deep dive into the latest features and technologies for Windows Phones, PCs and Tablets.//learn/ from our community in this “to the community, for the community and by the community” event where our MVPs and Expert Developers will help you better understand all that’s new with Windows.

Want to learn how to easily share code between store apps of different form factors? or Want to build your own Universal App? You are at the right place. These sessions will cover all the basic concepts to develop Universal Windows apps –One App for all form factors (PC, Table and Phone), Windows Phone 8.1 apps: the new application lifecycle, the new XAML etc.-with live chat and Q&A with our speakers

No need to dress up or step out you can watch and learn from the comforts of your home/office in this online webcast of informative sessions delivered by our community experts. That’s not all, our local experts will deliver these sessions in not 1 but 8 languages from across the globe(each accommodating the local time zone) to help you learn and leverage the new features and technologies.

So get started and Register Now!

17th May 2014    //Publish/

Locations TBA but Sydney, Melbourne and Brisbane are likely – more announcements to come

Whether you’re looking for expert guidance to help you get started or to cross the finish line at a local event, Microsoft experts are here to help you out every step of the way.

You can even win awards and prizes just for publishing before June 1, 2014.

Windows Phone 8.1 Developer Community Workshop

2nd May 2014 – Melbourne
9th May 2014 – Sydney
16th May 2014 – Brisbane

The Windows Phone 8.1 SDK is now available, and with it brings a wealth of new features and capabilities to take your Windows Phone applications further than before.

We’ve taken the best from //Build, it’ll be a big day, jam packed with topics including:-

  1. The new WP 8.1 runtime
  2. Universal applications and building across WP 8.1 and Windows 8.1
  3. Bluetooth and NFC and the internet of things
  4. People Hub
  5. Notifications
  6. Javascript WinJS comes to phone Geofencing And more…

With trainers from Nokia, Microsoft, Build To Roam, and your local Windows Phone super stars, you don’t want to miss out. Seats are limited, so get in fast.

Speed up Blend for Visual Studio with TFS (Visual Studio Online) using a Firewall Rule

Speed up Blend for Visual Studio with TFS (Visual Studio Online) using a Firewall Rule

So for the longest time I’ve complained about how unusable Blend for Visual Studio is on projects that use TFS, specifically instances of TFS that are on the other side of the internet (yes, I’m looking at you http://visualstudio.com) . The issue is that every time you try to modify a file it goes off to TFS to check something…. I’m not quite sure what, but it hangs for a couple of seconds before deciding that you’re ok to make the change. This is particularly bad when you’re working with sample data.

It turns out there is a stupidly simple fix – don’t let Blend access the internet. Due credit to Dave who works with me at Built to Roam as he was the one that told me to just create a firewall rule.

Now, it’d show you some pictures of how to create the firewall rule using MMC but for some reason MMC crashes for me when I go to view the outbound rules. Anyhow, here’s the command for doing it via the command line:

netsh advfirewall firewall add rule name="Blend" dir=out action=block program="C:Program Files (x86)Microsoft Visual Studio 12.0BlendBlend.exe"

Blend will now complain when you first open a TFS connected project but there after it won’t miss a beat as you work with files as if there is no TFS connectivity.

Built to Roam website gets a facelift with interactive Windows and Windows Phone shells

Built to Roam website gets a facelift with interactive Windows and Windows Phone shells

http://www.builttoroam.com

Yesterday we finally released the new version of the Built to Roam website. As most of you are aware over the last couple of years we have done a lot of work with a number of customers to help them release, or update, their Windows and/or Windows Phone applications. We wanted to showcase these as part of our interactive website, so the phone and tablet you see when the website loads are designed for you to interact with; simply tap on the phone, or swipe across and tap on the tablet, to get started

image

In interactive mode the devices move to the centre of the screen and allow you to tap through to explore information about the apps we’ve enjoyed working on. The experience for each device has been designed to reflect the interaction model of the respective platform eg the back button steps you back to the previous page.

image    image

As with all projects, there was a limit to what we could fit in the first release. As such, we made some compromises when it came to the mobile experience. Whilst the site should function correctly, particularly in portrait, the website doesn’t make good use of the available screen space. Over the coming weeks we’ll be looking to optimise the mobile experience to make it easier to browse the information on the site.

Windows Phone 8.1 Emulator

Windows Phone 8.1 Emulator

In my previous post on Windows Phone 8.1 Developer Power Tools I looked at the developer power tools that are available from within Visual Studio. In this post we’ll look at the new Windows Phone 8.1 emulator and how it is an enabler for building better applications. The first thing to note is that there are a number of different emulator images available:

image

In this brave new world of varying screen sizes Windows Phone 8.1 departs from the fixed addressable width of 480 units. Instead each device has a scale factor which results in an effective resolution – in essence this means that two devices of the same size but differing hardware resolution will display the same amount of content, whereas two devices with the same resolution but differing size, will show more/less content depending on their relative size. What this means is that we now need emulators that not only vary in resolution but also in size.

image

Here you can see both the WVGA 4inch and the 1080p 6inch alongside each other – the beauty of it being in an emulator is that it can then be resized on the screen. The thing to notice is that the 1080p emulator has an additional column of tiles which will be a typical behaviour within applications when dealing with a higher effective resolution.

The next thing to note are the additional tools that are available. Here is a quick set of screenshots – we’ll go into more details on each of these in coming posts:

image image

image image

image image

 image image

Developing for Windows Phone 8.1 using XAML

Developing for Windows Phone 8.1 using XAML

By far the most common way to build Windows Phone applications is to use XAML and C# (or VB). In this case the XAML is a variant on Silverlight, which made it very easy for developers building Silverlight applications to switch across to building Windows Phone applications. 4 years on and the number of Silverlight developers has dropped (well at least the appeal of being a Silverlight developer has), and all the focus now is on becoming a Windows developer.

Unfortunately somewhere along the lines the Windows team decided that having three XAML frameworks (WPF, Silverlight and WP) wasn’t enough and that they needed to come up with another, only marginally different, framework. This we’ll refer to as Windows XAML.

With the announcements around Windows Phone 8.1 we’re entering a new time of convergence between phone and desktop applications where we can reuse not just the code (eg Portable Class Libraries and code file sharing) but also the XAML markup. This doesn’t come for free and relies on migrating our applications, or starting new applications, using Windows XAML instead of Silverlight.

So where does this leave us? What it means is that there are now three ways to develop for Windows Phone 8.1:

1) Windows Phone 8.0 Silverlight

Use this if you want maximum reach from a single application package; you don’t need or want to use any of the new platform features. This type of application will run on all Windows Phone 8.0 and 8.1 devices.

2) Windows Phone 8.1 Silverlight

By running the  “Retarget to Windows Phone 8.1” option after right-clicking on your application in Solution Explorer, your application will be migrated forward and will run against the new runtime. This means you can take advantage of some of the new platform features without having to redevelop your application. Whilst in most cases the retargeting process doesn’t modify the behaviour of your application, you will need to verify your application functionality before publishing the new version.

Once retargeted your application will only run on Windows Phone 8.1 devices, so it is recommended that you take a backup or a branch of your code and keep the 8.0 version alive to support those users who haven’t upgraded.

3) Windows Phone 8.1 Windows XAML

New applications, not wanting to maintain backward support for Windows Phone 8.0, can be created using Windows XAML. Ideally this would be all new applications as it allows for reuse across phone and tablet. The Universal projects concept introduced into Visual studio makes it easy to share code between projects, whilst still having platform specific functionality included in the “head” projects (ie the Windows and Windows Phone projects).

There is one thing that isn’t being highlighted is that each option has some limits on what you can and can’t do. 8.0 SL projects can’t access any of the new platform features. Windows XAML can’t do things like lock screen background provider….. it’s worth reading up on this before you make a decision

Windows Phone 8.1 Developer Power Tools

Windows Phone 8.1 Developer Power Tools

Last week at BUILD, Microsoft announced the availability of Visual Studio 2013 Update 2 RC, which includes the new Windows Phone 8.1 SDK.

I’m sure there will be a lot of blog posts talking about the new Universal project, the additional capabilities introduced in Windows Phone 8.1, Windows Phone XAML applications, the new application lifecycle model etc. I want to take a different approach and talk about some of the additional tools that come with the SDK.

One of the benefits Windows Phone development aligning with Windows app development is that more of the experiences along the development lifecycle will be similar. For example from the Project menu, Windows Phone developers now have the Store sub-menu with the ability to Create App Package.

image

One of the other additions is under the Tools menu, where there is a Windows Phone 8.1 sub-menu. This includes the Developer Power Tools, Developer Unlock and the Application Development tools. Whilst the last two are not new to Windows Phone development, they can now be reached from within Visual Studio.

image

The Developer Power Tools, not to be confused with the Windows Phone Power Tools, is a standalone tool which can be used to inspect what’s going on across either emulator or device. Help is available via MSDN

image

One of the most interesting thing about these tools is that you can start them, disconnect your device, put your application through its paces in real world scenarios, then reconnect and review the data at a later stage. For example, using the Performance Recorder you can check the data you want to record (eg CPU and Power) and hit Start. You can then disconnect the device, or in this case the emulator, open and run your application, and then reconnect and Stop the recording. This will prompt you to save a .etl file which includes all the data recorded.

image

The .etl file can then be opened using Windows Performance Analyzer (just double-click the file in Windows Explorer).

image

Hopefully these tools will help you track down issue in performance and usage of your application