Yesterday was a long day to London, up at 4.00am for a 6.00am train with Dan Harris to London. A slight delay on the train, and we arrived to start at the Windows Phone Camp hosted by Lost Boys International.
WOW! What a place to work, the building had a very industrial theme to it, with art on the walls but the most noticeable bit was the fridges of beer, water and coca cola with a sign above them “Welcome to to LBi, help yourself”. What a great start to the day.
After registering and being lead downstairs there was even more insight into the good life that some of our counterparts at LBi enjoy, the break-out area was filled with pool tables, ping-pong tables couches, coffee tables, and a bar, complimented with more industrial meets 60’s diner decor. How do these guys manage to go home?
The first session was an introduction from Microsoft UK evangelist, Mike Ormond. Of all of the sessions in the day, I must say, I found this to be the most useful. It explained the overall design and development process. We were given some stencils and a design pack to help with designing our first Windows Phone apps. It was great to understand the differences between Pivot and Panorama views in Windows Phone apps, from my initial contact with the templates that come with Microsoft Expression Blend and Microsoft Visual Studio 2010, this was one of my key questions – they hadn’t immediately appeared all that different to each other – but now I find myself quite easily differentiating between parts of apps that are using each, and understanding why.
The rest of the day was then broken into lecture style sessions, and opportunity to use the break-out area. I attended the Silverlight Toolkit session. It helped me understand how to implement transitions between screens/elements during page transition, and fundamentally how to navigate between screens (which hadn’t leapt out to me when first picking up Windows Phone development – just goes to show it’s worth coming along to some sort of training session/boot camp like this).
At lunch time there was an exciting announcement for the Windows Phone Camp attendees that there’s a Nokia Lumia 800 for each of us so that we can test our apps if we can send the details of our apps over to them. Fantastic! Inspiration or what? I’ve had a number of ideas on my list for a couple of months now, since getting my own Windows Phone (see my other posts for my experience with that). Now was the time to get started on putting one together based on what I’ve learnt.
I took a break to get to work and met the excellent founders of WindowsPhoneGeek.com. Very friendly people, and not only did they direct me to an excellent repository of Windows Phone development news and advice (their website of course), but after finding what I’d look for in a repository of useful tools, showed me what they have to offer on their website. It sounds like it fits my requirements of a great free software component repository – free (truly), and includes community rating so I get a good understanding of whether the component is the correct one to use.
Within the hour I’d made fantastic progress on my first Windows Phone application development, an app to monitor/manage the status of MyDigitalMedia’s Kentico customer’s websites. This is a common requirement, and this functionality is normally available via the Kentico CMS built in Site Manager, but that doesn’t render very well for mobile use, which is when I usually get most of my calls from my customers. That 5.00pm call after I’ve left the office, saying they can’t get to their website. And usually, my answer is, I’ll check in the next 30 minutes when I can fire up my laptop, connect the mobile broadband and get onto the site manager. What better way to quickly get an answer for my customer than to check the app… whilst they’re on hold! That’s customer service if you ask me.
My experience, being a .NET developer, I’m currently working with WPF & Silverlight, WCF, WF, WinForms, WebForms, Windows Services and Web Services, so I have a fairly wide set of skills… picking up Windows Phone Development has actually been really quite easy.
I don’t think if I’d dumped myself in the deep end with WPF and Silverlight over the last 12 months, getting to grips with XAML I’d have found it as easy to adopt as I have, and my recent change in behaviour to using Microsoft Expression for UI exclusively and Visual Studio 2010 for code exclusively has certainly made my application creation progress so quickly. Infact, within just 3 hours I had the Windows Phone components of my application complete. I’ve only got to develop/finish the web service now that will read the status information from Kentico, and update as necessary.
Back to the day, I attended an excellent session hosted by Pete Vickers of Appa Mundi, on how to get your app into shape for submission to the Marketplace, including a full walkthrough of both testing your applications, the tools that you can use to test your apps yourself, and the extensive testing that Microsoft will carry out to certify your application before publication to the Marketplace as well as the actual submission process. A both useful, and well presented session by Pete, to finish off the day.
Back out onto the streets, we had a few hours to see the Tower Bridge in the snow before heading back on the train, by which point we were all very knackered and struggling to keep our eyes open I think.
A very worthwhile day, and I’m now all excited about my first app development.
I remember about a year ago someone asking me why I bother developing websites, and end-to-end business solutions… they told me that phone apps are the easiest way to make money at the moment.
Whilst I still disagree with them, I can see opportunity to make some money out of developing Windows Phone apps for the marketplace, but the main thing is I enjoy developing the full end-to-end solution for our customers. Providing them with a full answer to their business problems, rather than just a small piece of the jigsaw. I see developing apps for the Windows Phone platform fitting into this, and providing me with more ways to deliver the solutions that my customers demand in more ways than ever.
OK, so I’ve had my Windows Phone 7.5 for 50 days now and although I got bored of blogging about it after a fortnight, I don’t think that reflects badly on the phone… how much can anyone REALLY write about a phone?
Anyway, it’s fair to say that I’ve not had any particularly bad experiences with my Windows Phone, and I’m still very pleased with the device.
Since my last post about my Windows Phone, I’ve found some great features, and found some disappointment with the manufacturer, but that’s not Microsoft’s fault.
So anyway the highs, I discovered a number of useful apps like Cardmobili. and Xbox Companion which lets me control my Xbox 360 from my handset. I’m more involved in what’s going on with my family on social networks on a daily basis, and I’m more on top of my e-mails than ever.
Tonight, I found some nice features that I felt worth blogging about. Recently my wife was involved in an RTA in our car (not her fault, and she wasn’t injured) but whilst the car’s at the body shop being repaired, they’ve given us a hire car… a ‘10 reg Megane with loads of extras.
I was pleased to see the compatibility with my Dell Venue Pro. A real bonus for business users/regular travellers. From pairing (which was easy). It offered to sync my phone book, and even share the pictures on my device. I found that it instantly knows when it’s connected to the bluetooth, and when I receive a text message it announces it over the car’s handsfree system, and allows me to voice command it to read it outloud, and even reply by voice. This is amazing.
As you might expect it allows me to play Spotify over bluetooth, via the car speakers too which makes for great music and no dodgy signal as you move between broadcasting regions.
The best part of all this, is that “it just works” – and anyone who knows me will know that I like systems (software, hardware, or both) that “just work” without requiring any technical knowledge or any great deal of work from the user. My Windows Phone and the in car sat nav/audio system in the Renault Megane fit nicely into this category.
Has anyone had this level of experience with other platforms? Voice command text messaging and everything? I know BlackBerry has ‘an app for that’ but does anything else have this functionality built in?
This week we’re creating our first Facebook application for one of our clients.
It sounds fairly reasonable to want to include the latest posts from your wall from your Facebook page on your own website, and until recently, that was something that was fairly easy to do as walls and pages had the option to “Get updates via RSS” which would give you an RSS feed that you can subscribe to.
That changed when Facebook introduced the Graph API and they have seemingly been phasing out the RSS feed since to the point that when you click the link on a page where it’s been disabled you’ll get a message instead saying that the service has been disabled.
This seems to make sense, as the Graph API is much more privacy conscious and this therefore prevents people’s wall posts if they’re not friends with sufficient rights, but just seems a pain for pages, which in my opinion are meant to be public.
Anyway, we’ve struggled through the process of creating our app, specifically with C# and ASP.NET to do something seemingly simple, so I thought it worth sharing for others, how you can do this here so that everyone else can benefit too. There are plenty of guides on how to access Facebook using PHP, Ruby, Python, and pretty much everything
Firstly, you need to include Facebook C# SDK in your project, if you’re using NuGet you can search ‘Facebook’ and you’ll find it quite easily, or run:
PM> Install-Package Facebook -Version 5.4.1.0
Otherwise it’s available on codeplex here: facebooksdk.codeplex.com
OK, once you’ve got it installed, and (I recommend) before you start writing any code there’s a few things that you need to do (and I think this information is what I’ve struggled the most to find – maybe it’s just me).
Disclaimer: What I’ve done here may not be the correct approach, but it works, and seems the easiest for me to understand and implement. Some other approaches require users to authenticate with facebook first which is not the desired result.
Visit:
http://developer.facebook.com/apps
This is the area for developers that allows you to manage any apps that you’ve created. You need to create a new one, this will give you some API keys etc. but ultimately allow you to create an “access_token”. This is the magic code that you need to be able to read wall posts.
Once you’ve created your new application, you’ll need to navigate to the Graph API Explorer. There are a number of ways to reach this, the first is a ‘Useful link’ that appears when you’re editing your applications settings on the previous page, or you can find it from the developer tools. Both of these links seem buried away to me, so here’s a quick link for you:
https://developers.facebook.com/tools/explorer
When you visit the page, you’ll see a test harness that lets you see the results when you can various parts of the Graph API. We’ll make proper use of this in a little while, but firstly, change the application from the drop down list in the top right hand corner to the one you just created.
You’ll notice that Access Token is blank (or if you’ve had problems previously, it may have a value which doesn’t have the right permissions).
Click the button to “Get Access Token”. You’ll see a dialog appear of which you need to select the following permissions:
From “User Data Permissions”:
From “Extended Permissions”:
Click “Get access token” and you’ll see the access token text box populated with your access token.
You’re supposedly able to do this from the Facebook C# SDK, but I couldn’t see any examples that didn’t involve user authentication in your website to do this, so I’ll say there’s an area for improvement here. Once you have the instructions above, I think this is quite quick and easy to do manually without the need to write code, so that’s my advice.
This approach allows the application that you’ve created to run as ‘you’, with access to ‘your’ wall. If you’re conscious about anyone that isn’t a friend potentially seeing the contents of your personal wall, you may want to create a new facebook account, exclusively for this purpose. In principle, as long as the user that you’re logged in as, when you generate the access token, can read from the wall that you want to display posts from, then you’ll be able to read them from your application.
Put the access token somewhere for reference, your web.config for example, and then we’re ready to start writing some code.
The Graph API, allows you t o do anything you want/need with Facebook via a structured URL. the response containing a JSON object(s).
You can use the Graph API Explorer to try various commands and view the output, in the context of your application and the permissions that you defined when you generated your access token.
You can find a comprehensive listing of methods that you can call in the Graph API documentation on the Facebook Developer portal.
For the purpose of reading wall posts, we’re going to use the format /{user_or_id}/feed. For example, the path for mydigitalmedia’s wall on our page would be /mydigitalmediaonline/feed.
You can try entering that path into the Graph API Explorer to view the results.
To extract the posts for a particular wall, you can use the following few lines of code:
Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(ConfigurationManager.AppSettings["app_token"].ToString());
//Get wall posts var result = (IDictionary<string, object>)client.Get(ConfigurationManager.AppSettings["page_id"].ToString() + "/feed");
var posts = result.Values.First();
If you’ve not used NuGet to include Facebook in your project, you’ll need to add a reference to the Facebook.dll as well.
The above will populate posts with a dictionary of posts, each consisting of a JSON string. From here, you simply need to parse the text however you like. I’m not going to blog about this here, as I think it’s a different topic (which I may cover separately another time), but some tips may be to use a JSONSerialiser to deserialise the script into objects, which is included through the Facebook SDK, though you can also use a javascript serialiser to do the same thing, as ultimately, JSON is javascript
Hopefully this post will be some help to others, and can save you the time it’s taken me in research finding how to access Facebook and the use the Graph API from C# and ASP.NET.
If you have any comments, or suggestions on how to do this better, please share them below for everyone’s benefit.