Posts Tagged ‘wp7dev’

WP7 Review Reader now supports 54 marketplaces

Written by Tom Verhoeff. Posted in MSP, WP7

Yesterday Microsoft announced that marketplaces in 13 new countries were opening up. Today I am happy to announce that support for those new marketplaces has been added to the WP7 Review Reader tool. The tool keeps helping out developers to get easy access to their reviews by simply entering the AppId and bookmarking the URL. For more information on the Review Reader, please see the previous posts on this subject. Some of you might have also noticed that I’ve gone a little silent on my blog and twitter recently. I’m trying to catch up, but there are some important WP7 projects that require my full attention at the moment. I will be releasing some brand new Windows Phone apps targeted at the Dutch market in the coming weeks. Stay tuned for more news on that part.

WP7 app analytics using mTiks in just 5 minutes

Written by Tom Verhoeff. Posted in MSP, WP7

This post is part of a follow up series on my TechDays session on “Making Money with Windows Phone applications”. See this post for more info and an index. mtiks1 Why build in analytics into your mobile application? This subject has been covered in many blog posts an their conclusion is usually the same. First of all you just want to know how many people use your app and how often they do it. But knowing (at least to some extent) what part of your app is used the most and what epic feature is never found by users is also valuable. As a developer there’s plenty of frameworks to choose from:
In this post I will cover mTiks, since it’s just too easy to get started. You’ll be able to instrument your app in literally just a few minutes.

Making Money with Windows Phone applications at TechDays 2012

Written by Tom Verhoeff. Posted in MSP, WP7

Last week the yearly event for Dutch developers on the Microsoft platform took place in The Hague. Just like last year I did a session on “Making money with Windows Phone applications”. The session is targeted at an audience that is new to the platform. It covers all the subjects that are relevant for earning some money except the building of the app itself (there’s other sessions for that). Although the content is pretty basic it does give interesting insights in opportunities to make the most out of your apps. Since people keep asking me about the different subjects I decided to cover everything in some blogposts over the coming week. Some subjects have been covered in the past. This post will server as an index to those posts, feel free to suggest additions if there’s anything you would like to know. The session covered these subjects, I will update them with links when I published the relevant blogposts: The session itself was presented in Dutch and is available on Channel9. The slides are in English and are available through SlideShare.
If you would like to contact me feel free to do so in the comments, the contact form or Twitter. And do share your WP7 succes stories!

Forcing capability detection in a Windows Phone application

Written by Tom Verhoeff. Posted in MSP, WP7

Last week I blogged about a problem I came across when beta testing a new WP7 application. My problem was related to the ID_CAP_MEDIALIB capability. Today I noticed somebody on twitter having similar issues.
PROBLEM! #wp7dev 's: When submitting an app that uses the video recorder <"ID_CAP_Microphone"> is removed http://t.co/PU3PSv62 #wpdev
@lancewmccarthy
Lance W. McCarthy
Fortunately there is a way to force detection of every capability. The key is knowing what reference to use to force the detection. In this post I will show how to implement a simple workaround to ensure detection. Please note that all of this is just temporary. Microsoft’s engineering teams are working on fixing these detection issues, so these tricks should not be required anymore in the future.

Detection process

First of all it is important to realize that the Ingestion Tool does not scan the actual C# and XAML (that’s not included in the XAP package anyway). The actual scanning happens on the Intermediate Language (IL) that is generated by the compiler. This is important to keep in mind when implementing this workaround.

Detection rules

Essentially both the Marketplace Test Kit and the App Hub itself use the same set of rules to determine what capabilities are required. Fortunately those rules are supplied with the Test Kit in understandable XML format. To find out what class you need to reference to force detection it is sufficient to check this list of rules. The rules.xml can be found in “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Tools\Marketplace” For example here’s the part on the ID_CAP_MICROPHONE capability.
<Capability ID=”ID_CAP_MICROPHONE” Type=”Security”> <Assembly Name=”Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553″> <Namespace Name=”Microsoft.Xna.Framework.Audio”> <Class Name=”Microphone” /> </Namespace> </Assembly> <Assembly Name=”Microsoft.Phone.Media.Extended, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e”> <Namespace Name=”Microsoft.Phone”> <Class Name=”Camera” /> <Class Name=”PhotoCamera” /> <Class Name=”VideoCamera” /> </Namespace> </Assembly> </Capability>

Forcing detection

The rules.xml file basically tells you what classes to reference to force the detection (I highlighted them). In any case you can just add a dummy file (either xaml or just cs) and make a reference to just one of these classes. In case of the Microphone @lancewmccarthy suggests this line:
Microphone microphone = Microphone.Default;
This is a Microphone-specific solution. Another option is to just add this line:
Microsoft.Xna.Framework.Audio.Microphone temp = null;
This is where you need to remember the code gets compiled before scanning. The compiler implements a lot of optimization which in this case would lead to discarding a variable that is never accessed. Adding another line that references the variable solves this. This can be pretty much anything, for example:
MessageBox.Show(temp.ToString());
If you would actually run this code it will always throw a NullReferenceException, but since this is a dummy file that will never happen. Although the code is unreachable the ingestion tool notices it. You can use the Marketplace Test Kit to verify this. capabilities

Conclusion

By combining the information in the rules.xml with a simple dummy file you should be able to force detection of any capability. The other way around rules.xml can also help you identify why a certain capability gets detected. Do you come across any problems when using this method? Feel free to leave a comment or send me a tweet.

Marketplace fails to detect capabilities, causes crash

Written by Tom Verhoeff. Posted in MSP, WP7

Those of you following me on Twitter might have noticed some complaints about the beta version of one of my new applications not working the way it should. The app implements a BackgroundAudioAgent to play an audio stream. When directly deploying the XAP to a device this works like a charm. For a last round of testing I submitted the app for private beta testing through the App Hub. To my big surprise the version downloaded through private beta instantly crashes when trying to start the backgroundagent. Apart from analyzing, signing, encrypting and repackaging the XAP nothing should be changed by the private beta process, so this should not be possible.

Cause

We investigated the problem together with the Microsoft Marketplace Dev Support team. We figured out the crash was related to the specified capabilities. To play background audio the agent relies on the ID_CAP_MEDIALIB capability. This was specified in our manifest-file, but during the submission process the required capabilities are analyzed and overwritten. Apparently the App Hub contains a bug causing the medialib capability to remain undetected in certain situations. When using the Marketplace Test Kit the same problem shows, it does NOT detect the medialib capability. When the application tries to execute any action related to this capability it simply throws an exception and crashes.

Solution

Obviously this is a bug in the Marketplace Ingestion tool that Microsoft needs to fix. The support team states: “I can tell you that it’s a known problem at our side that Engineering Team is already investigating”. Fortunately there’s a pretty obvious and easy workaround to solve this problem. Just add a “dummy” page to your application. Add elements to this page the ensure detection of the missing capability. In my case we forced detection of the MediaLib capability by inserting a MediaElement and making sure at least the x:Name is specified( <MediaElement x:Name=”DUMMY” />). Now both the Marketplace Test Kit and the App Hub’s ingestion tool will detect the capability therefore solving the problem. Update: The support team also provided me with some other workarounds that are easier and cleaner, but still force detection of the missing MEDIALIB capability. If your app is referencing any of these libraries just add the one line of code to your app.
If it’s referencing: Then add:
Microsoft.Phone.dll Microsoft.Devices.MediaHistory history = null;
Microsoft.Xna.Framework.dll Microsoft.Xna.Framework.Media.MediaLibrary lib = null;
none of the above ones, so very likely it’s at least referencing System.Windows.dll System.Windows.Controls.MediaElement me = null;
I don’t know if anybody experienced problems with apps crashing after going to the marketplace submissions process, but the first place to search for errors appears to be the detected capabilities. The Marketplace Test Kit performs the same analysis the marketplace does, so it’s easy to check. The engineering team is working on fixing the issues, but for the time being forcing detection by adding dummy elements is easiest workaround.

Testing your app with various connection speeds

Written by Tom Verhoeff. Posted in MSP, WP7

Would you like this feature to be integrated into the WP7 emulator? Vote here!

