Contact

Windows 8 Stricter markets

29. December 2012 22:33

Background
Some markets in Windows 8 Store has stricter requirements than others.

Normally submitting to these markets will take a bit longer and has more things that you as a developer needs to think about compliance wise.

 

Windows Phone has an awesome choice “Distribute to all markets except those with stricter content rules” but that choice is not available in Windows 8 Store.

 

According to Windows phone store (and available for Windows 8) the markets with stricter content rules are:

Bahrain
China
Egypt
Indonesia
Iraq
Jordan
Kazakhstan
Kuwait
Lebanon
Libya
Malaysia
Oman
Pakistan
Qatar
Saudi Arabia
Tunisia
United Arab Emirates

 

My solution
I have created a simple java script that uncheck the markets that have stricter content rules.

1. Right click on the link below and add as favourite.

This link: Remove markets with stricter content rules

2. Go to the Selling Details for your Windows 8 app.

3. Press Select All (Which will select all markets)

4. Click the bookmark you just created

5. Internet Explorer will warn you, just select “run content” you might need to click the bookmark again.


Edit: Updated the script with a nicer looking one thanks to Peter Forss

Tags:

Windows 8

Windows Phone 8 SDK IPv4 Problem

31. October 2012 12:40

I ran into trouble the first time i launched the emulator.

“Xde could'nt find an IPv4 address for the host machine”

In my case the problem was: I had a Cisco VPN network adapter that was disconnected (since I wasn’t connected to a VPN at the time).

Uninstalling Cisco VPN solved the issue for me (and another guy that had the same problem).

 

Hope this helps anyone running into the same problem.

Tags:

WP8

Getting Surface

27. October 2012 07:47

Yesterday we went to the MS Store in Bellevue to (hopefully) pick up a Microsoft Surface, apparently so did the rest of Seattle too.
There where two lines, one to get into the store, and one to get into the line to get into the store.Four hours later we finally got in and *drumroll* got a Surface.
Finally decided to get a 32GB version with type cover but I changed my mind several times while waiting in line.


Here are some pictures =)

 


Awesome hand painting

 


The line to get in to the store (this one is about 2h long) there is a one more line to get into this one that is just as long.



Happy couple


The box


The box inside the box =D


The Surface inside of the box inside of the box.

Tags:

Windows 8 | Surface

How to use ItemClick in a Gridview with MVVM

31. July 2012 04:26

I have a gridview and I wanted to make something happen when I click an item.

My first though was binding my view model to the SelectedItem Property and on the setter make something happen, that’s easy enough.

But I didn’t want the item to get highlighted, so basically what I really wanted was to use the ItemClick property, I needed a way to use ItemClick with MVVM.

Searching the web I found a solution GridView ItemClick Command Attached Property

 

 

To get this to work, create a class GridViewItemClickCommand.cs and just paste the code from Geoff´s site (same as below).

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;


namespace AAWP.Commanding
{
    public class GridViewItemClickCommand
    {
        public static readonly DependencyProperty CommandProperty =
            DependencyProperty.RegisterAttached("Command", typeof(ICommand), 
            typeof(GridViewItemClickCommand), new PropertyMetadata
  (null,CommandPropertyChanged));


        public static void SetCommand(DependencyObject attached, ICommand value)
        {
            attached.SetValue(CommandProperty, value);
        }


        public static ICommand GetCommand(DependencyObject attached)
        {
            return (ICommand)attached.GetValue(CommandProperty);
        }


        private static void CommandPropertyChanged(DependencyObject d, 
                                        DependencyPropertyChangedEventArgs e)
        {
            // Attach click handler
            (d as GridView).ItemClick += gridView_ItemClick;
        }


        private static void gridView_ItemClick(object sender, 
                                               ItemClickEventArgs e)
        {
            // Get GridView
            var gridView = (sender as GridView);


            // Get command
            ICommand command = GetCommand(gridView);


            // Execute command
            command.Execute(e.ClickedItem);
        }
    }
}

 

 

Create a new class that implement the ICommand Interface (Just as you normally would do).

public class MyAwesomeCommand: ICommand
        {

            public bool CanExecute(object parameter)
            {
                return true;
            }

            public event EventHandler CanExecuteChanged;

            public void Execute(object parameter)
            {
                //Make something happen
                
            }
        }

 

