Mar 31

Icon not displayed correctly on the application bar for Windows Phone

What to do about an icon that is not showing up a the application bar?

I’ve added a png (an icon from the C:Program Files (x86)Microsoft SDKsWindows Phonev7.1Iconsdark directory) to the project. Added it to Mainpage.xaml

<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible=”True” Opacity=”1.0″ Mode=”Default” IsMenuEnabled=”False”>
<shell:ApplicationBarIconButton IconUri=”./Images/share.png” Text=”Share”/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

I’m sure that the path is correct. So whats happening here?

On MSDN is the solution:

The URI must point to a file in the application directory. When adding an image file to a project using Windows Phone SDK, you must set the Build Action property to “Content”. Using the default value “Resource” will not allow the image to be accessed or displayed.

So just set the properties of the image in the Solution Explorer right, and your icon is displayed correctly.

CD

Mar 19

Resolving problems with InsufficientBandwidth status on Kinect for Windows device

Today it’s time to explore the Kinect for Windows device. In fact the Kinect is a bunch of sensors that you can read. It has a color camera, an infrared camera, an infrared projector and a microphone array. I set my goal to develop an applications that is able to interact with the Microsoft Lync client.

The first thing to do is determining wether there is a sensor connected and if: then start the sensor. If not: display a text with the status and display an image. All works fine, except when plugging and unplugging the device. Then the sensor get a sensorstatus: InsufficientBandwidth

In case someone unplugged of plugged the sensor after starting the program, I created an eventhandler for KinectSensor.KinectSensors.StatusChanged and if this event happened I run StartKinect.

My code is as follows:

Of course my USB hub is not heavily used and is USB 2.0, so there should be enough bandwidth. So what was going on?

After unplugging the Kinect for Windows sensor the KinectSensor instance KinectSensorInUse was not disposed off. When reconnecting the Kinect the instance gives apperantly the wrong status to the instance. After modifying the code so that the instance is disposed of after unplugging all worked very well.

 

CD

Mar 12

Adding a Windows Communications Foundation Service Reference to your c# project

New to the Windows Communications Foundation (WCF) I’ve programmed some code in Visual Studio 2010 that should make use of my SQL Azure database that is hosted by Microsoft. I programmed the interfaces and exposed the services GetPresence and SetPresence . When testing the services with WCFTest.exe, all exposed services are working fine.

So I took my Windows Phone 7 app and right-clicked in the solution explorer on my Windows Phone app project and choose add service reference. Named the service and after selecting the correct service (that was correctly visible), the reference was added. I clicked on view object in browser, and the objectbrowser didn’t show my service reference at all. Double checked everything (as I doubt myself as a beginner the most) but no solution. Deleted the reference, added again: same issue.

To make a long (many hours) story short: Fortunately the solution is (as always) simple: – Delete the service reference – Close Visual Studio (this part is crusial !) – Reopen Visual Studio – Add the service reference again – Everything should be working fine now Since I’ve had the problem on different PC’s, I’m fully patched, this must be a bug in de Microsoft Visual Studio 2010 (version 10.0.40219.1 SP1Rel)

When is Visual Studio 2010 SP2 coming, or do I have to upgrade to Visual Studio 2012?

CD

 

Mar 08

Submitting your app to the Windows Phone Marketplace

Since I’ve started developping apps just for fun, I realised that my first WP7 app is a great success, at least it is for my 2 year old son. He plays with it all the time. So why not share this success?

It time to find out how to submit your application to the Windows Phone Marketplace. Altought it’s relatively simple, I doubt if you get it right the first time, due to the policies that Microsoft has in place, and believe me, the policies are needed!

First you have to register as a developer (create.msdn.com) , pay a small fee ($100 per year) and then . . . . . the tax forms :-( Very complicated, but Microsoft is very willing to assist. Fill in the form, send it per e-mail to the Microsoft (mplcomm@microsoft.com) and they’ll check it for you, and if its OK, you have to send it by snail mail. Why is it so complicated? I’m a dutch guy, that doesn’t know anything about the American IRS, the jargon used and the tax treaty The Netherlands has with the USA. And it’s very important to get it right: if one of your apps become successful, they’ll probably find you and sue you for a lot of money. So make sure you’ll fill it in right.

Uploading is quite simple. Upload your xap file, give some description, set the pricing and do some testing. Testing should be done using a Visual Studio plugin. There are three types of tests in the Windows Phone Marketplace Test Kit:

  • Automated
  • Monitored
  • Manual

Very important to install and use this plug in. It wil save you a lot of effort (and mostly time) to get your app published. These are tests that Microsoft also wil do. So be prepared to run them before you upload the xap file. Take a good look at the manual test. My app was rejected twice, due to not have tested the manual tests thouroughly enough. So save yourself the time and effort and take a few minutes to do proper testing.

After 3-7 days your app will be approved (or not). After approval it takes 2-4 day to appear in the Windows Phone Marketplace just like my app Kids Fun!

Happy selling

CD