Dmitry Lyalin's Applications for Windows Phone 7

Latest

ApplicationBar Errors–Dynamically adding buttons

Recently I ran into two errors around code I was writing to dynamically add buttons into the ApplicationBar. My application is targeted to Windows Phone 7.0 (NoDo) but my development tools are Mango Beta 2.

What I was trying to accomplish is add a ApplicationBarIconButton into my Main.xaml’s (XAML created) ApplicationBar, sounds simple right?

To do this I created the button at runtime and tried to add it into the “buttons” collection by calling .Add(). When I did this got the error below:

System.ArgumentException was unhandled
  Message=This list does not support that type

  StackTrace:
      at Microsoft.Phone.Shell.ApplicationBarItemList`1.System.Collections.IList.Add(Object value)

I thought maybe when this code executed mattered, so I tried it from both the Constructor of Main.xaml and the Loaded event, didn’t make a difference.

Next after asking around my peers and playing around with the API we discovered that NOT setting the Click handler until AFTER I add the button into the ApplicationBar avoided this error, crazy but it works.

Here what works:

Uri shareUriButton = new Uri("Images/Buttons/appbar.share.rest.png", UriKind.Relative);

ApplicationBarIconButton shareButton = new ApplicationBarIconButton(shareUriButton);
shareButton.Text = "Share";
shareButton.IsEnabled = true;
this.ApplicationBar.Buttons.Add(shareButton);
shareButton.Click += new EventHandler(buttonShare_Click);

Even though this resolved my immediate problem I decided to play around with the API some more and tried to add a button without setting the IconUri first and got another vague error, easy enough to avoid but I wanted it to be a searchable issue, here is the error you get:

System.ArgumentNullException was unhandled
Message=Cannot clear the icon while in a list
Parameter name: value

  StackTrace:
       at Microsoft.Phone.Shell.ApplicationBarItemContainer.set_IconUri(Uri value)
       at Microsoft.Phone.Shell.ApplicationBarIconButtonContainer.UpdateProperties(Object sender, BoolEventArgs args)
       at Microsoft.Phone.Shell.ApplicationBarItemContainer.BeginAttachToAppBar()
       at Microsoft.Phone.Shell.ApplicationBarIconButtonContainer.BeginAttachToAppBar()
       at Microsoft.Phone.Shell.ApplicationBarItemList`1.Insert(Int32 index, IApplicationBarIconButton item)
       at Microsoft.Phone.Shell.ApplicationBarItemList`1.Add(IApplicationBarIconButton item)
       at Microsoft.Phone.Shell.ApplicationBarItemList`1.System.Collections.IList.Add(Object value)

Recap

So to recap when adding an ApplicationBarIconButton into the ApplicationBar make sure to:

  • Specify a valid IconUri BEFORE you add the button into the ApplicationBar’s buttons collection
  • Set the “Click” event handler AFTER you add it to the ApplicationBar’s buttons collection

Hope this helps someone. I don’t know if this is an old issue or a new issue, this could perhaps even be fixed in the final version of the Mango developers tools but if not then your answer how to work around the problem is above.

Update (8.31.2011)

MSDN has been updated thanks to our talented technical writer contractor Nicole McAllister, so check out the official post that confirms the above solution to the problem:

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

Nicole didn’t just update MSDN, but it was her idea that led to the solution originally! So once again huge thanks for Nicole for helping me backfill MSDN for various missing pieces of documentation.

TWiT v1.8 Released to Marketplace

SplashScreenImage

I am once again happy to report that the TWiT app for Windows Phone 7 has been updated and is now available in the Marketplace in v1.8.

(v1.7 was also released one day before v1.8 therefore this blog post covers the  release notes for both versions)

The goal of these rapid release is to focus on bug fixes, performance improvements and overall application stability. After perhaps one or two more release I will be shifting my focus almost exclusively to the Mango (Windows Phone 7.5) version of the app to be released later this fall (4th quarter, 2011)