In your view model create a property of the type MyAwesomeCommand

        public MyAwesomeCommand MyAwesomeCommandItemClickCommand
        {
            get;
            set;
        }

 

Create an instance of the command (in the view model’s constructor)

MyAwesomeCommandItemClickCommand= new MyAwesomeCommand ();

 

In the view we need to add a namespace

xmlns:cmd="using:AAWP.Commanding"

 

And on the grid we have to set three things (beside ItemsSource of course)

IsItemClickEnabled="True" 
SelectionMode ="None"
cmd:GridViewItemClickCommand.Command="{Binding MyAwesomeCommandItemClickCommand}"

 

 

I’m not a believer in the 100% MVVM pattern in some cases the code gets hard to read and  follow and I think readability is the most important thing. But I do believe it is possible to come close to 100% especially with these kind of really awesome solutions.
Thanks Geoff for sharing.

Tags:

Windows 8 | Metro | MVVM

Getting windows azure accelerator for web roles to work

22. March 2012 23:23

“The Windows Azure Accelerator for Web Roles makes it quick and easy for you to deploy one or more websites across multiple Web Role instances using Web Deploy.”

That’s how the git hub project page describes the project.

Kristofer Liljeblad from Microsoft showed me a demo of this on a conference (Øredev) we both attended.

Really awesome stuff, this project makes it possible to deploy one or multiple sites within one web role.

I intend to use this for a number of small sites, mostly WCF projects for my windows phone apps.

It should be noted that perhaps it is not the best option for really large sites.

 

The project is available on github:
https://github.com/WindowsAzure-Accelerators/wa-accelerator-webroles

 

What I noticed when installing this is that the VSIX files (providing Visual studio templates) no longer where included and the setup file for version 1.1 where missing, and since the project now looks to be completely different, any guides currently available won’t do the trick.

 

Prerequisites

There are a few thing you’ll need to have on your computer to be able to use Azure.
I’m quite new to Azure so I needed to install them.

1. Windows Azure SDK
Download and install from http://www.windowsazure.com/develop/downloads/

and click on the .net link.
This will download and open Web platform installer with Azure already selected.

Click install and let the installer do its magic.

2. SQL Server

To be able to debug your Windows Azure apps you’ll need SQL server (express is enough) on your machine.

It is possible to connect to an SQL server on another machine but it will have to know about your user (i.e connected to the same domain), since I’m not connected to a domain it was less work to install SQL server.

 

Setting up the project

1. Download the source

The latest source should be available from here:
https://github.com/WindowsAzure-Accelerators/wa-accelerator-webroles/zipball/master

2. Extract the zip
and open the AzureMultiTenantApp.sln in Visual Studio

The solution contains three projects

image

 

First open the AzureMultiTenantApp.Web located under AzureMultiTanantApp.Cloud\Roles.

Configuration
Here we can setup the configuration, in my case I only want one instance and a small VM.

image

 

Settings
You probably want to change the AdminUserPassword to something a bit more tricky =)

 

 

storage and Connectionstring

Create a new storage in the Azure management portal.

https://windows.azure.com/default.aspx

Storage accounts –> new storage account

Let us call it “storagename” and select the region where you want your data stored.

 

image

 

Now it is time to construct a connectionstring, a connectionstring to azurestorage looks like this:

DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY
The key can be found in the Azure management portal, select the storage and to the right side you will find it.
 
image
 
You can use either one of them.
 
We need to add this connectionstring in two places
First we need to add a new connectionstring in the file ServiceConfiguration.Cloud.cscfg 
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY" />
 
Secondly add the same connectionstring to the DataConnectionString-setting in the same file.
 
In the ServiceDefinition.csdef file under the Imports tag add:
<Import moduleName="Diagnostics" />

Publish time

Finally time to publish =)

Right click on AzureMultiTenantApp.Cloud and select publish

 

image

 

Select Sign in to download credentials


Sign in with your live ID and follow the instructions

 

Select a subscription end press next

 

image

 

 

Enter a name for your Hosted Service and choose the location.

 

Make sure that the storage name we created before is selected.

Check the Enable remote desktop for all roles and then click on settings, enter name and password and make sure the expiration date is set to something far away.

Also check the Enable Web Deploy for all web roles checkbox.

 

Click next, read the summary and then publish.

 

Publishing will take approximately 15-20 min

 

And we are done, now you can surf to YOURHOSTEDSERVICENAME.cloudapp.net and login to your new portal =)

 

image

Tags:

Our Kinect Controlled living room

19. November 2011 17:44

Recently I created a project for a Swedish Kinect contest at Migbi.se this was my second entry, my first one (and third place winner) was my Robosapien project.

I have always been fascinated by home automation, I bought my first X-10 system ten years ago.

My friends thought I was insane, “-You can just get up an shut the light off".

But that’s not the point, it’s not because I’m lazy it’s all about removing obstacles, what if when I enter a room the lights turns on, when I go to bed everything turns off.

Saves energy, saves time, removes obstacles.

 

Peter Forss made a really cool entry to the contest, his project turns on and off lights depending on where he is in the room.

This inspired me, I wanted to do something with Kinect and home automation.

 

I had previously built a home automation system that can control our home (lights, infrared devices etc) so the only thing I needed to do is hook up the Kinect.
I wanted to be able to control what lights to turn on just by pointing at them.

So here is my attempt to control our living room with a Kinect.

 

Kinected living room

 

How it works

I added all my light in an array with the lights X and Z position relative to the kinect sensor (in meters).

For each light, I calculate the angle from where I am in the room to the light and compare it to the angle between me (my body’s centre) and my hand.

 

Then I check for the light on gesture (hand under shoulder moved to over shoulder) or light off gesture (hand over shoulder moved to below shoulder).

 

These gestures sends a command to my home automation system to executes the correct command.

It uses a Tellstick to control the lights, the beauty of that device is that it can control close to any type of protocol (I use Nexa or in some cases the cheapest possible plug-in lamp module I could find, it also works with X10).

 

In this video I only control lights and screen, but it is possible to control infrared devices like tv or home cinema.

 

Please feel free to send me an email if you have any questions.

Tags:

ZX Spectrum emulator running on Gadgeteer

17. October 2011 00:29

First off I would like to start with saying that the title on this blog post might be just a little exaggerated.

The Gadgeteer is running C# code that emulates the ZX Spectrum and so far it’s true.

Basically the emulator works by running cycles, showing the screen and repeating.

To get the correct timing this should be done 50 times per second, which means that we have 20ms to complete one cycle and show the screen.

The Gadgeteer is far from fast enough to achieve that, right now it takes 10 seconds to complete a cycle.

But this wasn’t the point, I suspected it wouldn’t be fast enough. The point was that is was possible \o/.
Within hours I managed to connect a screen to the Gadgeteer and make the necessary changes in the code to make it run.

For example I had to change List<> to an array, the .NET Micro framework doesn’t support List<>, and I rewrote the screen rendering to make it faster.

 

I find it fantastic that I can use my C# knowledge to create new hardware prototypes among all the other things like: xbox games, Windows Phone applications and games, Windows applications and games, and even write Iphone and Android applications.

There is no end to the possibilities =)

 

GadgetZX

Tags: ,

Testing the Nuance speech kit

17. October 2011 00:10

Nuance recently released a windows phone 7 SDK for their text to speech and dictation services.

I have been looking for some kind of text to speech that can handle Swedish and also being able to control things with voice commands in Swedish.

I noticed that Nuance supported that so I decided to sign up as a developer.

Windows Phone 7 already supports TTS for reading sms and also some voice control for searching and opening applications but only support the major languages (Swedish not included).

I have an application idea for the Swedish market that could use voice control (no I’m not saying what it is Ler med tungan ute ).

The SDK includes some sample code that makes it easy to get started.

What I didn’t find anywhere was instructions on how to get this working for languages other than English, and I couldn’t read the help files for some reason.

 

So here is what you need to do:

For dictation support: Replace all the _oemconfig.defaultLanguage() with a string containing your preferred language (sv_SE for Swedish).

For TTS: Add a voice that supports your language (Alva for Swedish)

That is it, now you can play with the app.

I think it works ok, but not as good as I hoped.

 

