Uncategorized

Moved my blog and I will try restart blogging here

It’s been a long while since I blogged here. After we moved to the US keeping up with our family blog, work and starting a new life here in the US, blogging here wasn’t a high priority.

Since we are more or less settled down and I have a little bit more time doing some technical stuff it might be a good time start blogging again.

As you can see the blog moved from www.hoekstraonline.net to https://matthijs.hoekstraonline.net. I combined the family blog, my blog and the blog of my wide (http://sandra.hoekstraonline.net/) to a multi site wordpress blog.

I did something wrong on the other blog on www.hoekstraonline.net and couldn’t get it working again, since i wanted to combine all 3 blogs in a single install anyway I took the opportunity to create the new blog, copied over the old posts and configured a permanent redirect (google loves that stuff) so google results and other links should still work.

See you around.

This is also a test post to see if the Jetpack social sharing plugin is working.

Bing.com April fools

This is one of the funny April fools jokes I found today. Most jokes aren’t that funny. But this one is subtle.

Go to http://www.bing.com/

image9

Search for google. This will be the result.

image10

Michael Kroll, Principal UX Manager from Bing explains the ‘Introduction Bing Basic’ in his blogpost 🙂

Oh and if you check the bing.com page the statues smile once in a while 🙂

Capture

 

Adding Videos from your SD card to your Videos library on your Surface RT

My daughter watches a lot of videos on the iPad (youtube and some local stored videos) today she wanted to watch the videos on the pink iPad (our Surface RT with pink touchcover). I have an SD card with videos inserted in the Surface but they don’t show up in the videos library. When you try to add the SD card to the videos library Windows complains it can’t do that because it’s removable media.

This blogpost shows the trick how you can do it. So my daughter now can happily browse videos from the Video app on the Surface RT and watch Dora, Zandkasteel and Barbie 🙂

Thank to @avalaxy (Leon Cullens) for the tip.

WiFi enabled my Roomba

A month ago I purchased my Roomba 780. At home we have a dog (German Sheppard) and we had to vacuum at least once a day (ok my wife did that :)) I thought; let me help a little in our household so I bought this device. At nights it automatically cleans the floor and when we leave the house we can manually start it as well by hitting the clean button or using the remote. So far we are really happy with it. Our daughter called the vacuum Toet! so that’s how we call it as well.

When searching the internet I found out the Roomba devices have a little connector and the specs for that connector are available as well (Roomba SCI Specs) There are also Bluetooth devices on the market which connect to this connector. When searching more I also found the folks of Roomba Wi-Fi Remote made a Wi-Fi connector. This was even more cool because you can connect the Roomba to your Wifi network (it also can be used in adhoc network mode) and you can potentially connect from the outside world as well. How cool would it be to connect to your Roomba from your work and see what the little guy is doing. So I ordered a Wi-Fi Remote on their site. They have a JSON/XML interface next to the web interface. So I am now planning to build a Windows 8 and Windows Phone app to control my Roomba remotely 🙂

Here are some pictures of the device:

WP_20130211_001 WP_20130211_003 WP_20130211_005 WP_20130211_007

Now I also need to figure out what kind of IP camera I want to attach to Toet! so I can watch when it’s working around the house 🙂

Where are all the Windows 8 apps?

We get a lot of questions from people they see less apps in the Windows 8 store than their friends and are wondering what’s going on. It’s pretty simple. By default the Windows 8 store only shows the apps which support your Windows Language preferences. So if you install a Dutch version of Windows the store only displays apps which support the Dutch language.

There are 2 ways you can show more apps. One is go to the settings in the store. Open the store app, go to settings, preferences. If you set the ‘Make it easier to find apps in my preferred languages’ to no the store will show you all apps published in your market.

image5

What I prefer is only the Dutch and English apps. Make sure the setting shown above is set to Yes and go to the language settings of windows 8. (go to the startscreen, start typing language and select settings on the right side of the screen).

Screenshot-7

This is the language screen.

image6

Add the languages you prefer.