v1.7 & v1.8 Changes/Fixes include:

  • During audio/video playback I have added back an improved version of the slider for seeking to a specific position with the podcast (by popular demand)
  • Some people were experiencing problems playing video versions of TWiT shows which should now be mostly resolved (see note below for some more detail)
  • Included some performance improvements that should make certain parts of the application “snappier” and allow for quicker resume after tombstoning
  • Added new TWiT network show “Ham Nation” and a few other tweaks/fixes to the show data
  • Removed the last Panorama tab “More” and instead added a Panorama-wide “…” menu with most of the same options
  • Added a “Rate this App” link in the “…” Panorama Menu (Please rate this app and support us!)
  • Removed “Featured Shows” feature as it was not used often (based on user feedback)
  • Live playback now works on app resume from tombstoning (possibly broken in v1.6)
  • New splash screen graphic (as displayed above)
  • Various other bug fixes in various parts of the app including the media player
  • Fixed the spelling of “Calendar”

Video playback notes:

As stated above video playback has had some bug fixes but there might still be issues caused by things such as:

  • Problems with your phones connection to the Internet. Video playback requires a more stable and stronger connection then audio which tends to work even during a weak connection to the Internet
  • New TWiT shows often get published with the audio content first and the video isn’t available right away, so you cannot play the video and will get an error if you try. During those times playing audio will likely work
  • Live video feed is still not available to me in the platform

Technical Notes #WP7DEV:

  • Behind the scenes im also happy to be moving the application to AgFx caching framework for all data loading/caching. This is an EXCELLENT framework for Windows Phone 7 and makes working in a tombstoning oriented data model much easier
  • I have updated to the latest version of the Microsoft Ad Control as they released various bug fixes and improvements
  • I am using the Mango version of the developer tools to makes changes to this app in 7.0 mode, which is working great

TWiT WP7 App Live Tile featured at TechEd US 2011

During the recent TechEd 2011 US event there was a pretty cool image being shown off where a bunch of WP7 application Live Tiles were featured in action.

My TWiT app was in that list and damn this wall looked great, check out a screenshot of it below and see if you can spot the TWiT app :).

Live Tile Wall – TechEd US 2011

Live Tile Wall TechEd 2011

Paul Thurrott: PocketTech

PaulApp_Marketplace_200x200

I am very happy to announce the release of Paul Thurrott’s official app for Windows Phone 7 which I built for Penton Media. The app is live in the Marketplace as of Saturday and can be yours today for $1.99, simply search for “Paul Thurrott” to find it.

Note: all proceeds go to Penton Media who hired me to build this application

wp7_152x50_blue

v1.0 Features include:

  • Read most recent articles from WinSupersite, WinSupersite Blog and Windows IT Pro
  • Read the latest posts to his Windows Phone blog
  • See Exclusive content generated for his mobile apps (interesting short-form posts and/or links, similar to Twitter)
  • Listen to his Windows Weekly Podcast from TWiT

001_Featured004_Exclusive008_ArticleView_FromPhone

While I don’t control this application (it is built for Penton Media) I am optimistic that its features will continue to expand in the future and I for one have many ideas.

Please send all feedback, questions and bugs to Penton directly by emailing paulwp7apps@penton.com

So if you’re a fan of Paul or simply want a great source of news around the Microsoft technology world then go buy the app from Marketplace!

Improved TWiT App Tile

My TWiT Windows Phone 7 application has a feature that many people (including myself) like which shows the shows which most recently published their new episodes in the app tile and auto updates every hour.

Today I am happy to announce a small enhancement to this Tile feature which changes how many shows it can display by double the number to four.

Here is what you should now see:
twitShellImage
I really hope everyone likes this change and remember you can make suggestion and vote on other peoples suggestions over in the new UserVoice site I setup for the TWiT app, found here: http://twitwp7.uservoice.com/

Thank you as always for everyone’s support.

Help make TWiT for #WP7 Better–UserVoice

uservoice-logo

While the TWiT App for Windows Phone 7 is built by one person, its feature priority truly has been in the hands of the users since the start. Thanks to numerous friend who tested the application in its early stages, my own use of the app on an almost daily basis and the emails I’ve received over the last year has all impacted what features and bugs I worked on.