NDEV Mobile

http://dragonmobile.nuancemobiledeveloper.com/public/index.php

 

Voices (this page is for another product but seems to be the same as the Mobile SDK

http://www.nuance.com/vocalizer5/languages/

Tags: , ,

gadgeteer: first impressions

17. October 2011 00:00

Got my Gadgeteer compatible FEZ Spider kit a couple of days ago.

For those not familiar with Gadgeteer, it is an open source toolkit for building small electronic devices using .NET Micros Framework.
Microsoft is behind this project and GHI is the first manufacturer to release compatible hardware.

I have used Netduino before, the “problem” with Netduino is that it is extremely basic, you really need to know electronics.

Since I read a lot of these things in school I thought it would be a piece of cake getting stared with Netduino but reality soon came knocking.

Apparently nearly everything I learned in school about these things are gone, quite easy to read up on but still an obstacle between me and my new hardware toy Ler med tungan ute.


Gadgeteer is a fast prototyping kit that uses standard 10 pin sockets that are impossible to turn the wrong way.
It makes it really simple and removes obstacles between you and your finished prototype.
What I like about the Gadgeteer is that it has very little integrated functions, if you want Ethernet for example you need to connect the Ethernet module, there is not Ethernet built-in on the motherboard.

It has 14 connectors and every connector has a letter beside it.
The letter indicates what kind of module you can connect to that socket.

 

Installation

Its really simple to get started, GHI has an install-package that include everything you need to make your first application, or perhaps gadget is a more accurate description.

 

Start Coding

Now you are ready to start your first Gadgeteer project.

In Visual Studio you will find a new template section called Gadgeteer, to start making an app simply select “.NET Gadgeteer Application”.

What I saw next really made me happy, in Visual Studio you’ll get a designer window.

You only need to drag in the modules you wish to use and connect them to a compatible socket.

The designer even tells you which sockets that are ok.

But it doesn’t stop there!
Instead of connecting them manually you can right click and select “connect all modules” and the designer does the job for you.

These kind of help functions really makes me happy, I want to concentrate on coding not other things.

 

Some initial problems
I started of by adding a Multi color LED and wrote
led.TurnBlue();

And the LED did just that, it turned Green.. Say what now!?
Apparently there is a bug, in the LED’s firmware, but GHI is working on the problem.


Next I tried to make a camera app, press a button, take a picture and show it on the screen.

However the buttons didn’t trigger the pressed event this is also an known issue.

So the first two things I tried fail which actually made me a bit concerned.

GHI seems to be on top of things and is really active on their forums so I hope they will come up with a great solution.

Despite the initial problems I would say, buy this kit =)
There is a special feeling when you code runs on a device (like a phone for example).
There's an even more special feeling when your code runs on a device you just put together =)

Tags:

Gadgeteer

The Wp7 Motion api part 2

30. September 2011 17:19

What does the Motion API do?


Well basically it combines the different sensors into one sensor.

 

Accelerometer + Gyroscope
The accelerometer can tell the orientation of the phone by measuring the gravitational forces.
The gyroscope measures the changes in the orientation which means when you start the gyro it won’t be able to tell you what orientation the phone has but it can tell when and how much the orientation changes.
The motion API combines these two values to get the phone's orientation with the accelerometers and uses that as a baseline and then adjust these values with changes from the Gyroscope.
The gyro has a tendency to drift over time so the accelerometer will be used to adjust the gyroscope from time to time.

 

Compass + Gyroscope
The compass is a slow sensor and is used the same way as the accelerometer as a baseline for the gyro.

The Motion API uses the compass to get the heading (North) and then uses the gyro changes to adjust the bearing.
Since the gyro has a tendency to drift (as I mentioned before) the compass will be used to adjust these values over time.

The compass is also very sensitive to magnetic fields and jumps around a lot, the gyro will smooth these readings out.

 

The gyro do not contribute with any “new” values, the accelerometer and compass will do just fine when it come to retrieving the phone's orientation and which way it is facing however it will speed up these readings and make them a whole lot smoother.

The gyro is also more precise for smaller movements.

 

I’m definitely seeing to that my next phone will have a gyroscope, it makes the augmented reality experience a whole lot better.

Tags: