It’s about time that we get some real data in our application instead of a boring, static set of data. There are two different types of web services: SOAP (Simple* Object Access Protocol) and REST (Representational State Transfer) (* The simplicity of SOAP is left open for interpretation :)).

Now, it’s a good start, but it would be even better if it was more readable. There is plenty of empty space on the screen right now, so we might as well use it. For starters, we can space out the ticker symbol and the quote, as well as adjust the font size to make everything easier to read.Read more…

Recently I upgraded my HTC Diamond to a new, shiny HTC EVO 4G, even though Milwaukee doesn’t yet have 4G coverage. The big difference is that instead of running Windows Mobile 6.5, the EVO is running Android 2.2. Being the programmer that I am, I needed to try out creating an application for it to see how it compared to my (less than ideal) Windows Mobile development experience. The first thing that I wanted to check out was the some of the different layouts, and I began my journey by looking into ListActivity…

The Android ListActivity makes it simple to display a list of items in your application. If the main purpose of a screen (Activity) in your mobile application is to present a list of choices or content to the user, use ListActivity instead of Activity. If all you want to do is display a list to the user and nothing more, you don’t even need to create a layout definition for the activity. The ListActivity has a default layout that provides a ListView for you. However, if you wish to customize the way your ListActivity looks, the single required element in your layout definition is an object with an id of @android:id/list.

I recently ran into an issue that was pretty obvious in retrospect. However, I spent about an hour figuring out why in the world the XmlSerializer wasn’t serializing my seemingly good object and the properties within it. All of the properties on the object were public, and when I had stepped through the code with the debugger, there were values (that I expected) visible within the object.

Well, it seems that a setter is required in order for the XmlSerializer class to serialize the property. This makes fairly good sense, because you usually wouldn’t want to serialize an object without a way to deserialize it. In my case, however, serialization was enough, as I was not planning on deserializing this object. So, sure enough, after adding a setter for all of my properties, XmlSerializer correctly serialized my object as I had wanted it to in the beginning.

Recently, I’ve had the experience of using Java Modeling Language (JML), and its set of tools. This set of tools consists of: ESC/Java2, a static checker that attempts to prove the JML specifications without actually running the program, the Runtime Assertion Checker (RAC), which validates the JML specifications while the program is running, and will throw exceptions if any specification is not satisfied, and JMLUnit, which creates JUnit tests from the JML specifications. In this entry, I will be specifically focusing on JML itself and not any of the additional tools. Read more…