Recently though I decided to setup a more formal way for people to submit feedback and after some research into my options UserVoice seems to be the best approach. So without further ado here is the official TWiT app UserVoice forum: https://twitwp7.uservoice.com

I look forward to see how well this works and learn even more about what features YOU the users want and what bugs drive you crazy. Your voice is heard by me and I strive to make this app better for everyone.

TWiT v1.6 Released to Marketplace!

I am happy to announce that TWiT update v1.6 has been approved for release and is now being published in the Marketplace.

This releases fixes some issues introduced by update v1.5, below is a list of things that I fixed.

Summary of Fixes

  • Live Audio Playback Fixed: Once again Live Audio playback should work
  • Episode List Loading-time Improvements: Fixed an issue where the show episode page would load multiple times behind the scenes due to a bug causing a delay in loading the episodes list. While this does not fix all loading issues with the episodes list it should at least make things better
  • Error Information Improvements: When an error occurs and the user agrees to send me the “Exception” detail for diagnosis it will include the version number of the app; this will greatly help me debug future issues
  • Other Fixes: Behind the scenes I have fixed some other issues that could at times cause errors so the app should be more stable

Known Issues in v1.6

Unfortunately not every issues is resolved by update 1.6, there are still issues with as listed below:

  • Playing back episodes that were in-progress when you had version 1.4 or earlier installed – I cannot fix this but in the future hope to avoid it from happening again
  • The word “Calendar” is misspelled on the Live Audio panorama page – I will fix this in version v1.7
  • Episode list in the show page is still a bit slow to load and laggy to use – I will attempt to improve this in version v1.7 and really hope to fix it this time
  • Some new shows are still not correctly listed. This can even cause playback issues so I’m looking to address this in v1.7
  • Some shows names have been changed and this is not properly updated – Should be fixed in version 1.7
  • Paul Thurrott’s Twitter is not properly listed in the application – Should be fixed in version 1.7
  • A few other crashes that happen occasionally it seems though I have been unable to reproduce all of them.(please keep those error reports coming and add detail when possible)

What about a “Paid Version” without Ads?

Also I have heard “loud and clear” that people want an ad-free paid version of the app. I hope to release this soon once a few more bugs are resolved.

This has not happened yet for one simple reason; I just don’t believe in charging people for an application until I’m happy that all the core features work as expected. I do appreciate everyone’s patience on this matter and I’m working hard to get this ready for you.

Closing

Thanks again for everyone who reported issues, please continue to send me errors and feedback as I do read every email I get, though I cannot always respond personally.

TWiT 1.5–Known Issues

Unfortunately the v1.5 release of the TWiT Windows Phone 7 application did not go as well as hoped, a few bad bugs sneaked by my best attempt at testing the update, here is the list:

Known Issues & Status (Updated 4/21/2011)

Live Audio Playback Broken

  • Details: Live audio does not work – errors out when you try to start playing the live feed and app crashes
  • Status: This has been fixed in update 1.6 and already submitted to Marketplace on 4/19. I hope to see it released this week if it passes certification

Resuming Shows from before update Crash Application

  • Details: This is a very frustrating issue and I caused it with a large code refactoring (something that really needed to happen). I simply didn’t anticipate it but should have. This is also something I simply didn’t have a good way to test for as it required data from the v1.4 version of the application to replicate the bug.
  • Status: Unfortunately there is no way for me to restore the old shows, they simply will never play and I’m very sorry. Update 1.7 will at least attempt to prevent the application from crashing if you try to play a “broken” old show
  • Note: New shows you start listening to in update 1.5 or later should NOT be impacted and are expected to both play and resume as they did before the update

Show Page – Episode list loading slowly

  • When you click on a show detail page the episode list above the advertisement loads slowly (Example: you click on Windows Weekly logo to see the show details)
  • Status: I think I found the root cause of this issue and it should be patched in update v1.6 – Please let me know if you have any issues after the next patch