Now the store will only display the apps in your selected languages. No Chinese, German and Italian apps in your list Smile

Btw, depending on your locationsetting the amount of apps might differ as well. The location setting in Windows determines what store you are searching for apps. (it doesn’t matter what region you set in your Microsoft account)

image7

How to play a WAV sound file with DirectX in C# for Windows 8

Many people use the Mediaelement to play soundfiles in their apps. For my liitle app this wasn’t good enough. I build an app where I want to be able to press a button very fast and everytime a sound should be played. Mediaelement didn’t handle the soundplaying fast enough for me. On Windows Phone I could use XNA but that’s not available on Windows 8. The alternative is DirectX, since I don’t want to write any C++ code anymore I needed to find something else. But there is a very nice library which wraps DirectX in C# for you which is called SharpDX.

So type this in your packagemanger console:

Install-Package SharpDX.XAudio2

This will add the audio part of DirectX to your project. In your code load the correct wav file:

XAudio2 xaudio;
WaveFormat waveFormat;
AudioBuffer buffer;
SoundStream soundstream;

xaudio = new XAudio2();
var masteringsound = new MasteringVoice(xaudio);

var nativefilestream = new NativeFileStream(
@”Assets\squeeze.wav”,
NativeFileMode.Open,
NativeFileAccess.Read,
NativeFileShare.Read);

soundstream = new SoundStream(nativefilestream);

waveFormat = soundstream.Format;
buffer = new AudioBuffer
{
Stream = soundstream.ToDataStream(),
AudioBytes = (int)soundstream.Length,
Flags = BufferFlags.EndOfStream
};

In the click event of my button I have the following code to start playing the sound:

SourceVoice sourceVoice;

sourceVoice = new SourceVoice(xaudio, waveFormat, true);
sourceVoice.SubmitSourceBuffer(buffer, soundstream.DecodedPacketsInfo);
sourceVoice.Start();

Download [SOURCE]

How to increase your Windows 8 app ratings

Today I described a trick for Windows Phone how to increase the numbers but also the average rating of your app. It worked very well for the my rubber duck app I wrote. A little over 11000 downloads with over 1000 reviews is a ratio of 1:11 which is very good.

The trick is to ask people to review your app (and provide them a very simple way to do it) after they start your app 5 times. The theory is nobody starts the app 5 times if they don’t like it and if the start it for the 5th time they probably like the app and give you a good rating.

Mark Monster blogged about this trick before. You can find his post here. Fons Sonnemans showed some code in his blog how to create a simple MessageDialog like we have on Windows Phone. I stripped down all the extras to the bare minimum in the sample below.

I placed this code in the OnLaunched event in the App.xaml.cs file. Just place it at the botton below the Windows.Current.Activate(); part

int started = 0;
if (Windows.Storage.ApplicationData.Current.RoamingSettings.Values.ContainsKey("started"))
{
     started = (int)Windows.Storage.ApplicationData.Current.RoamingSettings.Values["started"];
}

started++;
Windows.Storage.ApplicationData.Current.RoamingSettings.Values["started"] = started;

if (started == 2)
{
     var md = new Windows.UI.Popups.MessageDialog("Thank you for using Rubber Duck for a while now, would you like to review this app?", "Please review my app");
     bool? reviewresult = null;
     md.Commands.Add(new Windows.UI.Popups.UICommand("OK", new Windows.UI.Popups.UICommandInvokedHandler((cmd) => reviewresult = true)));
     md.Commands.Add(new Windows.UI.Popups.UICommand("Cancel", new Windows.UI.Popups.UICommandInvokedHandler((cmd) => reviewresult = false)));
     await md.ShowAsync();
     if (reviewresult == true)
     {
         string familyName = Package.Current.Id.FamilyName;
         await Windows.System.Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", familyName)));
     }
}

One change I did is I put the keyword async in front of the OnLaunched event so it looks like this:

        async protected override void OnLaunched(LaunchActivatedEventArgs args)

Hope this helps you get more and better reviews of your app.

