Follow Me on Instagram Subscribe via RSS Feed

WordPress UWP Starter Kit

October 18, 2016

Back in the days of Windows Phone 7, Chris Koenig (@chriskoenig) wrote a nice little starter kit for building a WordPress app that ran on Windows Phone 7. It used a custom plug-in for WordPress that created a couple of feeds on the blog to be consumed by the app. It was a great little example of how to get started building Windows Phone 7 apps. The project is still available on GitHub (https://github.com/ChrisKoenig/Windows-Phone-Starter-Kit-for-WordPress). A long while back I had a conversation with Chris about updating this project, he seemed more than happy to let me take the reins. (mental note: always be weary when someone is that excited about your help)

So I took a look at the project, rolled up my sleeves, and prepared for the 4 or 5 hours it would take me to migrate the app. HA!

Here is how things went. I went thru the app making some notes and coming up with a few ideas of what I wanted to do a little different. My first thought was, hey, I bet WordPress has some sort of API that I can use to pull data from and I can eliminate the custom plug-in. As luck would have it, there was. Perfect! This is going easier than I thought…

I guess no one ever thought about writing a nice little portable library to wrap the WordPress API. No worries, we can make one. Now all we need is a nice little library that handles XMLRPC communication in a portable library. Hmm, there isn’t one of those either. So, guess who now decides he “needs” to create libraries to address both of these needs? Yep. Oh the rabbit holes you will go down as a developer sometimes.

You can find both of these projects on GitHub and Nuget:

XMLRPC for Universal Apps

A client library for accessing XMLRPC servers from UWP apps.
Nuget
Github

WordPress for Universal Apps

A client library for accessing WordPress site via XMLRPC from UWP apps.
Nuget
Github

Now that we got that out of the way, it’s time we got back to the original “simple” port I was going to do. Well, after learning about all of the cool things the WordPress API could do, the list of features in the Starter Kit kept growing. To add to that, I wanted to throw in some adaptive design so that app would run on Windows Phone as well as the desktop. That meant it was time to call it, and start from File > New.

The result is a new WordPress UWP Starter Kit which can be found here: https://github.com/TonyChampion/wordpress.uwp.starter.kit

wordpress-screen-shot

Getting the Starter Kit up and running with your blog is a simple matter up updating App.xaml with your blog information. The WordPress API does require credentials for most operations, so you will need to supply a valid user account. The information you need is the url to your blog, username, password, and blog Id. In nearly all cases, your blog Id should be set to 1 unless you are running multiple blogs off of the same database.

wordpress-edit

The solution consists of 4 views: a home screen / dashboard, a category list, a list of posts filtered by category, and a post view page. Through the use of state triggers and adaptive design the app handles resizing fairly well. While this is definitely not a polished final project, if you are interested in building a WordPress app or just curious on how a data driven app could be built, go have a look at the Starter Kit on GitHub. I have a version for this blog that is being wrapped up and I will post here when it’s available.

If you do decide to build your own WordPress app, drop me a line. I’d love to see how the final product turns out!

Leave a Reply