Other Misc. Issues

  • Episode title in media player is not wrapping and therefore is being cutoff. (This has been fixed in update 1.6)

Closing Comments

Big thank you as always for everyone’s patience and feedback about the issues – I am working hard on ensuring future updates go more smoothly and add features people are requesting.

If you know of more issues not listed here or have suggestions, email them to twitwp7@lyalin.com as I do actively monitor this email address (even if I don’t respond to every email sent in).

TWiT v1.5 Released!

image

I am very happy to announce that after a long pause between updates the TWiT.tv Windows Phone 7 App has finally hit v1.5 and that update is now live on the Marketplace.

Big Change – Added Advertisements

Why? To help fund this applications development going forward

The application now includes advertisements. You will find a small and I really hope un-intrusive ads on the Episode Detail and Show Episodes list pages. (using the Microsoft ad platform for WP7)

This change is a big one for me and one I wanted to avoid. My goal to create the TWiT App was to create a first-class experience that everyone could enjoy and in many ways I think I accomplished it. Unfortunately my hopes of “donation supported” applications or something I could “figure out how to fund” have fallen short of expectations. Therefore I am forced to try something different and this is the first step.

Ironically the TWiT podcast network itself started with a donation model that later led to an advertisement supported model, I guess some things never change – donations just don’t seem to work in most cases.

Hate Advertisement? No worries, a paid version is coming

In the near future you will also see a paid version released without advertisements, I know many want this version and will see it go live shortly.

Long-term Plan? Not really, not yet at least

Long-term I have not made all the decisions yet on “what features” will be included in which version, nor do I think I have optimized the advertisement placement and other factors. Much will be figured out this year so stay tuned.

Big THANK YOU to those who did donate

In closing I want to also say a big THANK YOU to the 11 people who did donate to support the application. Unfortunately after 12,000 downloads its too small of a number to sustain development without the changes noted above.

New Features & Changes

Removed Items

  • Donation links and screen have been removed – this application no longer requires or accepts donations for the project
  • The audio/video media player no longer supports dragging a slider to switch positions (see more info below in “Media Player Changes”

New Features

  • Added a Live Calendar that is a web view of the TWiT Google calendar listing upcoming live shows. This is just a temporary solution and I hope to integrate this further into the interface as we head towards Mango release of the platform
  • Added new or renamed network shows such as the “Mostly Photo” netcast

Panorama Changes

  • New Panorama section added dedicated to Live Audio playback / Calendar
  • Random featured shows are now displayed in the shows Panorama section (instead of the Highlights section)
  • Show list is no longer a horizontal scrolling list – instead it’s a vertical list that makes it easier to find all the shows available

Media Player Changes

  • The audio/video media player no longer supports dragging a slider to switch positions – this proved to be too buggy and prone to errors though I’m looking to get it back in. For now you will have a button to seek Left or Right though this experience is also not ideal at this time.
  • Increased buffering time to 15 seconds minimum to try and avoid a scenario where audio would “start/stop” in a very annoying fashion during moments of poor network data strength
  • Buffering related text should no longer get stuck on the screen indefinitely during video or audio playback as it happened under certain conditions

Bug Fixes

  • The application should no longer crash when you press the back button to the episode description view when the video is loading
  • Due to the (bad) design of the old horizontal show list some of the network shows were hard to find, this is now addressed by the vertical show list mentioned above

Other bugs have been fixed but its hard to have an exact list with the amount of changes I made – in general I just hope the application will get more stable over the coming few releases

Thank you to Silicon Valley WP7 Meet-up Group

I wanted to thank the Silicon Valley Windows Phone7 Meet-up Group for allow me to present to them the same talk I gave in NYC on Building the TWIT App for Windows Phone 7. I love talking about this platform and happy for every chance I get.

You can find the slides I used here (slightly updated since the last time)

http://cid-c6b45be43711d8b8.office-df.live.com/self.aspx/Public/CA%5E_UG%5E_BuildingTWiTApp%5E_WP7%5E_Start-To-End.pptx