Posts Tagged ‘wp7nl’
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
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. 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:
- Google Analytics (using MSAF)
- Preemptive Runtime Intelligence (less interesting since their deal with MS ended)
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
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:
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!
- Marketplace submissions/choosing the right name/logo/description
- Trial API
- Marketplace and Social media “Tasks”
- App promotion/marketing
- Reporting (App Hub, Distimo, etc.)
- Analytics (using mtiks)
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
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.
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.
PROBLEM! #wp7dev 's: When submitting an app that uses the video recorder <"ID_CAP_Microphone"> is removed http://t.co/PU3PSv62 #wpdev
Lance W. McCarthy
Detection processFirst 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 rulesEssentially 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=188.8.131.52, Culture=neutral, PublicKeyToken=842cf8be1de50553″> <Namespace Name=”Microsoft.Xna.Framework.Audio”> <Class Name=”Microphone” /> </Namespace> </Assembly> <Assembly Name=”Microsoft.Phone.Media.Extended, Version=184.108.40.206, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e”> <Namespace Name=”Microsoft.Phone”> <Class Name=”Camera” /> <Class Name=”PhotoCamera” /> <Class Name=”VideoCamera” /> </Namespace> </Assembly> </Capability>
Forcing detectionThe 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.
ConclusionBy 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
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.
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.
CauseWe 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.
SolutionObviously 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;|
Windows Phone App Event in Eindhoven
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
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
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.
Dummy artwork for private beta submission
Yesterday I published a blog about private beta testing, one of the great new App Hub features. Although the feature itself is great part of the process can be a little frustrating. One of the things that frustrated me was the requirement to submit the full load of artwork. In the first stages of testing I usually don’t have all the artwork/screenshots finished yet, which in the end forced me to create some dummy artwork. The same holds when you don’t want your artwork to be available yet before the official launch of your application. To save some frustration in the future I will just share my dummy artwork. I did not try to give it any kind of design so it’s ugly, but at least it will be accepted by the App Hub. Feel free to use it in your beta tests. Here’s a zip containing all the files. Happy beta testing!
Using private beta distribution for testing your WP7 app
A while ago Microsoft introduced a big improvement to the App Hub. Recently I gave one of the new features, private beta testing, a spin. The process is actually easier than I thought it would be. There are a few things to keep in mind though. In this post I will share a quick walkthrough for distributing your app through private beta-testing. Please pay attention to the remarks. Dutch readers might recognize the info in the post, I recently started as an editor at Dutch WP7 community and newswebsite WP7.nl where I published a similar article in Dutch