codefoster | to inform and to inspire
Jeremy Foster
@codefoster

App Ideas

by Jeremy Foster 6. June 2012 16:08

Have a Windows 8 app idea but not enough time to write it? Add it in the comments below and I’ll consolidate a list in my resources page.

Tags:

Windows 8

The Ocho

by Jeremy Foster 6. June 2012 12:23

There’s nothing better for learning a new platform, framework, or language than getting together with other people. Shared experience brings not only technical know-how, but also know-how-not-to! I always say that our careers are made of three things: education, inspiration, and experience. You need all three. Education can be rote. You get it from books, videos, classes, etc. Inspiration is the energy and motivation for doing what you’re doing. If you’re not working on a project that is exciting and has the potential to change the world, you might just be a bit bored. Experience then is what you get when you try to do it over and over. You succeed, you fail, but each time you learn how to and how not to do things.

Meeting together with other people is magic because it’s an opportunity to get some of all three of these. You get some training. You get inspired by the content and what others are doing with it. And you get to try things and get experience and you also get to benefit from the experience of others.

So that’s why I started The Ocho. The Ocho is a user group for Windows 8 developers. Whether you’re beginner or advanced, go to http://www.meetup.com/theocho and sign up to visit a local meeting. You’ll learn a lot and you’ll have some fun too. Tell your friends about it, so we can build it up even more.

See you at The Ocho!

Tags:

Developer Community | Windows 8

Microsoft vs. Apple: Differences in Tablet Philosophy

by Jeremy Foster 5. June 2012 12:24

Microsoft and Apple have a long and tangled past. From most perspectives, the two would certainly be considered competitors, but when fitted with the right glasses (rose) one can also choose to see the two technology giants collaborating to add enjoyment, value, education, and information to the lives of billions. I used to teach high school and there were occasions when both companies made significant donations to classrooms to bring better education to my students.

But right now I want to talk about a fundamental difference in how each company appears to approach the tablet market.

There’s nothing special about a tablet. It’s just a form factor. Phones are this big… tablets are a bit bigger… desktop monitors a bit bigger still. They’re just screens. Sometimes they’re sideways and sometimes they’re upright. Sometimes they’re stationary and sometimes they’re on the move. Imagine for a minute where our children and their peers will find screens - in the kitchen, in the car, on the bus, on the train, and hopefully rolled up in their book bag. Remember… it’s just a screen.

Apple threw some words toward Microsoft recently saying that tablets and desktops are fundamentally different and that attempting to put the same OS on both devices would end up degrading the user’s experience. I suppose Apple is saying this precisely because they have a different OS their tablet than their desktop.

I see the Windows 8 strategy as relieving. It can be nothing but easier for devices to collaborate when they are running the same bits. I have Windows 8 on my TV, on my work PC, and on my tablet. We’re still in beta and already the experience is nothing short of delightful.

I look forward to the many more device form factors that are inevitably to come!

Tags: , , , , ,

Windows 8

All Windows 8 Quickstarts

by Jeremy Foster 5. June 2012 12:04

If you’re looking for training material for Windows 8, you’ll find quite a lot online. It can be overwhelming finding stuff online though. I consider it part of my job to help you locate things, so here’s a tip. Just do a search in the Windows 8 Dev Center (http://dev.windows.com) for the word “quickstart” and you’ll find a lot of walk-through articles that are really helpful in figuring out how things work. Here’s a link to that search directly: http://social.msdn.microsoft.com/search/en-US/windows/apps?query=quickstart&Refinement=180

Tags:

Windows 8

Windows 8 Keyboard Shortcuts

by Jeremy Foster 5. June 2012 11:57

Win + Spacebar : Switch the input language and keyboard layout

Win + C : Open the Charms

Win + D : Show the desktop

Win + E : open Windows Explorer

Win + F : Open the Search panel

Win + H : Open the Share charm

Win + I : Open the Settings charm

Win + K : Open the Connect charm

Win + L : Lock the computer

Win + O : Lock the screen rotation

Win + Q : Open the search pane

Win + R : Open run

Win + W : Opens the Settings search panel

Win + Z : open the app bar

Win + V / Win + Shift + V : Cycle through toasts

Win + Enter : Launch the narrator

Win + PgUp / PgDn: Cycle Metro interface to alternate monitors

Win + . / Win + Shift + . : Split left / right

Tags: , , , ,

Productivity | Windows 8

Giveaway: Visual Studio Windows Decals

by Jeremy Foster 4. June 2012 17:37

I’m giving away one large (8.5” x 11”) Visual Studio 2012 logo window decal and one small “I heart VS2012” decal. I’m sure these will be all over the place soon, but you can be the first around if you’re the lucky winner.

WP_000292

To enter just follow me (@codefoster) on Twitter and retweet this tweet. I’ll randomly select a winner on June 7.

Tags: , , , , , , ,

Giveaways | Visual Studio | Windows 8

Metro Fridays

by Jeremy Foster 1. June 2012 22:44

Developers anywhere near Seattle, I’m talking to you.

If you’re developing Windows 8 applications, we want to support you. We’re going to be at Microsoft’s Civica location (easy to find, free parking, free coffee, etc.) every Friday in June and July (except July 6). Join us in person or via Lync to get live help coding your app or talking about getting your app into the store.

I’ll add details and logistics to this blog post as they unfold, so check back.

Here is the latest on the dates and times of the Metro Friday meetings. Some are daytime and others are in the evening to best accommodate everyone. If you are not in the area, feel free to use the Lync below to connect online.

June 8  9:00am - 1:00pm  Civica
June 15  6:00pm - 9:00pm  TBD
June 22  6:00pm - 9:00pm  TBD
June 29  9:00am - 5:00pm  Civica
July 13  9:00am - 5:00pm   Civica
July 20   9:00am - 5:00pm  Civica
July 27   9:00am - 5:00pm  Civica

Please go to http://www.meetup.com/theocho to RSVP.

Lync: https://join.microsoft.com/meet/micjohn/R74CS4S6

Where: Microsoft’s Civica building location at 205 108th Avenue NE, Bellevue, WA 98004; there will also be a Lync session

Who: anyone that wants to work together on Windows 8 apps; please help me spread the word

Tags:

Developer Community | Windows 8

Art Matters

by Jeremy Foster 31. May 2012 11:00

I'm in a Microsoft building today that I've not been in before. There are a lot of them since I'm a relatively new employee. This one houses a lot of the work that goes into the Windows Phone 7 operating system, and that's pretty cool.

I arrived early for my conference and decided to spend some time meandering. A 3rd floor native told me I should visit the Windows Phone design studio on the 2nd. The design studio looks like a bunch of art supplies, flowers, and rainbows blew up. It's very cool actually.

I'm a propeller head for sure, so it's important to me that a system functions correctly, but I want never to forget that art matters. It matters because it's human like your users. When I picked out my SCUBA gear, for instance, its ability to sustain my existence while I'm under water was certainly high on my priority list, but it was also an assumption for the most part. SCUBA gear wouldn't likely make it to the consumer shelf if it wasn't well tested. So I essentially set that aside and look for gear that I enjoy looking at - gear that makes me feel like  Navy Seal Ninja.

Know that your users are making the same assumptions that your application is going to function as it's intended, and they are going to choose it, keep it, and pay for it based on its art. Is it beautiful? Is it smooth like butter? Is it inspirational.

Tags: , , , , , , , ,

Windows 8 | Design

The Counter Principles of Metro Style Design

by Jeremy Foster 30. May 2012 10:36

Likely you’ve read the Metro style design principles, but you haven’t seen the counter principles yet (because I made them up). Here we go...

1. Show Shame in Mediocrity

To really show shame in mediocrity, just look at about 80% of the apps in any major app marketplace. These apps may get a users attention with a catchy title or a promise to solve some problem, but then they fail to add any value to anyone’s life. Even if they are not devoid of functional value they fail to provide any user joy.

  • Ignore the little things
  • Do something different in every little user interaction so you can keep them on their toes
  • Embrace chaos
  • Deviate slightly from the grid so the user knows something is wrong even though that can’t see it

2. Flow Like Peanut Butter

To be clear, peanut butter doesn’t flow. Even creamy peanut butter doesn’t flow. To meet this counter principle, perform actions synchronously, use while loops that peg the processor, and only use the UI thread.

  • Add some offset between the user’s finger and the registered touch point
  • No transitions or animations... all straight cuts
  • Add boring graphics and boring interactions.
  • Embrace lag and jitters

3. Be Faux Analog

It’s 2012, but give the user a solid 1994 experience by rendering an actual real-life scene and hope they’ll figure out which drawer their word processor is in. Even though there’s no actual need for a spiral binding, let’s add one. It’s nostalgic.

  • Show a desk or a lobby or some other loose analogy to your navigation model
  • Firmly draw your limits at real life paradigms and scenarios
  • Expand on the success of Microsoft Bob©

4. Do Less With More

Pack that screen. You have millions of pixels at your disposal. You can use some for navigation, some for commanding, and if there's room left over you can even include your user’s content.

  • Assure that users can orient themselves to your views within 7.5 minutes
  • Adhere to a strict 45 button limit per view
  • Give users a sense of adventure as they discover your application

5. Die Alone

  • Assume the user is only concerned with doing whatever it is that your app does.
  • Assume they don’t have friends to share your content with.
  • Assume they don’t need to find anything of your content
  • Assume the user what’s to do one thing at a time... always... ever... only

Tags: , , , , , , , , , , ,

Windows 8

I give you my word...

by Jeremy Foster 29. May 2012 12:38

I’m excited about what I just implemented. I’m always excited when I figure something out or learn something big. This one is big for me. Hopefully this post will add some value to your life as well.

First the problem statement...

Here’s what I wanted to do. I am working on a Windows 8 Metro app using HTML/JavaScript.

I have a data.js file that represents (for now, until I put the data in the cloud) my data service. I am loading data up from a roaming file that contains simple JSON data. Actually, is “simply JSON” redundant. JSON just IS simple, right?

My hub page then needs to make sure that the application data is loaded and then it needs to request some. I can’t just directly request the data as is though because it needs to be massaged into the right shape to back the hub view. My application has items of Type A and Type B and I need to essentially flatten that into a super type that my hub will represent in different groups.

So I need to fetch some data and it needs to happen in an async fashion.

I’ve consumed objects that follow the Promise pattern plenty, but here I need to create my own Promise and get all custom about when it is considered complete and what it returns as its payload.

So I have two methods that I need to make asynchronous: loadAppDataAsync() and getHubItemsAsync(). The former is internal to my data.js function, but the latter is “exposed” to the rest of the app using a WinJS.Namespace called “data”.

loadAppDataAsync

This method, as I said, is “internal” to my data.js file. That is, it’s defined inside the modular function that encapsulates everything on my data.js file and thus is not available anywhere else in the application. The purpose of the function is to read the applicationData.json file and populate some arrays with the results. Here’s the method definition...

function loadAppDataAsync() {
    return new WinJS.Promise(function (c, e, p) {
        if (loaded) c();
        else {
            appdata.roamingFolder.getFileAsync("applicationData.json")
                .then(function (file) {
                    Windows.Storage.FileIO.readTextAsync(file)
                        .then(function (content) {
                            //load the checklists
                            JSON.parse(content).checklists.forEach(function (i) {
                                checklists.push({
                                    title: i.title,
                                    template: i.template,
                                    description: i.description,
                                    backgroundImage: i.backgroundImage,
                                    items: i.items,
                                    type: "checklist"
                                });
                            });

                            //load the templates
                            JSON.parse(content).templates.forEach(function (i) {
                                templates.push({
                                    title: i.title,
                                    description: i.description,
                                    backgroundImage: i.backgroundImage,
                                    items: i.items,
                                    type: "template"
                                });
                            });
                        })
                        .then(function () { c();});
                });
        }
    });
}

I added the Async suffix to the method name because this method not only calls an async method, but also acts asynchronously itself. Here’s how that’s implemented.

If I just wanted to wrap up the getFileAsync method call, then I could simple return the result of that call, but I need to add a little bit of my own logic. I only want to make the getFileAsync call in the condition that my data has not already been loaded. So I return a new WinJS.Promise specifying its function (which receives complete, error, and progress attributes that I’ve called c, e, and p). In the function, if the data has already been loaded I call the complete method c (passing no attributes) immediately indicating that we’re done loading app data (because it’s already loaded). If the data has not been loaded, however, we have some work to do and we will not complete (by calling c) until we’re done with it (that’s why it’s in the .then).

This one is pretty simple. Let’s move on to the next method that we use to get the hub items after the application data has already been loaded. Here’s the code...

WinJS.Namespace.define("data", {
    getChecklists: function () { },
    getHubItemsAsync: function () {
        var hubItems = [];
        return new WinJS.Promise(function(c, e, p) {
            loadAppDataAsync()
                .then(function () {
                    checklists.forEach(function(cl) {
                         hubItems.push({
                             item: cl,
                             title: cl.title,
                             backgroundImage: cl.backgroundImage,
                             section: "My Checklists",
                             click: function (ev) {
                                  WinJS.Navigation.navigate("/html/checklistPage.html", { item: cl });
                             },
                             get subtitle() {
                                 return (cl.items.filter(function (i) { return i.checked; }).length / cl.items.length)
                                     + "% of " + cl.items.length + " items";
                             }
                         });
                    });
                    templates.forEach(function(t) {
                         hubItems.push({
                            item: t,
                            title: t.title,
                            backgroundImage: t.backgroundImage,
                            section: "My Templates",
                            click: function (ev) {
                                WinJS.Navigation.navigate("/html/template.html", { item: t });
                            },
                            get subtitle() { return t.items.length + " items"; }
                         });
                    });
                })
                .then(function () { c(hubItems); });
        });
    }
});

This one is defined in a Namespace so that we can call it from elsewhere in our app - namely from hub.js. What this method does is a little different from the former. Like before, we are returning a new Promise. Unlike before, after we populate our result (hubItems), we complete the promise with a result by calling c(hubItems).

Passing a value to the complete function makes that value available to the caller like this...

data.getHubItemsAsync().then(function(hubItems) {
    hubItems.forEach(function(i) { hubItemList.push(i); });
});

Simple, eh? That’s the way it’s supposed to be. I want to get then items and then I want to push each of the results into my WinJS.Binding.List (here called hubItemList).

Now the grid on my hub is bound to a List that gets populated with data after the application data has been loaded and after the getHubItemsAsync method has projected the application data to look how we want it to look.

Phew! This JavaScript stuff is pretty crazy. It’s pretty awesome though.

Happy promise keeping!

Tags:

Windows 8 | JavaScript

Feed Subscribe