James Elsey

James Elsey

This user hasn't shared any profile information

Posts by James Elsey

What I thought of “Instant Android Fragmentation Management How-to”

0


I was recently contacted by the marketing team from Packt Publishing and asked if I could write a review for one of their new ebooks, so here it is!

This book gives a brief yet comprehensive overview of some of the processes you can follow to improve your applications chance of working on the varying versions of android that are currently in existence.

Having developed apps that work perfectly fine on my Galaxy S2 2.3.3, only to find they don’t work on a hardware identical S2 with 4.0, I certainly feel the pain of OS fragmentation!

Share

A few little tweaks to automate Android instrumentation testing via Robotium & Maven

0

Having recently revived an android project I haven’t opened in close to 6 months, I was left scratching my head as to why I couldn’t run any of my integration tests.

Thinking back, I remembered having problems getting robotium to instrument the clicking of a button, as simple as it sounds, theres a few little gotchas involved. Firstly, I needed to modify the test code to click on text, rather than a button, as it has been suggested by various users on StackOverflow that there does tend to be odd side effects when clicking buttons:

Share

Bootstrapping a Grails application to prepopulate data on startup

0

I’ve been dabbling in a little Grails recently, and I found it quite frustrating having to re-enter some sample data everytime I restarted my application, in order to have the views look meaningful.

Fortunately, theres an easy solution, just do all of your setup in the Bootstrapper class like so :

Share

Deploying a grails application to Cloudbees

0

I spent much of last weekend experimenting with the grails framework, so I wanted to deploy what I had in the cloud. Theres a big tutorial on the IntelliJ IDEA documentation (the screenshots don’t seem to match my installation of IDEA, even though its the same version number).

There is a much easier way, providing you have the Cloudbees SDK installed, you can just run this one-liner :

grails war; bees app:deploy target/MyWarFile.war -a mycloudbeesusername/applicationcontainernamehere

The above will package the application as a war file, and then deploy it to your Cloudbees instance.

Share

Override the toString on your domain classes so they display as something useful

0

If you’re finding that your domain objects are not being displayed in a readable manner, chances are its because they haven’t been told to. This is often the case in drop down menus that the grails scaffolding creates. You can easily fix this by overriding the toString method on your domain class, such as the following.

class Question {

    String text

    static hasMany = [responses: Response]

    static constraints = {
        text()
        responses()
    }

    String toString(){
        return text
    }
}
Share

How I passed the SCJP / OCPJP

0

After procrastinating for many years (4 to be precise), I finally sat and passed the SCJP exam. The exam itself wasn’t particularly difficult, but theres a lot of things you can get tested on that you’ll rarely use in everyday development. Having been developing in Java for around 4 years now, I’ve never needed to do any serialisation or do any fancy concurrency work other than starting a thread for an asynchrnous task.

So to iterate, theres a lot in there that you may not use, but the test expects you to know it well, so be sure to practice and write a lot of code.

Share

Not posted in a while, busy busy busy!

0

Hi folks,

It’s been a little while since I made any detailed posts, and it’s not through lack of wanting. I’ve been pretty busy with a new project at work, and I’m also preparing to (finally) sit my SCJP at the end of November, so I haven’t had any time to write any android tutorials.

As ever, my “to do list” is massively increasing, I have a BIG Grails/Groovy personal project coming up after my SCJP, which will be a Grails web app, along with an android mobile client, with some QR code functionality and social integration added into the mix, so I’ll have plenty of interesting things to blog about in the coming winter months.

Share

Continue and break, with and without labels, for the SCJP

0

Looping constructs are very useful in any programming language, however they can be come particularly complex when you have a variety of nested loops and you need to drop out from particular iterations, or exit the loops entirely under a set of given circumstances. Fortunately for us, Java provides us with 2 keywords that we can use to help in these situations:

  • break - breaks out of the entire loop, and no more iterations will occur. The thread of execution will then move onto the next line of code after the loop.
Share

The Dark Tower 3 : Wastelands

0

I’ve just finished reading the third instalment in Steven King’ masterpiece fantasy series, and I must conclude each instalment in the series just gets better and better.

If you don’t want to know about the plot, then don’t read this part. The book picks up a few weeks after the previous, with the trio making their way from the beach inland.

They soon discover that there are multiple doors in Roland’s’ land, all interconnected via a “beam”, when they encounter a new door they realise they must travel along this path, and where the paths all meet, lies the dark tower.

Share

Monster Island; a zombie novel

0

I’ve got a habit of deciding which books to purchase by how good the covers are, or by entrusting what is written on the back of the book, this time I followed this tradition.

I’ve been a fan of traditional zombie stories for some time now, and by traditional I mean “proper” zombies, slow dumb ones, not these fast running zombies of recent films.

I was rather sceptical about another one of those mediocre post-apocalyptic America stories, but this one had a good twist, a zombie with a concious mind.

Share
James Elsey's RSS Feed
Go to Top