Switching to Android

Its been a week since I walked into a Phones4u shop as a avid Apple fan, and massive iPhone fan/user. An hour later I walked out a changed man, carrying a Android based phone, the Motorola X, running Android KitKat.

A year ago I received a Nexus 7 as a Christmas Gift and was very impressed in how far Google had brought Android along, and given the amount of time I was using my Nexus 7 I was getting more and more drawn to the Android OS.

For the past couple of months I have been thinking about my options for my next phone, knowing I was due an upgrade I started to think could I ditch the iPhone ecosystem and move over to the "other side"? The more I thought about it the more I realised that it could be a viable option. A lot of the apps I use on a regular basis are either by Google, or not by Apple. I took a look at my iPhone and started going through all the apps I had installed and which ones I used the most, Gmail, Google Maps, Hangouts, Twitter, Foursquare, Instagram, Phone, Messaging (iMessage), and a good few installed from the App Store.

Turns out that I am not using a majority of the default Apple apps when using my phone, and I do use my phone an awful lot. So it begin to seem like I could make the switch easy enough, the only BIG draw back I had, was that all of my family are using iPhones and they all use iMessage, and we even have a lot of group chat as a family. This alone was not help my decision to switch as I would loose a good communication channel between my family, who between the five of us are split across three countries, and regular travel.

So, after walking out of the phone shop with an Android based phone in my pocket, I was still not 100% convinced I had made the right choice. It's been just over 7 days since then and I am 100% convinced that it was the correct choice for me. Yes I am going to miss the group chat with my family, but all the other stuff I do on my phone out ways this one con.

After spending the first couple of days playing around with the new phone, and looking at all the difference features, installing my regular apps and just getting used to having Android on my phone I have fallen in love with my phone again.
You may of seen my post about "A Fresh iPhone" where I talk about feeling like the Apple iOS going stale. I have been on iOS7 since it's official release, and it was still lacking something, and this move to Android has been a breathe of fresh air.

The move to Android was helped by a year of using a Nexus 7, so one could say I actually was always comparing the two for the past 12 months, which technically I was in the back of my mind, and I think having that ability has been amazing, and actually help me make the call to ditch an iPhone for an Android phone.

Code Conventions

Recently I put together a set of markdown files for the few different web languages I write a lot of code in, these being HTML, CSS (Sass), JavaScript/jQuery, and CFML. I have these located on my GitHub page under a repository named Conventions

I put together the set of conventions for a few different reason. I thought someone might be able to get something from it, or for when I release open source code/ library's I can point people to them, the final reason being I can show people the method to my madness if they every cross my code paths.

While the conventions documents are not 100% full proof I will be continuing to add and tweak little items as I can continue to write more code and find my rhythm.
A lot of what is already documented is straight from how I write my code at the moment, if I see a pattern in the way I write certain parts of code I document it as a convention, simple as that. I don’t go out of my way to write a convention to change the way I code, I write the conventions on the way I am coding.

I feel conventions should not be something you force, obviously this can break down within a team environment, but that’s a whole different story. While the conventions I have documented do contain some ways of writing faster/better code, a lot of what I have documented is personal preference and more style based.

A simple example of one of my conventions, spacing around if statements:

if ( x ) {

Instead of

if(x)

When I grow up I want to be...

Whilst out for a Sunday walk with my son, he comes out with: When I grow up I want to be a teacher. Now he is only 5 and I imagine he will change his mind within the next 20 years... heck he will probably change his mind this year, or even within the month.

After he mentioned this to me, I tried to remember my earliest memory of what I wanted to be when I grew up. While I can not remember the earliest, I do remember a few of the jobs I considered.

First I wanted to be a mechanic, just like my dad. Then I wanted to be a professional rugby player because I played for a local team and then a professional cyclist as I was actually pretty good in my teenage years. It was around this time I got involved with the internet and making websites and also took an interest in photography too.

Turns out that I was correct for two of them, having worked for three years as a rally technician. I have been making websites for over ten years and employed as a web developer for the last three and a half years.

I am looking forward to seeing how my little boy grows up and how he change his mind. I am really looking forward to seeing what he we will be when he grows up. I hope I have some influence upon his decision but I want him to decided for himself and I will 100% support his choice.

Following my gut with Hill Valleu

If you have read my previous entry or perhaps follow me on Twitter, you may know that I am currently working on a web app, Hill Valleu. Yes, the last update was a few months ago, but a lot has changed since then.

When I published that post, I was using a working copy of Hill Valleu in a beta stage. Within a week of launching it I had some friends and colleagues using the app. Feedback was good and the users seemed to like it. I knew a few items were missing and the limited users who were in all confirmed this by suggesting a few of the same enhancements. So, I got to work on these and within a couple of days I had a few new features launched to the small user base.

Everything seemed to be going great. A few app users, no major issues...so I planned to give it a couple of weeks before getting more users into the system and then a few more weeks before launching it for real. But over this period of time I noticed that my own usage of the app had dropped. This was not a good sign, when an app I was supposed to be building for myself was was not even being used by me...and it turned out the beta users had pretty much all stopped using it.

Why?

Now that's a good question. I am not sure why others stopped using. A few said they were using other services, which is fair enough. I am trying to break into a crowded market - hard going if you do the basics, but miss a lot of features of the bigger apps.

The main question I needed to answer waswhy did I stop using a service I built to fill a need for myself?

After sitting down and working out the issue, I discovered the problem was I had stopped building the app for myself and started building it based on what others said they wanted. To get my heart back into the project, I made a big decision to go back to the root of why I started out on this path to begin with. To fill my need, and build something I would use everyday.

I deleted all the content and beta user data and started afresh. My next plan was to get back to where I wanted to be to start with. I ripped out a load of code, reworked the design and features to drastically reduce the complexity I had built in.

Within the week I had a skelton app but up online and I have been using it everyday since, slowly tweaking little bits here and there, adding couple new little enhancments, and have a list of the basic feature set I want in the app before I let anyone else in to the system.

To see the current state and to get a preview of the all new reworked Hill Valleu, go over to the website - and if you like what you see and would like to hear when I launch the app drop your email in the box at the bottom of the page.

Authorization header with Ajax requests in local development using Google Chrome

This past week at work we've been working with an API to fetch data for a mobile application using PhoneGap that needs to send an authorization header for each request, and if you have ever tried to play with an API that requires you to send an Authorization header chances are you have not being able to from a web application. If you have been able to send such a header this means the API you are using has enabled CORS support.

As you may or may not know, using PhoneGap you are able to build your application using web technologies (HTML,CSS and JavaScript), and then PhoneGap packages it up in a native like app.

So as you are building the application using web technologies this gives you the ability to develop the application just like you would develop a website. You can use your web browser to quickly browse/ test as you are working, this saving time having to build the app to the device or run the emulator each time.

As mentioned earlier with local development you may not be able to access the API if you need send certain headers with each request.

This is where Chrome Apps come you rescue. Due to the nature of Chrome and it not allowing local requests to send the required headers, you can use a Chrome App to do so, I am not 100% sure on why this is the case but it's a great little feature.

So first off you need to set up a couple of files in your working folder, so say you have the following folder structure for your app

  • index.html
  • js
    • app.js
  • css
    • app.css

That's just a basic outline, what we need is to add to files to the same level as your index.html file. These being manifest.json and background.js, these are the files Chrome needs for an App. For what to put in the files see below. You can copy paste these if you so wish.

One thing to note. See the Permissions array inside the manifest.json this the URL to the website you are making API calls to that require the Authorization headers. In this example I am using a local IP address, as we are actually working with a copy of the web application. You can change this to the URL of the API.

manifest.json

{
 "name": "Local Dev",
  "version": "0.1.0",
  "manifest_version": 2,
  "description": "Local API Stuff",
  "permissions": [
    "http://10.0.0.1/"
  ],
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  }
}

