Subscribe Twitter

Friday, 30 October 2015

Trouble creating an Apple Push Notification Certificate

Today we were updating our Apple push notification certificate as it was due to expire (why do they only last a year). We've done this many times before and know the process well; but for some reason today after deploying the updated certificate every call to create the PushSharp instance returned the following error:

The specified network password is not correct

We went through the standard process of repeating the creation / deployment of the certificate, then double / triple checking and then repeating the creation process again but nothing improved the situation - the same error message was returned all the time. We tried different passwords / double checked eveything in the Apple developer portal. We cleared the historic and new entries in the KeyChain, tried new .cer certificates / private keys, nothing resolved the issue.

As we'd exhausted every option we could think of, we just tried the process on another machine.....just to worked first time! At the current time we think the issue was caused by a particular machine. Now that we're able to send push notifications again we will have to investigate it further. We did have "show password" ticked when exporting to the P12 file, I've noticed when that is ticked that the password strength indicator no longer works, I wonder if there's an issue around that? If we get to the bottom of the issue then I'll post an update.

Sunday, 24 May 2015

Getting back into Android development

After learning both iOS and Android development about 18 months ago we've not really had many enhancements needed in our mobile applications, with any changes just needing our existing knowledge. In reality this has probably meant my knowledge has actually decayed; which is a shame given the challenge of intially learning mobile development we went through. To try and remedy this; as a side project I'm looking to rebuild our existing application from scratch with an updated UI. Our current application is built using Eclipse and has a standardised screen for all format which only works in portrait mode. So as part of this work I want to "improve" the UI so it makes use of the additional real estate of larger screens and landscape mode. I also want to see how Android studio works to see if it is worth porting the application across and making that our standard Android IDE.

It's always fun starting out with a new, empty project. Typically you do hope that everything will just work, which wasn't the case this time around. Opening the new project displayed 3 errors; the first two were that the project requires Java 7 to be installed and that it should be compiled against JDK7. As I already had Java 8 installed; I did a quick dig around (a Google search) and found the following Stack Overflow article. So updated the path and that resolved the first errors. The next error occurred when trying to view the activity; which failed with an error "java.lang.NoClassDefFoundError:$styleable". Again looking online I found this Stack Overflow article which solved the problem, for some reason the view wouldn't render when set to be the most recent API; backing it down sorted out the problems.

So now the project compiles and deploys to my device, let the fun begin.

Sunday, 6 April 2014

Thoughts on the Surface 2 Pro

I've recently been lucky enough to get a Surface 2 Pro to play with - the top of the range 8GB RAM, 256GB storage version. I'd been looking at the Surface 2 for a while, wanting to see what Windows 8 is like on a small touch screen device - I still think the surface could go either way, it's not getting the traction of other mobile devices / platforms and Windows 8 is certainly not without it's critics. Over the past couple of years I've owned Android devices, iPhones and iPads, a windows 8 mobile and now the surface 2 Pro. I can still remember being impressed with the iPad as it just worked, everything you wanted it to do it did quickly and well. Similarly I was really impressed with the UI on the Windows phone - the battery life was a little bit disappointing and it was frustrating that you had to remember to shut down all the apps to maximise the battery but UI really liked the UI and it seemed to take the concept of exposing social updates for your contacts that Android started to a new level. The Surface 2 Pro has impressed me, but for other reasons. Obviously the "Pro" part means it will run desktop applications, and it does that well - Visual Studio 2013 starts up in under 3 seconds - many factors faster than the parallels VM running on my work MBP (and that has 16GB, plus SSD, etc.). The touch keyboard, whilst stupidly expensive, is great - back lit and tactile, has a trackpad too. A nice feature is if you swing the cover all the way round the keyboard switches itself off so you don't have to worry about pressing any keys whilst holding it. What I've really liked is the stylus and one-note; it's the closet thing I've come to replacing a pen and paper notebook in meetings; in fact I think once I get a little bit more used to it, it will eventually replace the notebook. Battery life has also been really good; easily getting 4 or more hours without having to worry about plugging it in. It can get a bit hot when doing processing work and when the fan kicks in; it's not as quiet as you'd expect a mobile device to be. Windows 8.1 works really nicely on the touch screen too, switching between touch and the keyboard is natural and easy. I'm writing this article with the device on my lap, the keyboard sits well and the kick stand keeps the screen at a nice angle; it's replacing the laptop when I just have something quick to do but needing a bit more power / typing that would be comfortable on an iPad / phone. Eventually I want to see about getting a wireless keyboard/mouse and hook it up to a monitor to see if it can replace a windows laptop completely.

Tuesday, 7 January 2014

IPhone hangs when running from XCode

I've had this happen a couple of times now and the first time was a little worrying that I'd bricked my iPhone. Basically I was running an application on my phone via XCode and when rebuilding an updated version it failed with a "busy" error message. Stopping XCode and unconnecting my phone had no effect, the phone was stuck displaying the loading screen of the application and wouldn't respond to any key commands. To fix you have to hard reboot, holding the power and home button until the phone reboots - doesn't lose any of the data you have on your phone (a concern the first time I did it).

Wednesday, 1 January 2014

Looking forward to 2014

I'm just looking at my post from last year "looking forward to 2013"! I'm still in a hands-on development role, but now in a different company. Many of my goals for last year are still relevant for this year. Time management has to be right at the top of them; getting the right work/life balance whilst doing a job you love is always difficult; even more so when there is just so much new cool stuff you want to learn!

The delivery process is another key item for this year. Being in a pure software house, delivering working software promptly to clients is not just something to aim for but key to the success of the business. Whilst the 2 week sprints of scrum might not work, the short delivery cycles and early visibility have to be a good thing. Reducing the time and effort required to develop a working prototype of the screens / system is also something else to look to improve on.

On the technology front, I hope we are quickly proficient in developing and publishing iOS and Android applications; not just on phones but tablets as well. The cloud is also going to be quite important in 2014! So 2014 is shaping up to be a great year for learning new skills and languages. Personally I'd like to look at learning F# and at least one new database language (either a graph database or noSQL).

Review of 2013

2013 certainly didn't turn out as planned, the less said about the first half of the year the better; so moving on (which I did!) In the second half of the year I joined a company which has managed to get me excited about and enjoying programming again! It has been an insanely busy 7 months into which (as well as the normal .NET stuff) we've managed to cram learning to program iOS and Android (the later being more of a challenge for 2014. There was also a lot of ground work investing in new processes and systems and preparing us and the business for the coming challenges in the next couple of years. There's also been the odd bit of specification work! I managed to get along to a few Brighton ALT.NET sessions (something I'd not managed or felt like for a while) and enjoyed going to Worthing Digital evenings through out the year.

I'm looking forward to 2014, I finished 2012 trying to be optimistic about 2013 - I'm finishing 2013 feeling and believing that there is load to be optimistic about in 2014!

Monday, 8 April 2013

How to use NUnit Assert functionality in MS Tests

Today I realised that I'd forgotten how spoilt I am using Resharper and dotCover to run my unit tests. Put another way I'd forgotten how badly Visual Studio plays with any other unit test frameworks other than MS Test! I'm used to and really like the fluent API style of NUnit's Assert.That(...) syntax so having to fall back to MS Test always feels like a step back. If you ever find yourself in a situation where you can only run MS Tests, but want to use NUnit functionality you can easily do this just by using aliases on the NUnit "using" statements.

The following "using" code block facilitates this - you will be able to decorate your unit test classes with MS Test attributes so they can be picked up and run by Visual Studio whilst using NUnit functionality.

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Assert = NUnit.Framework.Assert;
using Is = NUnit.Framework.Is;