Assignment 1 Progress Report

For Assignment 1, I am making an Android implementation of the nslookup utility.

The original design was for the app to take a hostname and convert it into an IP address. During development, I decided that the App should also be able to convert the IP address into a hostname as well.

Here is a picture of the App running on the Android emulator.

Screen Shot 2014-01-20 at 1.48.29 PM


John Ingram’s presentation on Thursday had a lot of good advice about software engineering and project management. Here are some good tips that helped me with this assignment.

Start with your requirements.

  • Know the app absolutely needs to do first.
  • Worry about perfecting it later.

Software design is an iterative process. Get something that works first, then add to it. Don’t try to solve all the world’s problems at once.

The original iPhone was terrible even compared to other smartphones of its era. No App Store, no Copy/Paste functionality, not even 3G support. But it did what it did well and it became very successful.

Design the interface before coding. 

  • I used the interface builder in res/layout/activity-main.xml
    • Bug in API version 19.
      • Can’t choose properties from the menu.
      • Must downgrade to version 18.
    • Great for getting a basic picture, but still must be comfortable with XML
      • “Absolute positioning” may look great on screen, but may be terrible on the device.
      • Some function is simply faster and easier to add directly via XML.

In the “real world” interface can make or break your product. If your interface is well designed, you’re going to have an easier time coding. You’re not going to have to redo things to adapt to a changing interface, if you have a good idea of where you are going early. 

Don’t Procrastinate

I’m a terrible procrastinator.

More on procrastination at:

Instant gratification monkey

This assignment looks easy, so there is a temptation to put it off until, for example, this weekend, right before it’s due.

What I found was that things that seem easy might not be. For example, the nslookup functionality that I used to find hostnames and IP addresses is all taken care of by the Java API functionality at

Simple, right?

Not so much. I designed my interface, added the appropriate onClick functions, made my call to the function…

…and instead of everything working as expected, I got the following exception.


Basically, network calls cannot should not be made in the main thread. (You can bypass this protection security settings, but don’t.) So, to get this working required a crash course in AsyncTasks and Java generics. It’s not difficult, but it can be time consuming.

Expect things to take longer than expected and plan accordingly. If things go well, you can do more and learn more and make a better app, or you will have time to goof off guilt-free when your app is done and everyone else is stressing out trying to get it handed in.

How to beat procrastination at

Guilt-free goofing off.


Nobody likes documentation. Except when we have to read someone else’s code and it’s not there. Or when we read our own code and can’t remember what we did.

  • The best time to write documentation is before you write the code.
    • Simply writing out what you want to do in plain language can help you think things through.
  • The second best time to write documentation is while you write the code. 
    • Explaining your ideas captures your thought processes while you are writing.
    • It can also help you prevent errors. If something in code is awkward to explain, that probably means it’s not the best implementation.
  • The next to worst time to write documentation is after the code is written.
    • Which is when most of us do it.
  • The absolute worst time to write documentation is not at all.


Special thanks to John Ingram for his excellent in-class presentation on software development.

Also, thanks to Greg Edison for demonstrating the drag ‘n’ drop functionality of Eclipse and other hints.

Great info about procrastination, including the instant gratification monkey, at and how to beat it at

Acknowledgements in the source code:

Handling networkonmainthread exception with AsyncTask:

How to do nslookup in Java:

More on InetAddresses from:

Determining whether a string is an IP address:
How to clear a edittext field:

How to display toasts:

Tagged with: , , ,
Posted in Android Development, Progress Updates
One comment on “Assignment 1 Progress Report
  1. […] App had mostly been completed by the first progress report, so there are only minor changes since […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: