Pages

April 15, 2011

iPad 2 or Android Tablet???

ALERT: This is a non-nerd post…

My wife will be returning to school in the fall to start working towards her PhD and I am thinking that she would benefit from using a tablet. I just can’t decide if I should get her the iPad 2 or one of the newer Android tablets running Honeycomb. We currently have Android phones and she seems to like hers, but until I get Honeycomb in my hands I have no idea how Android translates to the tablet.

So what does a tech guy do? He asks for input from other tech guys who have gotten their hands on the devices. So please share any opinions you might have on the iPad 2 or one of the tablets running Honeycomb. You can either respond to the post or let me know what you think on twitter at @mrwillsw.

April 6, 2011

Java Doesn’t Make Money Easy

I am currently working on writing a small loan payment calculator application for Android, and trying to be a good boy and use the java.math.BigDecimal class to handle the money representations. It took me a bit to get it going, but I am really wishing I had gone “old school” and just used an integer and done all the calculations at the penny level.

The BigDecimal class methods initially seemed to be pretty straightforward. You just call the add, subtract, multiply, or divide methods like you would if you were doing normal calculations. So I wrote my test case, implemented the formula in my LoanCalculator class, and kicked off my test full of excitement about being able to tie all of this in to the Activity UI I had all set up. Nothing but red and a big stacktrace.

Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.

It turns out that when calling the BigDecimal.divide() method you need to specifically set the scale and rounding method so the object knows how to represent the decimal value in the cases where it is a repeating number, ex. 2/3 = 0.6666666666666…. I got that situated, got my test passed and moved on my way. I always wondered why I never saw BigDecimal used frequently and now I know why. Unless you pay attention to what you are doing and really read the API specification you will get errors and stacktraces that some devs would rather just avoid.

March 8, 2011

Shifting Focus


It has taken me some time, but I have finally found my way. I have decided that I am going to begin to focus on mobile app development. It is an area of software development that has kept my interest. It is something I can do away from whatever job I have to pay the bills and, should I become very strong in the area, can open me up to the quickly increasing number of mobile app developer positions available.

Currently, I am working my way through learning the basics of developing for Android. I started there because I have an Android phone, but I intend to also learn how to develop for Windows Phone as it will also help me learn Silverlight in the process. Luckily, I have a few resources to help me get started with both.

I am very excited about this and I hope to share things I learn.

January 29, 2011

Following the TDD Road

Like many people, I have not yet made my way down the TDD path. My current job does not use it and I don’t think it will any time soon and I have yet figured out how to get started on my own.  Luckily, I have found someone to show me the ropes and get me started. I am pretty excited about it. I will finally be making the jump into more current development techniques.  From what everyone tells me, once I get started with TDD I won’t be able to design/develop any other way. I’m psyched.

December 1, 2010

An App Idea? Brilliant!

I think I actually have an idea for an app to write. I'm not ready to share what it is yet because I need to completely wrap my head around what it is I want to do with it, but after the funk I've been in I wanted to share that I am starting to dig my way out. It has been a while since my creative juices have been flowing so it is nice to have this feeling again.