Posts

Simple WP7 Mango App for Background Tasks, Toast, and Tiles: Code Explanation

Image
This is a continuation of this post , explaining how the sample app works. Caution : This sample isn’t meant as an example of best patterns and practices. If you see something in the code you would never do, then don’t. Solution File Organization The app has three Visual Studio Projects: the app, the agent, and the shared code library between them. One of the great things about Mango is that now the built-in Visual Studio Unit test functionality is available. By separating out the meat of the work into the SampleShared project, I can also focus my unit testing there. SampleApp1 The app has a MainPage, a ViewModel, and the WMAppManifest.xml file modified to note my ExtendedTask of BackgroundServiceAgent. The Agent is extremely simple with a call to the shared library, an update to the Tile, and a call to pop up Toast. The meat of the work is in the SampleShared library. The AgentMgr manages the background agent : add, remove, find, run now. It is only called f...

A Simple WP7 Mango App for Background Tasks, Toast, and Tiles

Image
Download Binary and Code The .XAP binary and code solution are both available for download . The app uses a background process that does some work then updates the tile and pops up toast. The app and the agent talk to each other via an isolated storage file protected by a named mutex. The diagram below shows the pieces and how they work together. This is the app associated with this post . App/Agent Architecture The app and agent don’t actually talk to a web service as this is a sample but in a real world solution they both would. The app would do the heavy lifting. The agent would have a quick, light conversation with just enough information to update the tile and pop up toast with meaningful information. In this sample, you can configure the agent to run repetitively every minute, second, etc. This is usually done for debug/testing. In the usual release situation, the agent runs on the 30 minute cycle. Start the App Pin the App to the Start Screen Make...

Windows Azure Cache Tip: Use language change to refresh cache

Image
Several times using the Windows Azure Portal , the page has appeared to recycle correctly its 30 second refresh yet the process change I know reported success doesn’t show up. After a forum thread with a MS Support person, I learned to change the language setting at the top instead of log out and log in.   30 Second Refresh at the bottom left of the Browser Window     Change Language setting to refresh Portal Cache at the top right of the Browser Window

Reinstalling Purchased Windows Phone 7 Apps after Mango Update

I purchased Flux a while back (metro version) and it is my favorite RSS reader. When my phone updated to mango, Flux updated the day after. Flux has been rock solid but the mango version wouldn’t even get past the splash screen. While I could have tried rebooting the phone (turn off, take battery out, put battery back, and turn back on), I knew a fresh install would definitely fix the issue.   I uninstalled Flux then, no the phone, went to the Marketplace  and found it again and reinstalled. The interface didn’t say reinstall though, it said “buy.” This is completely misleading. Microsoft knows I purchased the app so I clicked on buy, knowing it really wasn’t a buy but instead a reinstall.   Find app in Marketplace . “Buy” app which is really just a reinstall. You aren’t charged again.

Windows Phone 7 and Windows Azure

Introduction This post will explain how Windows Phone 7 and Windows Azure relate to each other. This is in response to an email question I received over on my apps site. The person, apparently, had been assigned the task of “putting his rewards app on Azure.”   This post is a 100 level (introductory) explanation.   Client/Server Twenty years ago the client/server conversation was obvious with a physical client machine (perhaps a Windows version) connecting through a wire to a physical server. Usually these were in the same location or in some sort of private wide area network.  But they were just a client and a server.   Ten years ago the client/server conversation was a physical client machine connecting through a wire to a physical server that was not in the same building, probably not in the same state or country. But they were just a client and a server.   Since then, until Windows Phone and Azure, nothing really changed except the conne...

Windows Azure Phone Apps for Windows Phone 7

I’ve made two apps targeting Windows Azure developers, testers, and managers. If your company uses any Windows Azure products, you should take a look at the apps, WAZUp and WAZDash. WAZUp allows you to manage the Deployment status and WAZDash reports on recent service issues. If you would like to keep up with my Windows Azure apps, subscribe by RSS .

Ah, the joys of poor messages, brief documentation and faded memories!

Image
Today, I was at Hack Dev days in Vancouver, B.C. and enjoyed the group and the presentations. Two recent Uni-grads and I teamed up and proceeded to define a project and work away for most of the day.  We were using the TinEye.com API, specifically a collection of 10 million images from Flickr that they have in one of their libraries. We decided to create a Chrome Extension on the API (one of the other dev’s had done one of these recently).   It’s been 16 months since I have done any serious JavaScript/Ajax stuff, and that was (in hind-sight) unfortunately against the website where the pages were hosted…   The code that consumed most of the day… The code below should have been up and working in 15 minutes… < script type ="text/javascript"> var ApiUrl = 'http://piximilar-rw.hackdays.tineye.com/rest/' function myData() { var fd = new FormData(); fd.append( "method" , "color_search" );...