background.js

chrome.app.runtime.onLaunched.addListener(function() {
  chrome.app.window.create('index.html', {
    'bounds': {
      'width': 700,
      'height': 600
    }
  });
});

Now you have these two files inside of your working directory, you now need to load this directory as an unpacked extension. In Chrome go to Extension, which is located in the Menu > Tools > Extensions. Make sure you are in developer mode (make sure the Developer Mode checkbox is ticked). This will give you some buttons. You want to click on the the Load unpacked extension button. Find the folder from earlier where we put the two files manifest.json and background.js, and click OK. This will give you an extension named Local Dev (if you did not rename the name from the manifest above).

Now we have the working folder loaded as a Google Extension. Open a new tab, and click Apps in top left of the new tab, on the bookmarks bar, or you can navigate to it using the following address chrome://apps/. You will see your application listed there, it's the one without an image.

If you click on it you will get a popup window (700x600px - You can change this in your background.js file) containing your application.

Now you can work on you application like normal, and you can also use Chrome Dev Tools from this window. Use Inspect Element from the right click menu not Inspect background page

One thing to note, when ever making changes to your code and you need to refresh the app, right click in the pop up and choose Reload app.

Welcome Hill Valleu

Chrome Settings - Overrides

Welcome, hillvall.eu - A simple RSS reader, nothing more, nothing less.

Back in April, when Google announced they where shutting down Goole Reader, I wrote a blog post on my thoughts and how it would affect me as I was a big user of Google Reader. Being a developer I am in a position to be able to create my own solution, and that is exactly what I have been doing. I did have a working version I was using before Google shut down their service, and I mentioned this to a few people, and they showed interest.

At the beginning I was writing the system for myself, the first version I had and had started to use was very limited, no user accounts, feed management or folders. Scroll forward a few months and after the interest I decided I would rewrite the app to work with multiple users with the intention of getting it online so others can use. I've never set a deadline for when I wanted to get an early alpha/beta out, and the past few weeks I've been working very hard on it to try and get it to a alpha release. For a few weeks I felt it going a bit stale and I starting to question all the time and effort I had been putting in, but I've got over that stage and progress is moving along very well, and I am hoping within the week I'll have actual users apart from myself within the app.

So, if you are interested in getting on the list for early access then head over to hillvall.eu and pop your email in the form. If you would like to keep up to date on news, and details of hillvall.eu, hen I have set up a blog for the app at blog.hillvall.eu

Start of School

On Monday by little baby boy starts his first day of proper school (P1 as we live in Scotland), it’s so hard to believe he is nearing five years old and in three weeks time he will be in School for six hours a day. (They give them three weeks to break into the routine of proper school).

I am finding it quite hard to believe it’s happening, I look at him and remember all the little memories so far, from the day he was born up until the current day, and I find it hard that nearly five years has passed as it does not feel like it was that long ago that we welcomed him into the world.

Just last weekend me and my wife were in the kitchen putting his name in all his different school items, it felt really wired to be doing it but also amazing to be doing it as my little boy is growing up. The best part is he is very excited for school, while me and my wife are very nervous. I just hope he has a great time and fits in with all the other kids, and does not get picked on.

More Loss

Just over two months from my previous loss, I get a phone call with more bad news. This loss was rather strange compared to the previous, completely out of the blue. Me and my wife where on our way to a wedding, which was the start of a few days away, where we would end up meeting with my parents for a weekend break. So when my phone rang around lunch time, just as we had arrived early at the church, nothing was out of the ordinary, the caller was my father, so everything seemed fine, and the last thing I would of expected him to tell me was that my Nan (my mothers, mother) had been found dead in her home.

