Wednesday, April 24, 2013

Creating a Windows 8 Store App - Part 2


Before you can start building the application we need to design how the application will look like, and work. So lets create a GUI Prototype using the use cases in Part 1.

There are several tools for creating GUI prototypes, Microsoft SketchFlow are only available with Visual Studio Premium, because of that I will go with Pencil Project instead, it's a free open source project that works in a similar way.

Download and install Pencil Project.


Create a new Dokument.


Change page properties.


Change page size.

 OK, when to apply new size.

Use the Sketch Stencils, to get a sketchy look on the components.

We can now add a box, label and so on to create a layout of the application:

To add a New Page click on Add Page to handle New Routes click "New Page":


Add a descriptive name to the new Page:
 

 It's possible to add links between the pages by right clicking items and choose link to, so we add a link to the main page to return from the New Routes page:
  


When the prototype is completed it's possible to export the document into different formats, so the people that is going to review the prototype dosen't need Pencil project installed: 


I choose web page because everyone has a web browser:


Export all pages:


Choose the output directory, I created a MyRoutesHTMLExport directory:


The result is a html page and resources:


The page show our prototype, and is clickable to jump between pages:


I will try detail the pages more in the next blog post.


Sunday, April 14, 2013

Creating a Windows Store App - Part 1

I haven't done much blogging lately  but I will try to start again. I will make a few blog posts on how to create a Windows Store Application. The parts will be published when they are written so I can't promise how often it will be, because it depends on workload etc. But here we go:

Where do we begin? You need an application idea!

Let's say you are into riding bicycles, what kind of application do all cyclists need?
Well all cyclist needs to make sure that their friends and family knows where they going to ride their bike, so if the cyclist go missing because of an accident they know where to start looking. The application needs to help the bicyclist to do at least:
  • Add a route
  • Changing a route
  • Share a route
To outline the users needs, lets create a fictive user called John Bikealot. John 44 years old living with his wife and two kids. John is a everyday cyclist, commuting to work and does some extra cycling for exercise a few days a week.

How would Mr Bikealot want the "Add a route" feature to work?

He want to minimize the time spent adding routes, he like to ride his bike. So adding a route needs to be as simple as just naming the streets or clicking on a map. Because he will be riding his bike in the same area most of the time he doesn't what to add the same route more than once.

When and Why would Mr Bikealot want to change the route?

Having done training during the summer he starts feeling fresh in the legs late on the route, so extending the route with a detour on some new roads might be necessary to get the same time on the bike as he had early on the season. But he want to do this in a quick way not spending any unnecessary time in front of a computer.

How does Mr Bikealot want to share the routes with his family and friends?

The easiest way possible. Email or status by doing an update on Facebook perhaps.

Saturday, February 09, 2013

Solution when Windows 8 cannot shutdown

I got a problem on my laptop that I migrated to Windows 8. It could not shutdown. When choosing shutdown the computer ended up running the only way to shutdown was to press the hardware switch for a long time several timed forcing the computer to stop.

I've googled the problem and the solution is:

Right-click the lower left corner to get the power menu, click Power options:

Choose, "Choose what the power button do" in the left column:














Click "Change settings that are currently unavailable":



Uncheck "Turn on fast start-up":




And after this change the computer is possible to shutdown.
 

Saturday, September 29, 2012

A small update of the UX in my blog.

Have been watching Billy Hollis Pluralsight course:
Creating User Experiences: Fundamental Design Principles

A lot of the information in this course is great for developers.
Solid information on what to take into consideration when building Software GUIs.

Made a small face lift on my blog, change the color scheme to get a better UX.
I added a gradient fill and green color on my blog to get some feeling of naturalness and biophilia

Monday, September 24, 2012

How to make a Per-User installation with NSIS

I've been doing some researching on how to make it possible for users to install applications without administrator credentials.

There is a lot of good samples on how to make an UAC compatible installer with NSIS. But almost all the samples are made for forcing the user to run the setup as administrator, for example in the NSIS documentation.

After a lot of googling I finally found this question on the forum and the answer was exactly what I was searching for.

Key part of the script is were the $instdir is constructed:


!define FOLDERID_UserProgramFiles {5CD7AEE2-2219-4A67-B85D-6C9CE15660CB}
!define KF_FLAG_CREATE 0x00008000
 
!include LogicLib.nsh
!include WinVer.nsh
!include MUI2.nsh
 
Var SMDir ;Start menu folder
 
Function .onInit
;Default $Instdir (UserProgramFiles is %LOCALAPPDATA%\Programs by default, so we use that as our default)
StrCpy $0 "$LocalAppData\Programs"
 
;Make sure we don't overwrite $Instdir if specified on the command line or from InstallDirRegKey
${If} $Instdir == ""
        ${If} ${IsNT}
                ;Win7 has a per-user programfiles known folder and this could be a non-default location?
                System::Call 'Shell32::SHGetKnownFolderPath(g "${FOLDERID_UserProgramFiles}",i ${KF_FLAG_CREATE},i0,*i.r2)i.r1'
                ${If} $1 == 0
                        System::Call '*$2(&w${NSIS_MAX_STRLEN} .r1)'
                        StrCpy $0 $1
                        System::Call 'Ole32::CoTaskMemFree(ir2)'
                ${EndIf}
        ${Else}
                ;Everyone is admin on Win9x, so falling back to $ProgramFiles is ok
                ${IfThen} $LocalAppData == "" ${|} StrCpy $0 $ProgramFiles ${|}
        ${EndIf}
        StrCpy $Instdir "$0\${APPNAME}"
${EndIf}
FunctionEnd

Saturday, September 08, 2012

How to: make sure windows doesn't go to sleep/hibernate

I'm currently working on support tools for an embedded system. When loading new software or loggning information from the system it takes a long time. Got feedback from the users that the tools act strange when their computers went to sleep and the they activate  the computer again. No errors indicated in the tools but it the log files look strange.

The problem can be solved in two ways:

  1. Turn off the sleep/hibernate in windows.
    1. Control panel
    2. System
    3. Power options
    4. Plan
    5. Put computer to sleep never.

      This is an easy fix but it is impossible to ensure that the users do this, and when they run into this problem it's already to late.
  2. Make sure the application tells windows it is going to run a long process, and that the user needs to wait for it to complete.

    See Stack Overflow question. http://stackoverflow.com/questions/629240/prevent-windows-from-going-into-sleep-when-my-program-is-running

    On XP See: WM_POWERBROADCAST

    On Vista and Windows 7 See: SetThreadExecutionState

    This is the path I think is correct by telling the operating system what the application is doing it supports the application and user does not have to do anything to get the correct behavior when logging or uploading software to the system.