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 🙂

 

 

Little fun with NFC and Windows Phone 8

Since Windows Phone 8 supports NFC I wanted to see what I could do with it. I ordered a bunch of NFC stickers online from Special Line.

You can use your own app to program the stickers but there are also a few in the store already. NFC Interactor or NFC Launchit. NFC Interactor is the most flexible but you need to do most of the configuration yourself. NFC Launchit has a lot of predefined action you can write to your tag (but only app launches) for example go to your wifi settings or Kid’s corner. What it doesn’t allow you to do is choose a custom app or one from the store (it only has a predefined most popular list)

What I wanted to do is start the app Flitsnav in my car when I put my phone in my Brodit carholder. This is how it looks like in real life.

BTW, Microsoft did think about security. This is how it works when you have a pincode configured on your lockscreen.

So I used NFC Interactor. You need to go to the ‘tag composer’ pivot. Remove everything you see on the screen. Add a LaunchApp (Generic) record. The Windows Phone Product ID you need to provide yourself. I looked up the FlitsNav one for my scenario and pasted in the textbox. After that you choose ‘write to tag’ and hold the phone over your NFC tag. That’s it.

wp_ss_20130106_0001

One little gotcha. Windows Phone 8 only allows reading and writing tags which are NDEF formatted. Make sure you order tags (or format the tags yourself with a NFC writer or Symbian/Android phone). I ordered my tags with Special line and asked them to format the tags for me and that’s what they did.

Oh BTW. Windows Phone 8 ALWAYS asks if you want to start the app. That’s not something you can change.

Youless and Bidgely in the house

Around the end of the year we will get the final calculations from our energy supplier and you will know if your monthly bill was too high or too low the last year. My energy bill is quite expensive I think and that has mostly to do with me using a lot of energy (and all the taxes of course). When I log in to the website of Eneco I can see what the average usage of houses in my neighborhood is. I don’t run any server farms anymore (I did have a full 19” rack in the past) so I already cut down my usage a lot. Still I wanted to know how much power I was consuming and especially what I was using at night.

I happened to stumble up on the YouLess website last year. (not sure who mentioned it on Facebook or twitter). They sell a little device which you place on top of your energy meter and it counts the pulses so it knows how much power you are consuming real-time! The cool part is that is has a network connection too. Not sure what it is, but when little electronic devices have network connectors they become a lot more interesting suddenly.

LS110-32c97910

Installing and configuring the YouLess

So I ordered one and received it 2nd of January. Installation was really easy. A sticker with a little hole in it was placed over my electricity meter with the hole over the little blinking light. I could place the YouLess device on top of that sticker (it uses Velcro).

meterkast-a6b33364

The device is powered with a USB cable. A separate USB cable and connector is supplied with the device. I could plug in the USB cable in my router so it can power the YouLess like that. USB is only used to power the device. Communication is done through the Ethernet connection. You need to download a little tool to configure the ip address of the youless (only static ip address I am afraid) and after that you can browse to your little gadget.

image1

The input part displays if the YouLess can count the pulses correctly. You have to configure the YouLess for your specific meter as well.

image2

In my case I have a digital (LED) meter which pulses 10000 times for every kWh usage.

Historic data using Bidgely

Well, that took 10 minutes tops and the YouLess was calculating realtime usage of my power. You can read out the historic data yourself (I will get to that in a bit) but you can also upload the data every 30 seconds to a free service called Bidgely. You need to get an account on that website. After that you can configure the YouLess to upload the data to this service. It automatically uploads your data. If the network connection is down, no problem, the YouLess stores 1 year of data automatically.

image3

When you log in to the Bidgely site you immediately see some cool data. You now really understand why this data needs to be protected (there is a lot of discussion in the Netherlands around smart meters and their data).

For example, lets take a look of the data in the chart above. This was during my holliday so it’s not a typical day for me but you can get some interesting data out of it.

On the left part you see the usage drop from around 900W to 400W, that’s around 1:00AM when I went to bed last night and switched off the lights and computer. At 2:00 it drops another 60-80W because my Synology NAS shuts down. At night it changes between 300W – 380W I need to figure out what is consuming that power. I have a wireless router. Fridge, Freezer some chargers etc. In the morning when we woke up we made some breakfast and I boiled water on the stove. That’s the 2000W spike you see around 9:00am. Around lunchtime my wife used the washing machine to do some laundry which is spike around 12:00am. My wife vacuumed the living room around 3:00PM (another 2000W spike) and around 6:00PM we cooked some spaghetti. Lights are on and the tv is on as well around this time so the average usage is a little higher than during the day. It’s pretty obvious at what time people are in the house using electric appliances or are at sleep looking at this chart.

I want that data for my app

Whats cool about the YouLess, its storing historic data. You can also download an app for iOs and Android which shows you the realtime usage of your home. Hey, I am missing Windows Phone and Windows 8 🙁 let’s see if we can build that ourselves.

If you go to the data part of the YouLess you will see the data is available per month, per week, the last 8, 16 or 24 hours and the last 30 or 60 minutes. When you open one of the reports it looks like this:

image4

The URL is uses to open this report is http://<YouLessIP>/V?h=1 (h=1 means last hour of data). When you add &f=j behind the URL it will return a JSON feed which looks like this:

{“un”:”Watt”,”tm”:”2013-01-05T19:52:00″,”dt”:60,”val”:[” 1068″,” 1068″,” 1068″,” 1068″,” 1068″,” 1068″,” 1068″,” 1068″,” 1068″,” 1044″,” 1044″,” 1068″,” 1128″,” 1128″,” 1152″,” 1128″,” 1128″,” 1152″,” 1116″,” 1164″,” 1056″,” 1188″,” 1176″,” 1092″,” 1104″,” 1116″,” 1116″,” 1116″,” 1128″,” 1140″,null]}

You can get to the realtime data when you use http://<YouLessIP>/a?f=j which results in:

{“cnt”:”25309,428″,”pwr”:1111,”lvl”:103,”dev”:””,”det”:”&bull;”,”con”:”OK”,”sts”:”(42)”,”raw”:0}

That’s the data which is used by the iPhone app to show you a little chart.

mzl_tqdpyksn_320x480-75

I think we can build a better Windows Phone and Windows 8 app for that :). I am building it right now, when it’s finished that’s another blogpost I will write.

About this blog, it’s wordpress running on Microsoft Azure

Why not describe how I installed this blog? Perhaps you are surprised I run this blog on WordPress while I am working at Microsoft 🙂 that’s ok but I like to play around with other stuff than just Microsoft technology. It helps me being informed about what people are also using (and yes I know not the entire world is using Microsoft technology) and WordPress actually runs perfectly fine on Microsoft Azure. So that’s what I did. I have a MSDN subscription which comes with 1500 hours of Azure time. If you setup WordPress on Azure websites it’s even for free!

So this is what I did. Logged in on the Azure portal, clicked New, Web Site, From Gallery and selected WordPress.

image

You need to select a unique url for azurewebsites.net. Create a new MySQL Database and the location where you want all this created (which for me is Western Europe). The MySQL database (20MB) is hosted by ClearDB. That’s all there is to installing wordpress on Azure. I later changed the configuration of the website from free to shared so I could configure my own domain hoekstraonline.net for this website.

John Papa described the proces I more detail in his blogpost here.

The last step I did was moving the wordpress stuff into the wordpress directory. That proces is described here. This gives me a nice clean directory where I can put other junk in the future when I try to experiment more with azure and some mobile services and .net stuff I want to build. (and it’s an easy backup through ftp by just copying the wordpress directory locally.)

Welcome to my blog

Yes, finally, after many years I am starting my own blog on my own domain hoekstraonline.net. I have been blogging for a while on my Microsoft blog but I decided this holiday I wanted to blog in English (the MS blog is only Dutch) and want to write about more than just the MS work I do. I will still be posting on my MS blog and perhaps do some crosspostings once in a while too.

This blog is meant to use as a simple journal. Share stuff I figured out might be interesting for others as well and just recording stuff I might need later too. One of the reasons I want to share is because I like to read other blogs too. I learn an amazing amount of new stuff every day by just reading blogposts. Perhaps some people might learn from some stuff I write down.

If you have any questions, please leave a comment or write me a message via email matthijs@hoekstraonline.net or twitter @mahoekst

Regards,

Matthijs Hoekstra