Archive

Posts Tagged ‘wp7’

I’m Back!

September 7th, 2010

After my last post I unplugged…completely unplugged…for three months! I did this for several reasons, but the main one was that I felt the noise to signal ratio I was getting from a number of inputs was way too high. I was overloaded with, what turned out to be, primarily meaningless, unactionable information. I’ve also been moving into a new role at my company, and the demands the role has placed on me requires me to be very efficient with my time. Spending my time sifting through information to separate the wheat from the chaff is a luxury I can no longer afford. To that end, I spent the past three months digesting J.D. Meier’s new book Getting Results the Agile Way and coming up with a strategy for making the best use of my time. There are several practices that I’ve come to rely heavily upon:

  1. Daily results The goal is to identify three, AND ONLY THREE, important outcomes that you want accomplish in a given day. Often times we try to accomplish more than we can in a given day, leaving us with a feeling of failure. The reality is that we’re simply failing to focus. By limiting our daily scope we can actually get more done.
  2. Brain dumps The goal is to factor your thinking from your chatter and reminders. At it’s essence, you simple take anything, and everything that is on your mind and write it down (either to physical or digital format – I prefer OneNote & Evernote). The result is that you relieve yourself of a certain psychic weight that enables you to focus on the important things.

I also hold a daily personal standup meeting. I know it sound a bit silly, but it helps me focus on my priorities for the day. Spending just 10-15 minutes to plan each day has helped me get a better handle on the day’s tasks.

During this three month period I also had the goal of getting a grip on my email. Like many of you I have a number of email accounts. Between my corporate, client, and personal email addresses, I have over 10 accounts to maintain. That can be a lot of information coming from a lot of different directions at the same time. Unfortunately, due to various, client firewall policies, consolidating these accounts into a unified inbox with something like Exchange Web Services {LINK} isn’t an option. I figured the best approach would be to process messages the same way for each account. I also set a standard of having zero emails in my inbox at the end of each day. To accomplish this, I once again turned to J.D. Meier. In case you don’t know who J.D. is, he is a legend within Microsoft for getting things done. The guy is a machine. He multi-tasks better than anyone I’ve seen. Several years ago J.D. wrote a blog entry on the Zen of a Zero Mail. I took his general approach, made some customizations based on personal work style, and applied to each my email accounts. I’m happy to say that as of today I’ve been experiencing the Zen of a Zero mail for a solid two months.

With all of that said, just because I’ve been silent here and other places, doesn’t mean I haven’t been busy. I’ve been spending a fair portion of my time getting immersed in Windows Phone 7 development. I have a couple apps that are near completion, and a couple of more that are in the early phases of development. I’ve also been working with J.D. Meier and the Patterns and Practices team at Microsoft on the following projects:

  1. Microsoft Developer Guidance Maps. The Microsoft Developer Guidance Maps Project is an effort to create a model and a map of resources for developer guidance. The goal is to simplify as well as better organize and share our catalog of developer guidance resources. We’re using this catalog as a way to model, prototype, and test ways to find, organize, and share developer guidance in a meaningful way. As part of the exercise we’ll be creating and sharing our maps of pointers to useful code samples, how to’s, videos, etc. for the Microsoft application platform.
  2. Windows Azure Security Notes. This is a collection of our notes and learnings from exploring the cloud security space and working through Windows Azure security scenarios.

There are also a couple of projects I can’t talk about just yet, but they bring together Microsoft’s cloud and mobile platforms in some very interesting ways. As these projects progress and clients are willing to share a bit more you’ll be the first to know.

I’ve also been busy prepping content for the following presentations I’ll be giving this fall/winter:

  1. Heartland Developers Conference
    • Silverlight Bootcamp
  2. Minnesota Developers Conference
    • Introduction to Windows Phone 7 Development
    • Tablets: The iPad and the Future of Mobile Computing
  3. Twin Cities Code Camp 9
    • Multi-targeting WPF, Silverlight, and Windows Phone 7
    • Getting Down with MEF – Silverlight Edition
  4. Twin Cities .NET Developer User Group
    • Getting Down with MEF
  5. Twin Cities Developers Guild
    • Getting Down with MEF – Silverlight Edition
  6. Twin Cities Cloud Computing User Group
    • Windows Azure Security Guidance

(I hope to see you at a least one of these great events).

I’m also working on a screencast series that I’m tentatively calling "Silverlight Sprints". It’s an adaption of my Silverlight Bootcamp class. The goals is to have a series of episodes (no longer than 10 minutes each) that will get you up an running with Silverlight development (both for the desktop and Windows Phone 7). The content and code for the series is complete I just need to sit down and record it.

Finally, I’ve also been asked to co-host this year’s season of the Spaghetti Code podcast with Jeff Brand. The format is going to be different than in seasons past. Each month we’re going to talk about what’s new in the Microsoft development space. Our first episode is up and you can listen to it here. Let me know what you think!

That’s it for now, but they’ll be a lot more coming soon. Stay tuned!

adam Uncategorized , , , , ,

TCSLUG Slide Deck and Code

April 21st, 2010

I’ve uploaded the code and slide deck from my presentation at the Twin Cities Silverlight User Group. You can download the content here.

A couple of quick notes:

  1. The code includes the source for the TekPub media player I demo’d during the presentation.
  2. To build and run the code you need the following installed on your machine:
    1. Microsoft Visual Studio 2010 RC
    2. Windows Phone Developers Tools CTP

Enjoy!

adam wp7 , ,

Introducing Silverlight 3.7!

March 16th, 2010

(Note: I typically don’t tweet my blog posts, but I did so with this one as I want to make sure those following the developments at MIX10 around Windows Phone 7 and Silverlight are aware of some key differences between the platforms.)

Tuesday at MIX10 there was a big release that went completely unannounced Silverlight 3.7 is now in CTP! That’s right 3.7! I can’t believe it! It’s amazing! It’s, uh, um, hey, wait a minute, isn’t the release candidate for Silverlight 4 in the wild?

No, I’m not losing it (well maybe I am, but that’s neither here nor there). In my last post I discussed one of the key shortcomings, in my opinion, of the WP7 platform, the lack of browser support for Silverlight. I pointed this out because my fear is that a lot of people are going to assume that WP7 supports browser hosted Silverlight since native apps can be written for with Silverlight. As a result, people may not be willing to adopt the WP7 platform quickly since they can’t leverage existing Silverlight assets. The goal of this post is to try and show a couple of different ways you can reuse code across both the “browser hosted” and “phone hosted” silverlight platforms.

First we’ll set up a solution with two projects, a Windows Phone application, and a Browser Hosted (Silverlight 4) application:

cxag_ss001_hosts

Next we’ll want to add a project that will contain code we want to reuse across the the two applications. In this case we’ll choose a Silverlight class library project that targets the Silverlight 4 runtime:

cxag_ss002_sl4

Next we’ll want to our two applications projects to reference the class library. Adding a reference to the Browser Hosted application works without problem. However, when we try to add the reference to our Windows Phone project we get the following error:

cxag_ss003_sl4_error

Let’s try the reverse. Let’s first add a Windows Phone class library project:

cxag_ss004_wp7

Now let’s add the project references. Adding the references to the Windows Phone application works as expected, but now the Browser Hosted applications gives us ethe following error:

cxag_ss005_wp7_error

So, what the heck is going on here? To find out we’re going to need to take a peek at the assemblies referenced by our Browser Hosted and Windows Phone application. The assemblies for the Browser Hosted application can be found in the following directory: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0. Let’s choose one assembly to look at. In this case we’ll use the System.Windows.dll. Here are the details of the assembly:

cxag_ss006_systemwindowsdll_sl4

The assemblies for our Windows Phone application can be found in the following directory: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone. If we take a look at the System.Windows.dll assembly in this directory we’ll see the following:

cxag_ss007_systemwindowsdll_wp7

See the difference? Windows Phone uses, what is, essentially, Silverlight 3.7, which is why we can’t add a reference to a Silverlight 4 class library. If you take a look at some of other assemblies in this directory, such as System.Core.dll, you’ll see something like this:

cxag_ss008_systemcoredll_wp7

These core assemblies are actually compiled for the .NET Compact Framework 3.7.10056.0. This is why we’re unable to add a reference to a Windows Phone assembly to our Browser Hosted project.

So, how can we share Silverlight code between our Windows Phone and Browser hosted applications? There are two approaches that initially come to my mind. (I have a third idea involving T4, but that needs to get flushed out yet). The first thing we could do is create a Silverlight 3 class library project:

cxag_ss009_sl3

All we need to do now is add the reference to our two application projects, which will work. However, I don’t like this approach as it’s least common denominator (LCD) programming. We’re actually holding the code in both applications back from full potential by using a lower version of Silverlight.

Another approach is to use linked files. In this case we’ll delete the Person.cs file from our CxAg.Shared.Phone project. We will then add the Person.cs file from the CxAg.Shared.Silverlight4 project to our CxAg.Shared.Phone project as a linked file. The result will look like this:

cxag_ss010_linkedfile

See that little arrow by the Person.cs file? It indicates that it isn’t actually a file, but, rather, a pointer to a file located somewhere else. In our case, it’s just a point to the Person.cs file in the CxAg.Shared.Silverlight4 project.

One thing you’ll want to keep in mind is how to handle code that compiles for one platform, but not for the other. An approach I’ve taken in similar scenarios looks something like this:

cxag_ss011_partialclass

I like to declare my shared classes as partials. These allows me to include platform specific code in each project (as separate, non-linked files) without breaking the build. In my opinion neither of these solutions are ideal, but they’re workable. As I mentioned earlier, I’m working on a third, T4 based solution, but that’s still in progress. Keep in mind too that we’re working with what is, for all respective, purposes a new development platform, so there are kinks to be worked out. I hope this gets you on your way to successful Silverlight 4/Winodws Pohne 7 development!

adam mix10, silverlight, wp7 , ,

Windows Phone 7 and Silverlight Support, A Word of Caution

March 16th, 2010

So, I was at Scott Guthrie’s keynote address at MIX10 yesterday and I walked away scratching my head. On the one hand all the announcements around Windows Phone 7 and its development platform we’re great. I was really glad to see that the tooling falls in line with Microsoft’s history of providing great, integrated tools for developers. I was also happy to see Microsoft breaking away from it’s usual routine and really, I mean, really focus on the user experience. Did they get the UX right? I don’t know. There are bits and pieces I find interesting and other pieces I simply wonder “What were they thinking”, but that’s an entirely different post. The lack of of true “Enterprisey” features other than support for Exchange and Office, also concerns me, but I’m sure those will come in time and with demand. Of course, there’s also the fact that apps don’t really run in the background. However, all of these things aren’t why I was scratching my head yesterday. I was wondering about the elephant in the room. I was wondering why nobody asked the obvisous question. If Windows Phone 7 uses Silverlight as a platform for building native app, will existing “Silverlight-enabled” websites work in the phone’s browser? It seems like such a simple question, one with an obvious answer. But the fact that none of yesterday’s presenters explicitly called it out had me concerned. After all I have some Silverlight apps running around on the interwebs and it would sure be nice if they just worked on Windows Phone 7. People have ripped on that fruit company in Cupertino for a long time for not supporting plug-ins (i.e. Flash or Silverlight) within their mobile broswer, so you think Microsoft would be ready to 1-up them by supporting their own technology (i.e. Silverlight) in the mobile browser of their shiny new device.

Since I didn’t get an answer, I thought I would download the developer bits and give a Silverlight enabled website a go in the WP7 emulator. What better site to use than Silverlight.net. Here’s how the site looks in the desktop version of IE8

slnet_ie8

Notice the area surrounded by red? This is a Silverlight component. Keep this in mind as you now look at the site in the emulator for WP7:

slnet_wp7

See that area in red? That’s where the Silverlight component should be! When I saw this I stepped away from desk thinking that this simply couldn’t be. So I created a Silverlight 4 RC app on my machine and tried to browse to it via the emulator. Same result. Still refusing to believe this, and thinking maybe it was just an emulator issue, I hunted down a Microsoft DPE last night to get confirmation. Unfortunately he confirmed my fears. Windows Phone 7 does not support Silverlight within the browser. Let me say that again so you can hear it:

WINDOWS PHONE 7 DOES NOT SUPPORT SILVERLIGHT IN THE BROWSER

I was very confused, and, quite honestly, viscerally angry about this. It seemed like such a no brainer, and I think it’s an initial assumption a lot, A LOT, of people are going to make. After all, there are a ton of Silverlight apps already deployed on the interwebs, and a number of people are going to assume that they’ll just work in the browser on WP7. After all, wouldn’t be in Microsoft’s best interest to say “You know all those existing Silverlight apps you have, they’ll work too!” I’m also suprised at the lack of support of Silverlight in the WP7 browser for another reason. One of the other things we’ve heard at MIX10 is that there’s not an intial way to distribute your apps outside of the app store/marketplace/whatever. This has raised the ire of a number of corporate developers. Allowing the WP7 browser to support Silverlight would seem to solve this problem. However, it would allow people to bypass the app store for deploying their apps, thus reducing a revenue stream for Microsoft. I’m not saying or event suggesting this is the reason WP7 does not support Silverlight in the browser. I’m sure there are techincal reasons, such as the IE browser on WP7 not supporting plug-ins.

With all of this said, you can reuse code across browser hosted and phone hosted applications. I’ll have an upcoming post on that shortly.

All in all, I think the WP7 platform has a lot of promise and potential, and I’m looking forward to working with it. I hope you are too!

adam mix10, silverlight, wp7 , ,