How to increase your Windows Phone app ratings

UPDATED (18-1-2012): Jason mentioned in the comments this doesn’t work for Windows Phone 8. He is absolutely right. If you check the documentation on MSDN http://msdn.microsoft.com/en-us/library/windowsphone/develop/ms598674(v=vs.105) it tells you for Windows Phone 8 you can’t use the MessageBox.Show in the Application_Launching event. So you should place your code in the OnNavigatedTo event of your first page. I changed the code below to reflect that.

One of the really important things people look for when looking for an app is good rated apps. There is a simple trick you can do as developer to increase the amount of ratings you get but also improve the rating itself.

I implemented this for all my apps. For example my Rubber Duck app has a little over 11.000 downloads but over 1000 ratings as well. That’s a 1:11 ratio which is very high.

The trick I use is to ask a user to review my app after the 5th time they startup the app. I make it super easy to review the app and the idea is, why would somebody who doesn’t like your app start it for the 5th time, so WHEN the users startup your app for the 5th time the chances are pretty good they like to use your app anyway, so they probably would rate the app high as well.

This is what I did. Paste this little piece of code in the App.xaml.cs in the Application_Launching part of the file.

private void Application_Launching(object sender, LaunchingEventArgs e)
{
IsolatedStorageSettings.ApplicationSettings[“askforreview”] = false;

int started = 0;
if (IsolatedStorageSettings.ApplicationSettings.Contains(“started”))
{
started = (int)IsolatedStorageSettings.ApplicationSettings[“started”];
}
started++;
IsolatedStorageSettings.ApplicationSettings[“started”] = started;
if (started == 5)
{
IsolatedStorageSettings.ApplicationSettings[“askforreview”] = true;
}
}

Place the following code in your MainPage.xaml.cs (or any other page which might be the startpage of your app, for example when your app is pinned another page might be the startpage)

protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);

var askforReview = (bool)IsolatedStorageSettings.ApplicationSettings[“askforreview”];
if (askforReview)
{
//make sure we only ask once!
IsolatedStorageSettings.ApplicationSettings[“askforreview”] =false;
var returnvalue = MessageBox.Show(“Thank you for using Rubber Duck for a while now, would you like to review this app?”, “Please review my app”, MessageBoxButton.OKCancel);
if (returnvalue == MessageBoxResult.OK)
{
var marketplaceReviewTask = new MarketplaceReviewTask();
marketplaceReviewTask.Show();
}
}
}

Making a backup of my HP EX470 Homeserver disk

Update: make sure you follow this post when finished cloning your drive otherwise WHS won’t run as you would expect.

One of my colleagues Homeserver crashed and he doesn’t have the restore DVD anymore. I happen to have an EX470 homeserver from HP as well. My colleague asked to copy the C drive (that’s the only drive HomeServer doesn’t create a duplicate for). Lars Stolwijk recommended using EaseUS ToDo backup to clone a disk on twitter.

I downloaded that tool. You can choose to extract an ISO so you can burn a CD yourself, burn a CD immediately or create a bootable USB drive. I created a bootable USB disk and started it on 1 of my pc’s. The USB Key booted so I attached my c drive from my homeserver and an empty 500GB disk to this pc and rebooted again.

WP_20130106_002

Booting from the USB took a while, so be patient.

WP_20130106_003

I hooked up my homeserver seagate drive and an empty WD drive. Remember which one is your homeserver drive so you won’t copy the emtpy drive over your homeserver drive 😉

WP_20130106_004

Click next.

WP_20130106_005

Copy disk (you can also copy a partition, but I needed the entire disk)

WP_20130106_006

Select the source disk. In my case that is the Seagate disk from my homeserver. Make sure you choose the correct one.

WP_20130106_007

And the destination. As I understood the destination disk doesn’t need to be the same size. It can be a larger disk.

WP_20130106_008

Make sure everything is OK and press proceed.

WP_20130106_009

And now we wait 4 hours before it’s complete!

After that I plugged in the drive and booted from it. Voila 🙂