software you can take with you

Peter Foot

Microsoft Windows Phone Development MVP
  • 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

    Posted Jan 20 2012, 02:53 AM by PeterFoot
    Filed under: ,
  • 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

    Posted Jan 19 2012, 02:53 PM by Peter Foot
    Filed under: ,
  • 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

  • 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

     

  • Finalists Announced for the Imagine Cup 2011

    I recently had the fun experience of working in the judging team for the Imagine Cup XBox/Windows Game Design competition. This was one of the many tracks of the Imagine Cup competition concentrating on games for Windows and XNA written by teams of students. The quality and variety of the submitted games was awesome and I’m pleased to see one of the titles I judged made it to the finals. You can read all about the final five games in this track here:-

    http://blogs.msdn.com/b/andrewparsons/archive/2011/05/24/meet-the-finalists-xbox-windows.aspx

     

    Posted May 25 2011, 05:37 PM by PeterFoot
    Filed under:
  • Quick Look at the Mango Developer Tools

    The Mango developer tools require Visual Studio 2010 and Service Pack 1. The package includes a Mango emulator image and new project templates. The tools allow you to work with (and create new) projects for Windows Phone 7.0 as well as 7.1 (which is how the tools describe the Mango release. Previous rumours had suggested 7.5. The full list of 7.1 project types is below.

    project types

    There are no visible difference to the developer tools, you have the same XAML editor and code editors as before and the same Toolbox items.

    New Functionality in Microsoft.Phone

    Microsoft.Devices namespace now holds classes for working directly with the camera, allowing you to put a live viewfinder in your app and access and manipulate the raw data.

    Microsoft.Phone contains a base BackgroundAgent class and the BackgroundAudio and BackgroundTransfer namespaces contain specific implementations for audio and file transfers.

    Microsoft.Phone.Info adds new properties and a new way of accessing them. Rather than the GetValue/TryGetValue approach there is a DeviceStatus class with strongly typed properties. The new properties are:-

    • IsKeyboardDeployed (for devices with sliding keyboards)
    • IsKeyboardPresent
    • PowerSource (Battery or External)

    There are events for PowerSource and IsKeyboardDeployed so you can monitor when these change.

    Microsoft.Phone.Net.NetworkInformation (short and snappy!) exposes a lot more information about network connectivity. DeviceNetworkInformation exposes not just current network availability but also whether Cellular Data or Wifi are enabled. In the case of Cellular Data you can determine if the phone is roaming. This method also exposes the ability to dom a DNS lookup for a server. Via NetworkInterfaceList you can get a full list of all the network interfaces and their characteristics. Extension methods are provided for WebRequest and Socket classes so that you can specify which network you want them to use.

    Microsoft.Phone.Notification contains some small improvements to the HttpNotificationChannel functionality. You can now query the connection status and monitor when it changes.

    Microsoft.Phone.Scheduler contains classes for scheduled actions, either background tasks, timed alarms or system-wide reminders.

    Microsoft.Phone.Shell adds improvements for tiles and the system tray. For tiles you can modify data locally without a round-trip to the notification server. You can also create secondary tiles for functionality within your application. The SystemTray finally lets you change the background color and also allows you to expose progress text or a progress bar in the system tray as the built-in applications currently can.

    Microsoft.Phone.Tasks contains some new Launchers/Choosers:-

    • AddressChooserTask – Pick a mailing address from your contacts
    • BingMapsDirectionsTask – Get directions to a specific location
    • BingMapsTask – Center a map on a specific point
    • GameInviteTask – Start a multiplayer game
    • SaveRingtoneTask – Allow a user to save an audio file you provide to their ringtones on the phone

     

    Microsoft.Phone.UserData contains classes to access (read-only) Contact and Calendar data on the phone.

    Of course this is merely scratching the surface. These improvements (especially features like background tasks) open up whole new possible features in our apps!

    Download the tools now : http://www.microsoft.com/downloads/en/details.aspx?FamilyID=77586864-ab15-40e1-bc38-713a95a56a05

     

  • Bug in Marketplace Over-The-Air Update

    Recently we had an issue where our application would crash on launch after an update was pushed to the device through Marketplace. Fresh installations were not affected and we could not replicate the issue on a development machine. By analysing the contents of the two XAP files we found something very interesting. The application uses a number of dlls to provide various functions. The update made a number of small changes within the code but there was one clear difference in the dlls. One of the dlls in the newer version was an older version than in the previous XAP. While this was not entirely intentional it wouldn’t itself cause any problems as shown by the fresh install scenario working as expected. We therefore found that in the (albeit unusual) case of a XAP file containing an older dll it would not overwrite the newer dll on the device. This caused the app to immediately crash while it loaded – presumably a TypeLoadException.

    This is quite a rare scenario and probably explains why the bug hasn’t been seen more frequently. Luckily there is a workaround when you know about it. If you have to roll back the functionality in a component of your application make sure you still increment the version number. If the dll is from a third-party and out of your control this is still a problem. Hopefully this is something which can easily be fixed in a phone update. While I understand it is a rare scenario and probably explains why it hasn’t been tested, I still consider this a bug as the application package as shipped in the XAP is what has been tested as a complete package (both by the developer and during Marketplace ingestion) and should be considered the latest version as a whole regardless of the versions of individual files.

     

  • APPA Mundi Tasks 1.9

    The latest version of our Tasks app has now hit Marketplace. This release builds on the improvements from my last blog post:-

    • We now have fixed an issue some users were encountering with synchronising Hotmail tasks in v1.8
    • We now support a wider range of Exchange Server 2003 mailboxes including those with non-standard security policies
    • Thanks to user-feedback we’ve improved the French and German text within the application
    • We’ve changed the timing of how the welcome message pops up in the trial version to avoid navigation issues
    • Based on user feedback we’ve added the option of putting undated tasks at the top or bottom of your To-Do list
    • Since version 1.7 we’ve changed the transition animations between pages to match the built-in applications (obviously this doesn’t come across in the screenshots!)

    We’d like to say thanks for all the great feedback we’ve received from users. We’ll keep listening and adding to the product so keep it coming!

  • Managing Processes and Memory With Mobile In The Hand 7.0

    .NET Compact Framework

    The Compact Framework provides the capability to start a separate process from your code, and stop it but it doesn’t give you more detailed information about what is running and what components are in use. Windows CE includes the optional ToolHelp component (present in all Windows Mobile versions). The InTheHand.Diagnostics namespace includes a number of classes for working with ToolHelp in a way which matches the full .NET Framework. The ProcessHelper class includes the GetProcesses() static method to return all running processes on the device. Extension methods GetModules() and GetThreads() return ProcessModule and ProcessThread collections for a specific Process.

    ProcessModule exposes name, size and version information for an individual module. ProcessThread exposes id, priority and elapsed processor time.

    Another way you might want to interrogate a process is to determine the memory usage. For your own process we’ve followed the Windows Phone model and so InTheHand.Phone.Info.DeviceExtendedProperties.ApplicationCurrentMemoryUsage

    provides you this useful figure as a strongly-typed property. It is also accessible from the GetValue method as you would on Windows Phone.

    Windows Phone

    Other than the built in set of tasks you can’t start any other applications or tell if they are running. You do have access to memory statistics though which are accessible from the Microsoft.Phone.Info.DeviceExtendedProperties class. A limitation here is that if you use this method to get the memory statistics your app will automatically get marked as requiring the ID_CAP_IDENTITY_DEVICE capability which it doesn’t actually need for these properties. We built a helper class for two reasons – firstly to remove this requirement and secondly to provide strongly-typed properties as an alternative to the GetValue implementation. On Windows Phone therefore you can use:-

    InTheHand.Phone.Info.DeviceExtendedProperties.ApplicationCurrentMemoryUsage

    InTheHand.Phone.Info.DeviceExtendedProperties.ApplicationPeakMemoryUsage

    and

    InTheHand.Phone.Info.DeviceExtendedProperties.DeviceTotalMemory

    Mobile In The Hand 7.0

    Mobile In The Hand is a suite of components for developing mobile applications across Microsoft’s various mobile and embedded operating systems. It will save you development time and allow you to share more code across different .NET project types.

  • Geocoding and Reverse Geocoding with Mobile In The Hand 7.0

    This is the first in a series of posts about Mobile In The Hand 7.0 which brings a collection of reusable components to the .NET Compact Framework. This latest version is updated to support all versions of Windows Mobile including Windows Embedded Handheld, All versions of Windows Embedded Compact (in it’s various names) from 4.1 to 7.0 and a set of companion libraries offering a subset of the functionality on Windows Phone 7.

    When the .NET Framework 4.0 was released it introduced a new namespace – System.Device.Location which provided a range of location features. Subsequently this was used as the model for Windows Phone’s APIs. One major whole in the Windows Phone implementation is that the CivicAddressResolver is not implemented and doesn’t return a result. Mobile In The Hand 7.0 comes to the rescue with a two pronged attack:-

    An InTheHand.Device.Location.GeoCoordinateWatcher for the .NET Compact Framework. This uses the GPS Intermediate driver present on all Windows Mobile 5.0 and later devices and available as a system component on Windows CE 6.0 and beyond. This is exposed with a familiar object model which matches that found in .NET 4.0 and Silverlight for Windows Phone.

    Secondly two new components are provided – BingCivicAddressResolver takes a GeoCoordinate and uses Bing Maps to resolve a CivicAddress object similar to the functionality available on desktop windows. Additionally as an extra feature the BingGeoCoordinateResolver allows you to resolve a GeoCoordinate from an address or partial address. Both of these classes are provided in the .NET Compact Framework and Silverlight for Windows Phone libraries which make up Mobile In The Hand 7.0. The Compact Framework version offers both Synchronous and Asynchronous calls, the Silverlight version just exposes the Asynchronous calls.

More Posts « Previous page - Next page »
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting