Need help?

I'm available for remote short term contracting or consultancy work. Please check out my LinkedIn profile for more details on my experience.

Please feel free to use the form below to contact me.



Java

You’re probably wondering what I mean by a ‘Tin Can Approach’. Well, the major concept of the new Tin Can standard, is direct communication to an API; removing the dependancy of JavaScript. I'm going to be focusing more on the API aspect, and not so much the way the data is packaged....
jon | April 22, 2010 | Comments (0)

I'm going to be referring to iOS related Objective-C, as the blocks were just released in version 4, so it's an interesting topic.

Before the blocks functionality, the typical way to do a callback would be to pass the delegate of the object which would be called to the worker object. Once the worker object finished the task, it would then reference a specific method (defined by the protocol), which executes the callback code. This approach works fine, but gets very bloated when you need to do certain kinds of tasks - not going to be getting to the protocols vs blocks in this article though. They do both serve their own purposes, and I'm just going to be getting into the relations they have to the Java anonymous classes.

jon | April 22, 2010 | Comments (2)

The big question here is which technology to use, JSON vs XML. They both do a very good job, so what are the benefits of using one or the other? Well, I'm going to list the pros and cons of each, coming from a mobile point of view.

If's you're not too familiar with JSON and XML, I'll do a quick brief. They are basically used for defining and storing data (using meta data). This data can then be passed around - so when it travels from point A to B, the receiving end will know what each piece of information means (just to maintain a certain level of standardization).

jon | April 22, 2010 | Comments (2)

The process of parsing JSON in Android is pretty simple, thankfully. We'll be using JSONObject for all the parsing goodness - there are also some other JSON classes, but we'll just go through the basic ones to give you a general idea of how it works.

The first thing we will do is setup our JSON string, which we'll end up parsing.

jon | April 22, 2010 | Comments (65)

This article is going to walk you through some examples of how to use SAX to parse through XML documents, in an Android SDK environment.

There are actually 2 main ways of handling XML - SAX and DOM. The DOM parser loads the whole document into memory before it can work with it, which can be slow and uses up a lot more memory - the benefit is that you're not writing as much code. In this tutorial though, I'm going to be focusing on SAX, simply because it's the best for mobile devices, as they don't have a lot of memory. The beauty of SAX is that it goes through each element and attribute one at a time, and you can pick and choose which one you want added into memory, but you do need to write a lot more code (depending on what you want to do).

And before I forget, there is another called STaX, which is an XML pull parser, but I'm not going to get into that one.

jon | April 22, 2010 | Comments (23)

I'm going to go through the process of serializing and deserializing an object.

What this means is that we're going to convert an object into an array of bytes, which can easily be moved around or stored (for later use). And for deserialization we just take those bytes and convert them back into an Object.

jon | April 22, 2010 | Comments (5)

This article goes through the process of combining 2 images (only works with PNG or JPG ). It will involve passing 2 Bitmaps, which will then get combined using the Canvas class - sounds simple huh?

jon | April 22, 2010 | Comments (4)

Due to popular demand I've finally released a major update for the Model Release Pal Android App - this was also due to the fact that Easy Release just released a version for Android (they have quite a popular one for the iPhone).

I also wanted to apologise to all the people that are currently using my app, for not having this update out earlier.

jon | April 22, 2010 | Comments (1)

Have you seen other applications with Buttons (or other views, but mainly Buttons) that stay in one spot, even if you're scrolling through a list? These are commonly known as floating Buttons or Views.

This is actually used a lot on websites as well, and they may seem hard to produce at first glance, but it's actual quite easy.

I'll run you through an easy application that uses one floating button within a ListActivity, which is aligned to the bottom right of the screen - on top of the ListView.

jon | April 22, 2010 | Comments (6)

This is a subject that's seldom talked about, but can be quite important. The NDK basically allows you to port any native C/C++ code/libraries into your Android project, using JNI (Java Native Interface).

I'm going to go through a quick and simple example of how you can display "Hello World" in your Android application using some native C.

jon | April 22, 2010 | Comments (382)

A very annoying issue that I've noticed with the NBAndroid Netbeans plugin, is that it doesn't know how to properly attach an external JAR file to an Android Project.

If you right-click on libraries (under your project folder), and click on 'Add JAR/Folder', it will add a reference to that library/JAR file, which it will recognize in the code (detect all the classes, etc). The problem lies when you try to compile the project - at that point, it doesn't actually add the JAR to the project, which in turn gives you errors when running.

jon | April 22, 2010 | Comments (4)

I'm happy to announce that my Allergy Pal application has finally been released!

This should be very useful for people suffering with allergies, and need a way to convey this to others - especially in other languages!

jon | April 22, 2010 | Comments (5)

The Android SDK makes it very easy to send emails from an application, but unfortunately, that's only if you want to send them via the built-in mailing app. For most situations this works fine, but if you want to send something out and don't want any input/intervention from the user, it's not as easy.

In this article I'm going to show you how to send an email in the background without the user even knowing - the application will do everything behind the scenes.

jon | April 22, 2010 | Comments (505)

The process for capturing, saving and displaying an image in Android can be quite annoying, especially if you want it to work across all devices.

With the release of the Sense UI (an HTC creation), it's made things 1 step more difficult. So, the reason I'm writing this article is because I've been stuck on this same issue for quite awhile, and there isn't enough information out there to let us know why it simply won't work.

Simply put, the Sense UI handles things differently when it comes to saving a new image after an intent was called (ie. new Intent(MediaStore.ACTION_IMAGE_CAPTURE)). In this article I'll show you how I overcame this problem and walk you through my code.

jon | April 22, 2010 | Comments (153)

Have you been trying to find a quick and easy way to format dates from a String? It can be quite tricky with Java (if you're new to it). So, I'm going to go through a few very simple steps to accomplish just that.

jon | April 22, 2010 | Comments (9)