Tag Archives: java

Java Version of Super Star Trek

I built a version of Super Star Trek in Java. This version of the Star Trek text game is based on the work of the SST2k project.

Star Trek, a text-based computer game, has a long history. It originated back in the 1970′s and there have been many variations of it since then. According to the Wikipedia article on the Star Trek text game, the SST2k project started in 2005. It is based on the C port of Tom Almy, which was done in the early 2000s.

A link to the Java source is provided. Continue reading

Posted in Game Design, Java | Tagged , , , , | 2 Comments

My Guide to Performance Tuning For Android and Java

This is my guide to tuning performance of Java programs. It covers both cpu time and object memory analysis. I have found that this works for Java programs and for many Android applications. In the latter case, it helps if your Android application is structured so you can turn a section of an application into a standalone test case. Since many applications have background tasks, often implemented as subclasses of AsyncTask, this is usually easy to do.

The tool I prefer to use is HPROF. It is a simple profiling tool that is available with the Java SDK. It provides a variety of tools so you can address common performance problems, like the following: (1) you are allocating too many objects, which leads to a slow app because of too much garbage collection; (2) you are allocating objects and not properly releasing them, leading to a memory leak; (3) your computations are taking too long.

The topics I cover in this article include: (a) Getting started with HPROF in Eclipse, (b) HPROF Results (cpu times, object allocation), (c) Performance tuning suggestions, and (d) Other Android performance tuning tools. Continue reading

Posted in Android, Java | Tagged , , | 2 Comments

Notes on Performance Tuning of Java

When you need to analyze performance of a running Java program, there is a simple profiling tool already built in to the Java runtime environment: HPROF It allows you to analyze both execution time and heap allocation. It’s really basic, but gets the job done — and it’s free and easy to use. Continue reading

Posted in Java | Tagged , , | Leave a comment

Best Way to Learn OAuth for Java

Where to find a good explanation of OAuth and working examples in Java. Continue reading

Posted in web | Tagged , , , , , | Leave a comment