An important aspect of every mobile application that uses the internet connection is the way it handles slow connections. As a developer you cannot predict if you are app will be used over high-speed UMTS or slow GPRS. In WP7 development there are some API’s available to determine the connection type, but you can never be sure about the exact speed. To ensure the best experience for your users testing some scenarios is very important. Unlike the Android emulator, the Windows Phone emulator does not provide any functionality to limit the network speed, but there are some alternatives that don’t require you to take your phone to the middle of an empty desert. In this post I will cover throttling of the network connection using NetLimiter. netlimiter1

Windows Phone App Event in Eindhoven

Written by Tom Verhoeff. Posted in MSP, WP7

9b8ex

Two days ago the biggest Windows Phone 7 developer event to date in the Netherlands took place. With the official launch of WP7 in our country and the recent addition of Nokia phones to the line-up developer interest is rising. A total of about 300 attendees showed up for a full day of sessions including a basic introduction the dev platform and tools, more advanced topics like push notification and fast application switching and a session on app monetization. The sessions where presented by Maarten Struys, Fons Sonnemans and myself. A big thank you goes out to Microsoft’s Matthijs Hoekstra, the Dutch WP7dev evangelist, who organized the event at the High Tech Campus in Eindhoven.

Building smartphone applications at Night of the Nerds

Written by Tom Verhoeff. Posted in MSP, WP7

Note for English readers: Yesterday I did a few sessions about Windows Phone/Smartphone app development at a Dutch event called Night of the Nerds focused on 14-18 year old secondary school students. This blogpost will introduce some resources to get them started. Because of the target audience this post is presented in Dutch. Gisteravond tijdens Night of the Nerds heb ik drie presentaties gegeven over het ontwikkelen van smartphone applicaties. Night of the Nerds is een evenement gericht op middelbare scholieren van 14-18 jaar oud met interesse in techniek. Het evenement is open voor alles en iedereen die het leuk vindt om met techniek bezig te zijn. Tijdens een clinic van 45 minuten heb ik kort de wereld van smartphones en apps geintroduceerd en aansluitend een demonstratie gegeven van het bouwen van een simpele twitter applicatie. Veel bezoekers reageerden enthousiast en wilden graag thuis aan de slag met het bouwen van een eigen app. In deze blogpost vinden jullie alle benodigde informatie om de eerste stappen te maken als app-ontwikkelaar.

Removing old/beta applications from the App Hub

Written by Tom Verhoeff. Posted in MSP, WP7

A while ago I blogged about one of the most useful features introduced with the new App Hub: private beta distribution. I have to admit, I use this one pretty often. Updating is not supported for beta’s (vote here if you would like it to be), so with every app I build my list of apps grows bigger and bigger. Unfortunately Microsoft appears to have missed a pretty obvious option, the actual deleting of beta’s that are finished anyway. I am able to end a beta, but it keeps showing up in the list.To keep thing manageable I decided to fire up my favourite tool Fiddler again. It helped me out with App Hub exceptions before and to my big surprise Fiddler again is the solution here. It does take some effort, but at least it keeps your App Hub account nice and tidy.
Notice the missing "Delete submissions" button

Notice the missing "Delete submissions" button

pubCenter starts expanding outside the US

Written by Tom Verhoeff. Posted in WP7

Back in July Todd Brix announced on the Windows Phone Developer blog that Microsoft pubCenter would be expanded 18 countries by the end of 2011. I haven’t seen any official announcement just yet (Update 27/09: Microsoft released an official statement today) but while checking pubCenter today I noticed it is now possible to select out of 17 countries when entering tax information. Switzerland is the only one missing compared to the list announced back in July (but hey, it’s still 2011). When exploring some more I noticed that signup now lists 12 countries and payment requests can be made for the same 12 countries. The expansion doesn’t appear to be completed, but still it’s very good and important news for WP7devs living outside the US. So what are the improvements that I noticed:
  • Tax information can be entered for 17 countries
  • Payment can be requested for 12 countries
  • PubCenter accounts can be created based in 12 countries
What are the drawbacks still in place:
  • Still only US impressions are counted
  • Still a valid US Tax ID is needed, just as with revenue from your apps
I guess all information will be disclosed in an official statement by Microsoft soon, since everything is already live on pubCenter right now.