Posts Tagged‘application’

OAuth2 and C# Desktop Apps Don’t Seem To Get Along.

I hadn’t been in Visual Studio for a while now, mostly because I had given up on all of my side projects due to the amount of time they soaked up vs my desire to do better game reviews on here, requiring me to spend more time actually playing the games. I had come up with an idea for a game a while back and was really enjoying developing the concept in my head so I figured it would be good to code up a small application to get my head back in the game before I tackled something a little bit more difficult. One particular idea I had was a Soundcloud downloader/library manager as whilst there are other tools to do this job they’re  a little cumbersome and I figured it couldn’t be too difficult to whip it up in a days worth of coding.

How wrong I was.

OAuth2The Soundcloud API has a good amount of documentation about it and from what I could tell I would be able to get my stream using it. However since this wasn’t something that was publicly available I’d have to authenticate to the API first through their OAuth2 interface, something which I had done with other sites so I wasn’t too concerned that it would be a barrier. Of course the big difference between those other projects and this one was the fact that this application was going to be a desktop app and so I figured I was either going to have to do some trickery to get the token or manually step through the process in order to get authenticated.

After having a quick Google around it looked like the OAuth library I had used previously, DotNetOpenAuth, would probably be able to fit the bill and it didn’t take me long to find a couple examples that looked like they’d do the job. Even better I found an article that showed an example of the exact problem I was trying to solve, albeit using a different library to the one I was. Great, I thought, I’ll just marry up the examples and get myself going in no time and after a little bit of working around I was getting what appeared to be an auth token back. Strangely though I couldn’t access any resources using it, either through my application or directly through my browser (as I had been able to do in the past). Busting open Fiddler showed that I was getting 401 (unauthorized) errors back, indicating that the token I was providing wasn’t a viable option.

After digging around and looking at some various resources it appears that whilst the OAuth API might still be online it’s not the preferred way of accessing anything and, as far as I can tell, is mostly deprecated. No worries I’ll just hit up the OAuth2 API instead, figuring that it should be relatively simple to authenticate to it since DotNetOpenAuth now natively supports it. Try as I might to find a working example I just simply could not get it to work with Soundcloud’s API, not even using the sample application that DotNetOpenAuth provides. Trying to search for other, more simplistic examples left me empty handed, especially if I tried to search for a desktop application workflow.

I’m willing to admit that I probably missed something here but honestly the amount of code and complexity that appears to be required to handle the OAuth2 authentication process, even when you’re using a library, seems rather ludicrous. Apparently WinRT has it pretty easy but those are web pages masquerading as applications which are able to take advantage of their auth work flow, something which I was able to make work quite easily in the past. If someone knows of a better library or has an example of the OAuth2 process working with a desktop application in C# then I’d love to see it because I simply couldn’t find out how to do it, at least not after half a day of frustration.

I Will Never be Rid of my iPhone (Not for lack of trying though).

The date is fast approaching April and that means the Fringe Benefits Tax year is about to roll over. For most people this is a non-event unless you’re salary sacrificing a car but for contractors like me it means I can write off another phone and laptop device on tax, effectively getting them for half the market price. Whilst it’s not as good as it used to be (you were also able to depreciate them, making said devices basically free) there hasn’t been a year yet when I haven’t taken advantage of at least getting a new phone, and last year was the first when I purchased my Macbook Pro. So of course I’ve spent the last couple weeks looking through the available selection of phones and tablets with which to gorge myself upon and the more I look the more I get the feeling I won’t be able to leave my iPhone behind like I did with my other smart phones.

The tablet choice is pretty easy since I’m not particularly fond of the iPad (I don’t need another iDevice) and getting something like the Motorola Xoom would cover off my need for an Android device to code against. To have all current platforms covered then the smart phone choice (HA! See what I did there?) would be a Windows Phone 7 handset. Taking a look around I found a few pretty good deals on various handsets with contracts comparable to what I’m on now with tons of extra value. My handset of choice is the HTC Mozart which appears to be the cream of the current crop of WP7 handsets, anything else is just too far off on the horizon to be worth considering.

Of course whenever I’m contemplating a new phone I’ll always compare it to what I currently have to see if it fixes the things that bug me and whether or not it will be worth it. Whilst my 3GS is less than a year old it’s nipping on the feet of being 2 generations behind the current trend so any recent handset should beat it hands down. A quick look at the similarly priced handsets shows this to be true all of them bristling with bigger CPUs, more RAM and better dedicated graphics. Unfortunately however there’s one thing that all the other handsets I’ve been looking at don’t cover.

That unfortunate beast is the Apple App Store.

Despite the insane growth that Android has shown over the past year Apple is still the platform of choice for many early adopters and developers. It’s extremely rare for a company to attempt to launch a mobile application on anything but Apple first, simply because the user base tends much more towards that early adopter mindset of trying things out. Sure there are many examples of popular apps that made their debut on the Android markets (although none that I’m aware of for WP7) but when you compare them to the number of success Apple can count using its platform there’s really no contest. Couple that with the fact that despite Android’s runaway popularity the App store is still by far more profitable for developers looking to sell their wares and you’d really have to be crazy not to launch on their platform.

For me this presents an interesting conundrum. Whilst I was never going to sell my 3GS since it will make a good test bed for at least another year or two I do use it quite extensively to test out potential competitor’s applications. Since most of them launch on iPhone first this hasn’t been a big deal but with me planning to move to WP7 (or possibly Android) for my main handset I can’t help but feel that I’ll probably want to keep it on hand so that I can keep a close eye on the market. Sure I could just make a note to try an application later but many up and coming products are based around using them for a particular purpose, not booting them up occasionally to see the new features. Granted this is probably limited to social applications but any new product is almost guaranteed to have some kind of social bent baked in (heaven knows I tried to avoid it for the longest time with Lobaco).

The market could change and with the growth that Android is experiencing I may be singing a completely different tune a year from now. Still until the Android store starts pumping out billions of dollars to its developers I can’t see a future where any serious developer isn’t focused primarily on Apple first with Android planned down the line. For now I think I’ll stick with my plan of a WP7 phone and an Android tablet, keeping the gaggle of devices close at my side at all times so that I can test any app regardless of its platform. It’s the same line of thinking that lead me to buy every major console, although the Wii has only ever been used a couple times.

There’s an analogy in there somewhere 😉

Absence Makes The Heart Grow Fonder (or Not).

My time spent developing my passion project hasn’t been continuous since the time I first started working on it. The first iteration lasted about a month and was a mad rush to cobble something together to mark the momentous “milestone” of 100 blog posts. I then spent the next couple months experimenting with Silverlight managing to replicate and extend the base feature set out to a point where I felt I was making progress. I then went on a 6 week hiatus from developing Geon to work on The Plan which, whilst making me a decent sized profit, never turned out to be the ticket to freedom I had hoped it would be. After taking a month off after that and coming back to look at Geon I couldn’t help but think that I was going about things in all the wrong ways, and came up with a completely new design.

This, I’ve found, is a common trend for me. Unless I continually work on a project I’ll always end up questioning the idea until I end up wondering what the point of doing it in the first place was. Initially this was quite good as whilst the first few iterations of Geon showed solid progress they were in all honesty horrid applications. However it was devastating for overall progress as the paradigm shifts I underwent during these times of developmental absence meant that the new vision was wholly incompatible with the old and I could see no way other than starting anew to get them back in line again. This is why the first2 iterations didn’t have any form of user logins and the third was such a horrible process that I don’t blame anyone for signing up for it.

I had thought that short breaks were immune to this idea as I had often taken a weekend or two off when a family event called or I was starting to feel burned out. However I hadn’t had the chance to do much work on Lobaco over the past 2 weeks thanks to me being otherwise occupied and those little tendrils of other worldly perspective started to creep in. Maybe it was the booze fueled weekend where I had a list of 5 other potentially marketable ideas or maybe it was just me pining for another break but suddenly I felt like there was so many other things I should be doing than pursuing my almost 2 year old idea. I let myself think that I could take part of the weekend off to work on one of those ideas but for some reason I just kept working on Lobaco.

I’m not sure if it was my persistence or hitting the submit on my application to Y-Combinator that did it but instead of pursuing those ideas that had tempted me all week long I just fired up Xcode and started plugging away. Whilst not my most productive weekend ever I did manage to tick off 2 more features for the iPhone client, leaving about 3 to go before my deadline of the end of March. I think the combination of a solid code base (that has all those rudimentary things done so I don’t have to spend time researching them) and almost half a year of iOS development under my belt is enough to keep the momentum going, making sure I don’t give up on this version until it reaches 1.0.

I used to think that time away from coding was just as valuable as time spent in code but that doesn’t seem to be holding as true as it used to be. Sure my first breaks led to radical changes in my vision for the end product (and is responsible for the Lobaco that exists today) but once you hit that sweet spot time away can be quite destructive, especially if you’re as prone as I am to distraction by new ideas. Thankfully the last 6 months of momentum aren’t lost on me and 2 weeks away wasn’t enough to distract me from my end goal. It would have been to easy to start procrastinating again without realizing it.

The Killer Proprietary Cloud.

So I might be coming around to the whole cloud computing idea despite my history of being sceptical of the whole idea. Whilst I’ve yet to go any further than researching the possibilities the potential of the cloud to eliminate a lot of the problems encountered when scaling would mean a lot less time spent on those issues and more on developing a better product. However whilst the benefits of the cloud are potentially quite large there’s also the glaring issue of vendor dependency and lock in as no two cloud providers are the same nor is there any real standards around the whole cloud computing idea. This presents a very large problem for both cloud native services and those looking to migrate to the cloud platform as once you’ve made your choice you’re pretty much locked in unless you’re willing to pay for significant rework.

Right now my platform of choice is looking to be Windows Azure. Primarily this is because of the platform familiarity as whilst the cloud might be a whole new computing paradigm services built on the traditional Microsoft platform won’t have a hard time being migrated across. Additionally they’ve got a fantastic offer for MSDN subscribers, giving them a small instance and whole swath of other goodies to get them off the ground. This is good news for aspiring entrepreneurs like myself as Microsoft offers a free MSDN Premium subscription to start-ups (called BizSpark) who’ve been together for less than 3 years and less than $1 million in revenue. However as I was comparing this to the other cloud providers out there I noticed that no two were alike, in fact they were all at odds with each other.

Take the biggest cloud provider out there, Amazon’s EC2. Whilst the compute instances are pretty comparable since they’re just the operating system the other services (file storage, databases) are worlds away from each other and it’s not just the API calls that are different either. Amazon’s cloud offering is architecturally different from that of Microsofts, so much so that any code written for Azure will have to be wholly rewritten in order to function on their cloud. This means that when it comes time to move your service into the cloud you’ll have to make sure you trust the provider that you’re going to be going with. You could also double the entire budget and keep half of it in reserve should it ever come to that, but I doubt many people have that luxury.

Like the format wars that have raged for the past century such incompatibility between cloud providers only serves to harm the consumers of such services. Whilst I’m not suggesting the notion that there be one and only one cloud provider (corporations really can’t be trusted with monopolies and I’d hate to think what a government sanctioned cloud would look like) what’s missing from the current cloud environment is a level of interoperability that we’re so used to seeing in this Internet enabled age. The good news is that I’m not the only one to notice issues like this and there are several movements working towards an open set of standards for cloud operators to adopt. This not only provides the level of interoperability that’s currently lacking in the cloud world but would also give customers more confidence when working with smaller cloud operators, knowing that they wouldn’t be left high and dry should they fail.

Like any technology in its infancy cloud computing still has a ways to go before it can before it can be counted amongst its more mature predecessors. Still the idea has proven itself to be viable, usable and above all capable of delivering on some of the wild promises it made back when it was still called SaaS. With the d-day fast approaching for Lobaco I’ll soon be wandering into the cloud myself and I’m sure I’ll have much more to write about it when the time comes. For now though I’m happy to say that my previous outlook on the cloud was wrong, despite the problems I’ve cited here today.