As many of you readers probably know, I wrote a Podcast app called P | Cast. I did this in the early days of Windows Phone 8.0 because it lacked an internal podcast player (for most regions), and all the alternatives from the store weren’t working for me at that moment.
But then came Windows Phone 8.1, it included a podcast player, again. I thought this would be the death of my app. But it isn’t at least it isn’t for myself, I don’t like the internal podcast player that much. So I can of course expand P | Cast to become better, but one of the most requested features, modify playbackspeed, can’t be done on the Windows Phone 8.0 model. Time to port the P | Cast app to Windows Phone 8.1 Universal app. Not an easy task though.
Yes both User Interfaces are in Xaml, but there are significant differences, in the controls that are available and also their richness. I’m currently using the Telerik UI for Windows Phone controls. They work perfectly right now, but I can’t use them on an universal app, and their Telerik UI for Windows Universal isn’t as rich as their Windows Phone counter part yet. On the other the current xaml can probably be a good base to start with.
In the Windows Phone 8.0 timeframe, all you have is a Background Audio Agent. There were a lot little quirks in the events that are or aren’t called in the Background Audio Agent. I had to do a lot to make sure track progress could be saved. Hope we don’t have to worry about that anymore. Even using NamedEvents to make sure the BackgroundAudio could somehow communicate with the UI.
The background audio architecture has changed a lot. It changed so much actually that I’m sure I will have to redo all the audio code. But all will come with a very interesting feature: the ability to change the playbackrate. So in a new version we will finally be able to play podcasts at 1.5 speed or 2.0 speed if you would like to.
Because the sizes of podcasts can be very large I used the BackgroundTransferService to make sure the OS handles all the issues of resuming of transfers and even keep downloading if the app isn’t running in the foreground. Universal apps have a different API for handling Background Transfers which are very similar but have some differences in limitations it seems. I hope they can be started from a background task, which couldn’t be done on Windows Phone 8.0.
P | Cast includes a background agent which is responsible for syncing all podcast feeds and eventually clean up of played podcasts. When the phone is plugged in for charging an even more intense version of the background agent launches which will do background downloading of podcasts. Although the Background Task API is different for Universal apps, the concepts are similar. Just Run code on the background!
All meta-data of the podcasts is stored in a SQLite database. I know you have to do something different to actually use SQLite in the app, but I hope I can still use SQLite-Net library to access the database.Posted: Porting a Windows Phone 8.0 Silverlight app to Windows Phone 8.1 Universal app - Database / SQLite
Windows 8 app?
Yes the big question is of course, will there also be a Windows 8 app? Maybe there will be, there’s a lot of code that can be shared in Universal Apps. A new UI design will be required for a Windows 8 app of course. And every user would expect the Windows Phone and Windows apps to be in sync, always. That would require some additional thinking for me. Because I have no idea on how to do that, yet.
So I will write blogposts for each of the above mentioned things. I will explain what I needed to do to implement the different parts, and if possible if I could reuse code or not. If you have any tips for me, please share them in the comments.