Blog

  • Windows Phone SDK 7.1.1

    At MWC today Nokia announced the Lumia 610 which is a lower spec device designed for emerging markets. This is running an updated Windows Phone OS which supports devices with just 256MB of RAM. To enable developers to create apps which support the new lower memory devices Microsoft are releasing an update to the Windows Phone SDK – 7.1.1.

    At the moment a CTP has been released so that you can test your applications on a 256MB emulator but you should not install this to your main development machine as it doesn’t have a Go-Live license. To try out the new SDK you can download the CTP here:-

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28962

    There is just one API addition to support this change which is an additional property available from Microsoft.Phone.Info.DeviceExtendedProperties.GetValue – “ApplicationWorkingSetLimit” which will let you know whether you are running on a device with 256MB RAM. If your app/game is sufficiently resource heavy that you don’t feel it will run on such a device you can opt out so that your app/game will not be available on these lower powered devices. This is done by adding the Requirements element to your WMAppManifest.xml:-

    <Requirements>
          <Requirement Name=”ID_REQ_MEMORY_90″ />
    </Requirements>

    The other main difference for these devices is there is no support for Background tasks – either Periodic or ResourceIntensive and attempting to add a background task on one of these devices will throw an InvalidOperationException – so it’s important to to check the capabilities first. Because of this limitation you need to design your app such that it doesn’t rely on a background task and that whatever sync/processing the task normally performs can be done when the app is running in the foreground.

    Microsoft have prepared some information on optimising apps for 256MB and it is available here:-

    http://msdn.microsoft.com/en-us/library/hh855081(v=vs.92).aspx

    Some of the suggestions including using the built in launchers and choosers rather than running functionality such as the WebBrowser control or Bing Maps control within your app. They also suggest avoiding using the page transitions provided by the Silverlight Toolkit but don’t suggest an alternative – not sure if this means these devices don’t have the smooth page transitions at all or if they are suggesting that doing them from managed code is too resource intensive. You may decide to implement multiple approaches and use different methods depending on the device capabilities. Obviously the trick here is the balance between providing the best possible experience on each platform and avoiding adding too much more code to maintain.

  • Tasks v1.19

    The latest update to Tasks is now available in the Marketplace. This release continues the improvements to the sync experience by providing more resilience in situations where the network drops out during a sync. It also improves the reminders feature in Windows 7.5 and improves the display of reminders for tasks with very long titles.

    http://www.windowsphone.com/en-GB/apps/55fcf880-6b03-e011-9264-00237de2db9e

     

  • Follow Up from Windows Phone Camp Bristol

    A few of you who attended the Windows Phone Camp in Bristol asked about the slides and code from the Storing Data and Cloud/Networking session. I’ve uploaded the latest versions of these slides and the additional Sockets code project to the FTP site. All the links and resources mentioned during the day are on Pete’s blog post.

    Happy Coding!

  • Review: Making Embedded Systems (Elecia White)

    This title takes a traditional software programmer into the world of embedded system. It covers the process of designing and implementing an embedded system from a sketch through to optimising performance and power consumption.

    As an interesting addition, at the end of each chapter, there is a potential interview question for an embedded developer position. It’s an unusual idea but is a way of tying up the topics covered in the chapter. Because the book is written for developers it applies patterns and techniques which the reader will already be familiar with and how they apply to embedded systems.

    It emphasises the need to be aware of the limited resources available and how to pare down operations to a minimum to make best use of them. It also talks about various options for input and output for a variety of peripherals and sensors.

    The book offers a useful introduction to the world of embedded development to a developer with existing C (or similar) experience. More experienced embedded developers will probably want to delve into more detail on the specific areas, but this is a great starting point.

    4/5

  • Windows Phone Update due shortly

    Microsoft have published details of a new update (7.10.8107.79) which adds a number of fixes to the Mango release. It fixes the issue where the on screen keyboard will randomly hide itself which I’ve been finding frustrating recently and also a fix for the SMS bug which could disable messaging. It also hopefully finally resolves the issue when forwarding Exchange messages where the original message body would disappear. It hasn’t shown up yet but expect it over the next couple of weeks. Full details on all the updates and fixes are published here:-

    http://www.microsoft.com/windowsphone/en-us/howto/wp7/basics/update-history.aspx

  • Developer Unlock Expiry

    When you’ve developer unlocked your Windows Phone you can merrily deploy and debug on it and everything is great. If you’ve upgraded to Mango you had to run the Unlock tool again but this is fairly painless. What is not obvious is that the developer unlock has a 12 month expiry from when you first register the device and even when you subsequently use the unlock tool on the same device this never gets extended.

    So one day you’ll be developing as normal and get the error “Failed to connect to device as it is developer locked. For details on developer unlock, visit http://go.microsoft.com/fwlink/?LinkId=195284.”. Instictively you launch the developer unlock tool, enter your App Hub credentials and unlock the phone. This completes with no errors but you’ll soon find that it hasn’t helped despite the fact you entered valid credentials and your App Hub account is valid.

    The solution to this problem is to log into App Hub on the web and go to your account profile, select devices and remove the offending device from the list (here you’ll see that the expiry date is shown). After doing this you can run the unlock tool again and successfully unlock the device.

    Microsoft could certainly improve this process in the future by using a more descriptive error message and also by improving the unlock tool so that when you try to unlock a device that has expired it refreshed the registration and provide 12 more months of use (just like the manual process described above does).

    Merry Christmas, and here’s to a wonderful 2012 filled with Windows Phone goodness!

  • Submitting Apps to Marketplace with Background Tasks

    I’ve been working on an update to the Tasks application which adds in background synchronisation using the new background task support in Windows Phone 7.5. As with any app when you submit your XAP static analysis is performed on it to check, for example, that you have declared the correct capabilities based on the functionality in your app. Within a background agent you are only allow to call a subset of APIs – as you would expect you can’t play sound effects or draw to the UI (with the exception of toast notifications and tile updates). Because the main app has to include a reference to the dll which provides the background task, and the functionality within the dll is used in both the background task and the main app it made sense to move all of the logic into the background dll. This meant including a number of third-party references. I was very careful to ensure that nowhere in the background task was any restricted API called and it worked perfectly in testing.

    The first problem is that upon submitting the static anaylsis looks at all of the referenced dlls and sees that they contain APIs not permitted in a background task and blocks the XAP. One of the culprits was InTheHand.Phone.dll (Part of Mobile In The Hand) because it provides a mixture of helper classes for logic and for UI. As I’ve been working on the 7.1 version in tandem I’ve now split this into two assemblies for Windows Phone 7.1 SDK projects. This means we can continue to use InTheHand.Phone in background tasks and add a reference to the second assembly in the main application only.

    The second problem is that code within the sync logic calls ScheduledActionService.Add which is disallowed within a background task. This API is used within Tasks to add system-wide reminders (Another new feature for this version) for new task items. The code also has the ability to update and delete reminders based on modified or deleted tasks but these do not seem to have been flagged up as errors. This is a pain because it means that if the device syncs a new task with a reminder set to show before you next open the foreground app we won’t have had a chance to register it.

    The other issue with the NeutralResourceLanguage is an issue with projects originally created with an older version of the development tools. You can add this setting from the projects properties, Application tab and click “Assembly Information…”.

    This has been an interesting learning experience and shows that the validation picks up not just APIs used in the background agent code-path but also in referenced assemblies.

  • Showing Mango Features on Marketplace

    The Windows Phone team have posted to their blog about application updates with a couple of useful points:-

    From October you will again be able to publish updates to your 7.0 apps independently from 7.5 (previously once you had published a Mango update your 7.0 app would be locked). It does mean potentially being in limbo for a month but at least you are not stuck completely with no way of updating a 7.0 app. This is important as it will take some time before many users will have the opportunity of upgrading to Mango.

    When submitting apps there is only one description for both versions of your app so you must describe which features are for Mango only. For the purposes of Screenshots there is now an officially accepted overlay which can be used to indicate Mango-only functionality. You can download a ZIP containing the overlay and examples here:-

    http://create.msdn.com/downloads/?id=882&filename=Marketplace_7.5_Badges.zip

    The full blog post is here:-

    http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/09/20/submit-windows-phone-7-5-apps-today-update-7-0-apps-in-october.aspx?utm_source=twitterfeed&utm_medium=twitter

  • Working with Marketplace Exported Reports

    When Microsoft refreshed the Windows Phone developer portal in advance of the Mango refresh they added various improvements to reporting, an important one being export to file (XLSX). When you open the exported payout detail reports in Excel and enable editing you’ll see a number of warnings against a couple of columns. This is because the data is formatted as text but Excel recognises that the contents are numbers. In order to use these values in formulas or graphs you’ll need to convert them to numerical values.

    The easiest way I found to do this was to select an empty cell and Copy it, then select the entire columns of “Units Sold” and “Royalty”, right click and select “Paste Special”. From the popup select “Add” as the operation and click “Ok”. Now all your number columns are really numbers (you’ll see the formatting change to right alignment).

  • Need a Windows Phone developer handset?

    Are you a Windows Phone 7 developer in New Zealand? Are you in need of a real Windows Phone device to test and debug your apps on? If so I have a spare Samsung developer handset which is going free to a good home. Shipping is $5 to anywhere in New Zealand. I could ship it internationally but the cost would be higher. Contact me if you are interested. I have only one and it’s first come-first served!

    Update – The phone has now been claimed