It has all been a bit strange for me since hearing my dad tell me the news. Not strange in a way that I’ve not been able to get on with stuff, but more strange in a way that I don’t think it has hit me like it probably should have. In bad situations I always try and put on brave face, mainly for the people around me, but this time it was different, I can not put my finger on it.
It’s not as if I wasn’t close with my Nan, but over the last 5 or so years I can probably count on two (possible one) hand(s) the amount of times I had visited/seen her, it’s strange as I’ve been in the town where she lived quite a lot, visiting family, but I always go to my fathers mothers. Which is also the town our family call home.
This town is where I spent the first 9 years of my life, and where both sides of my family all still live. This 9 or so years where all spent within a few doors of my nan as we lived on the same street as her, even when we moved away my mum would bring her to own house for a week once or twice a year for a little holiday.

But, for some strange reason the phone call from my dad did not have a massive impact on me, I felt something but it was not the same feeling I’ve felt before, or with my previous loss. I wasn’t upset in a way I need to cry or completely do something to take my mind of it, neither did I cry, and too be honest I’ve not cried once since hearing the news, even with spending a few hours our holiday with my mum talking about it. I am not sure if this is bad thing, or am I not full accepting of the loss.

A Missing Name

Nearly three weeks after the funeral, and nearly five weeks after the loss was my birthday. While I never thought anything of it, obviously the loss was in the back of my mind, but that would be the last thing they would of wanted. They would of never wanted me to put them first on my birthday.

My birthday morning started like the past few years, with my son and wife giving me my presents to unwrap in bed, and all was going well. Then I opened one of my cards and there was a only two names instead of three, and it took me by surprise.

I should of known there would only be two, but I am not sure why it hurt as much as it did. It did put a bit of downer on the rest of the morning. It even brought me to tears, which I had to hold back while I was opening presents and cards in front of my son and wife, but after they had left me to get up I had a proper cry.

After being to the funeral and with it being a good few weeks after everything, I was surprised by how much such a simple thing like the name on my birthday card affected me, but looking at it, I’ve never not had a birthday card with the name missing, so the realisation of the loss maybe takes these little things for me to grieve properly.

The Loss

Dealing with the loss of a loved one is something I don’t think you can ever prepare for, or ever get used to. The loss of every person close to you has so many different effects on you.

I consider myself to be quite lucky, being in my late 20’s and only had to deal with the loss of one family member, and that was a great nan a over 5 years ago. But over the past few years I have been to a number of funerals, and while they have effected me in different ways, I have found my recent grief rather strange.

The loss of a family member was sudden, from getting a phone call telling me they where very ill.. While they have been ill for the past few years, they had been getting along rather well considering, so the last thing I was expecting one Wednesday evening was to have a phone call explain what had happened. I never thought much more of it at the time, just that they would get taken care of, and maybe spend some time in hospital. Another update Thursday, but it did not sound to be any worse, but not sounding any better.

Then I awake to the sound of my phone at 5am Friday morning with a message from my Mum, with the bad news. I have always said never ring me in the middle of the night if anything bad has happened. So mum was being nice to let me know by text.

I replied to my mum to let her know I had got the message, rolled over and cried for a little while. Not being able to fall back asleep, once I felt a bit better I took my mind of it with doing things, until it was time to head to work.

I headed into work as I needed to carry on with my normal stuff, as my family are the ones to not want you to stop what you are doing on such occasions. While it may sound bad, they would not want me stopping stuff just because of the circumstances, even more so that I am over 300 miles from them. I was even told not to head straight down to see them, personally I did not want to, there where others around and they did not want me to suffer or put myself out.

The funeral took place within two weeks, and from the day of the news to the days leading up to the funeral, it never felt like it had sunk in, waves of grief seemed to hit in small bits. I feel one of the things that never made me grieve straight away was the distance I was from everyone. The only contact was over the telephone, and everyone puts on a bit of brave face, which is nice, but this did not help me.