Posts Tagged ‘Java’

Phoload interview

Monday, December 1st, 2008

phoload main pagePhoload is a new website where you can download free mobile software. Here is our interview with Phoload CEO Jamie McDonald.

What is phoload?

Phoload showcases free-to-download mobile games and applications that have been uploaded directly to the site by software developers. Users of the website can download, rate, review and recommend the software. We’re hoping to build a community around the software, with participation from both users and developers.

What does the name ‘phoload’ mean?

Contrary to some articles about us, it has nothing to do with ‘pho’ noodles! It is an amalgam of ‘phone’ and ‘download’. We wanted a name that was short, snappy and did not have many existing search results. We also rather liked the aesthetic appearance of the letters.

Why did you decide to create phoload?

We’ve been mobile software enthusiasts for a long time, but I think it is only in the last few years that we have seen the emergence of a whole raft of startups and individuals creating free-to-download location based mobile apps, mobile social networks, and messaging software. We wanted to create a site that made discovering and downloading all this fantastic new mobile software as easy and enjoyable as possible for users.

What are the most popular downloads?

As of today, the most popular download on Phoload is amazeGPS, which is a mobile satnav application. In our top ten we also have another mapping application, a language translator, a music player, a scientific calculator, a couple of apps that interface to various information feeds, as well as several games. I think that the top ten really shows the diversity of mobile software available today.

Which phones are people downloading software onto?

Principally, Nokia, Sony Ericcson, Samsung and Blackberry phones (in that order of popularity). The most popular phones are almost all smartphones or other high end phones, with the most popular phone with Phoload users being the Nokia N95. Since launching support for Android last week, we’ve also seen a large number of T-Mobile G1s browsing and downloading software from the site.

What are your mobile software predictions for 2009?

I don’t think we are going to see anything revolutionary in 2009, just a continuation of the trends that have already started. That is to say, increasing usage and awareness of mobile software, increasing smartphone adoption, and the increasing popularity of mobile social networks and location based applications. I also think that the Android platform has a bright future. It certainly has enthused the developer community.

What technology is behind the site?

Phoload is written in Java. We use the excellent Stripes web framework, and Hibernate for mapping our Java objects to the database. As Phoload is a read-mostly site, we do a lot of caching using Ehcache both as a Hibernate second level cache, and for caching frequently accessed results that have been detached from Hibernate.

How is the site hosted?

On a dedicated server in Dallas in the US. We host with an excellent New Zealand based company called RimuHosting.

What challenges did you face in getting the site launched?

From a development perspective, the toughest challenge was creating a mobile software distribution system that handles the device fragmentation (especially in J2ME devices) in the best possible way. The system had to make it as easy as possible for developers to upload, and specify phone compatibilities for, multiple versions of a single item of software, while masking this complexity from users. I think that we have done well in this area.

Another challenge was sourcing the initial portfolio of mobile software, which was a lot of work. We spent many hours searching for and emailing developers.

What strategies have you used to get people to visit your site?

To promote the site, we started by emailing mobile industry and news site blogs, telling them about Phoload. We’ve found that this strategy has worked pretty well and we’re pleased with the press that we have received so far. We also try to promote Phoload by promoting the software on the site, highlighting relevant software to bloggers, and to users on forums etc. etc.

A search on Google for ‘phoload’ on currently gives 11200 results, how did you manage to get mentioned on so many web pages?

First of all, I think Google might be exaggerating a little, as when you click through to the last page of search results, there are actually far fewer results. But, there are still plenty, and I think one of the reasons for this is the blog coverage that I previously mentioned. Many of articles written about Phoload have been syndicated all over the web, so this accounts for a lot of results. These articles also prompt follow up articles and interviews, so there is a large ripple effect there.

How is the site funded?

We are self-funded.

What are your plans for monetizing the site?

We don’t plan to have any software sales on the site. We want to keep it purely focused on free-to-download software. Eventually, we’ll put some non-intrusive ads on the site. We’ll probably do this once our hosting costs start increasing.

Why should developers give their software away for free on this site?

phoload atomic
Primarily, developers will gain users and publicity. We hope to provide an excellent service to developers, and those who upload their software receive pages showcasing their products on the site, regular download reports, and feedback from the user community.

Also, we don’t just accept freeware, we also accept ad-supported and demo/trial software, and demo software can be associated with a purchase link to an external website.

How did you find the initial mobile software for the site?

On the whole, we used Google. We scoured the internet searching for mobile software that we liked and then contacted the developers of the software directly to ask if they would like to upload their software to Phoload.

What kind of testing do you do on the submitted software?

If it’s compatible with a phone we have, we’ll give it a try and report any feedback we have to the developer. However, we don’t make any guarantees to our users that the software has been tested.

Currently you support J2ME. Are there plans to offer software for written in other languages – e.g. Symbian, Android?

Yes, we launched Android support on the site last week and are really pleased with the amount of traffic the Android section of Phoload has received so far. We plan to add support for more software platforms soon, starting with Symbian.

Where do you want the site will be in one years time?

Hopefully, Phoload will be established as one of the best places to download and discuss the latest free mobile software. Also, by then, we will support all of the major mobile software platforms.

And finally can you give us a few tips for anyone setting up a new website of their own?

I think that virtually everything, from starting the company, sorting out the legal documents, contacting developers, and of course developing the site, took longer than we anticipated. So, I would encourage people to be realistic about how much time everything takes.

One specific mistake we made was with regard to search engine optimisation. I think if you anticipate that you will receive most of your traffic from search engines, then you have to think deeply about this from the start and during the whole design process. We thought we had done this (with search engine friendly urls etc.), but we still found that we received duplicate results in the Google index due to session IDs creeping into the urls unnecessarily, and both the www.phoload.com and phoload.com domains being indexed separately. We’ve fixed these issues now but wish we had fully addressed them before launch.

Thanks for your time.
You can visit Phoload at http://www.phoload.com/.

Java Reverse Engineering Tool – Source Code To UML

Saturday, July 5th, 2008

Reverse Engineering and Redocumentation of Java Code

This is my final year University project. It analyses Java code and then produces a UML class diagram of the Java code.

The picture below shows some typical output from the application. Each box represents a Java source file. The lines show the dependencies betweent the files.

Reverse Engineering Tool

Download Reverse Engineering Project (72kb)

Brief Overview

  • Each box represents a Java source file.
  • Each box can have three compartments. They are 'name', 'attributes' and 'operations'.
  • The lines show the file dependencies.
  • A red line means that two classes are mutually dependent on each other.
  • Blue lines show inheritance.
  • The public, private and protected attributes and operations can be toggled on or off as desired.
  • The boxes have an 'elastic property' which makes the diagram easier to layout. If two boxes are too close they will try to move apart. Each box can be manually moved and fixed into a position.
  • The depth to which the source files are shown can be altered.
  • There are three automatic layout methods.
  • The easiest way to understand the above is just to try the application. There is only one screen to get the hang of, so it is (hopefully) easy to use. Press Ctrl-h for help at any time.

How to Use

  1. You must have Java 1.2 or above installed. You need a fairly fast computer. A 400MHZ Pentium 2 with 64mb RAM should be alright.
  2. To work fully you need access to the .java and .class files of the project you are analysing. They must all be in the same directory.
  3. Unzip the files from the above zip file into a new directory. Double click on 'reverse.bat'.
  4. Go to the file menu and choose open. Select a Java file that you want to analyse. This will usually be the Java file with the 'main' method.

Source Code

As this was a university project I'm afraid I'm not able to share the source code.


Atomic MIDlet game

Friday, July 4th, 2008

Overview

Atomic is board (but not boring) game where the idea is to take over the game board. You can do this by placing atoms into empty squares or onto square that you already control. If a square reaches its atomic capacity then it will explode causing the atoms to fly into the neighbouring squares. If any of your opponents atoms are in the neighbouring then they will become your atoms.

Any time a square reaches its atomic capacity it will explode. This can cause long chain reactions that can have a dramatic effect on the state of play.

Download

Atomic Download (43kb)

The Atomic game is available to download from the above link.

Controls

Use Up, Down, Left & Right to move the current square position. Fire places an atom.

Options

This game is best played against human oponents. Up to four people can play. However you can play against the computer as well. From the options screen just choose how many humans and computers you want in the game. If you are playing against the computer then you can set the computer's intelligence level.

Technical Guff

Atomic is a MIDlet (similar to a Java Applet but for mobile phones). It can be played on MIDP compatable devices or emulators. This has been tested on Sun's Reference Implementation (available with the Sun Wireless Toolkit) and with the MIDP add-on for the Nokia 9210. This is a colour game with lots of images so you ideally need a fairly powerful colour phone.

History

1.0.1 13/04/02
Thread logic is hopefully slighly better. There should be less chance of deadlocking the game.
A 'Shaky Balls' option has been added
Clearer indication of whose turn it is
Larger board

1.0.0 04/03/02
Base version of the game.

Credits

Atomic is based on an Amiga game called Atoms by Tom Kuhn. This version is very similar to the original but with the addition of computer players.


PhotoStamper utility with Java source

Thursday, July 3rd, 2008

PhotoStamper is a simple application which will add a date/time stamp to your jpeg photos. You can decide which corner of the photo to put the stamp in, as well as configuring the font size. It currently uses the last modified date of the file as the timestamp.

I wrote this after finding that most of the other tools to add date/time stamps were not free. It is written using Java 1.5 (Java 5.0) so you'll need a Java runtime 1.5+ on your computer to use it.

The tool won't overwrite the original file - it wil save the stamped file to <originalfile>_stamped.jpg.

Usage

java -jar PhotoStamper.jar [options]

Stamps the last modified date onto the image file.
PhotoStamper file [-s size] [-x xoffset] [-y yoffset] [-a anchor] [-c color]
        file    File or directory to be stampped.
        -s      Font size in pixels.
        -a      Anchor for text. One of tl, bl, tr, br. (top left, bottom left, etc).
        -x      x offset from the anchor.
        -y      y offset from the anchor.
        -c      color consisting of r:g:b values. 0-255.
e.g.
        PhotoStamper photo.jpg -s 50 -x 25 -y 25 -a tl -c 255:0:0

Download

PhotoStamper.jar
PhotoStamper source and Eclipse build files

Limitiations

Unlike some of the commercial tools this photo stamer will result in a small reduction in image quality as the whole jpeg will be recompressed after the date/time stamp is applied. The difference with the original is very small so you probably won't even notice.


Adding a date/time stamp to a jpeg image in Java

Monday, October 22nd, 2007

I’ve been looking for a simple tool to add a date/time stamp to some jpeg images. There are quite a lot of tools to do this but they all tend to cost money. I decided to make my own in Java. The actual process of loading a jpeg, adding a stamp and then saving it again is very simple. The below snippet will do the job.

BufferedImage bi = ImageIO.read(sourceFile);
Graphics2D graphics = bi.createGraphics();
Font font = new Font("ARIAL", Font.PLAIN, 20);
graphics.setFont(font);
graphics.drawString(stamp, 50, 50);
bi.flush();
ImageIO.write(bi, "jpg", targetFile);

I added some options (you can change font size, position, colour) to meet my needs. You can download it for free from https://www.reviewmylife.co.uk/blog/2008/07/03/photostamper-utility-with-java-source/. It is very basic – command line only – but does the job well enough. The Java source code and Eclipse project files are also available for download.

ProGuard Eclipse Ant build.xml

Saturday, October 20th, 2007

If you are building J2SE apps with Eclipse and want to use ProGuard to compress, optimise or obfuscate your code you’ll need to create an Ant build.xml file to do this. I found various bits of help on the internet explaining parts of the build.xml file, but couldn’t find anywhere that gave the complete build.xml to do the full compile, jar and proguard steps.

Here is the full build.xml I cobbled together to do all three:

<?xml version="1.0" ?>
<project default="main">
<taskdef resource="proguard/ant/task.properties"
	classpath="D:\apps\proguard4.0.1\lib\proguard.jar" />
<target name="main" depends="compile, jar, obfuscate"
	description="Create project">
	<echo>Creating project.</echo>
</target>
<target name="compile" description="Compile target">
	<javac srcdir="src" destdir="bin"/>
</target>
<target name="jar" description="Jar target">
	<jar jarfile="PhotoStamper_debug.jar"
		basedir="bin" includes="*.class">
		<manifest>
		<attribute name="Main-Class" value="PhotoStamper" />
		</manifest>
	</jar>
</target>
<target name="obfuscate" depends="jar"
	description="Obfuscate compiled classes">
	<proguard>
		  -libraryjars "${java.home}\lib\rt.jar"
		  -injars      PhotoStamper_debug.jar
		  -outjars     PhotoStamper.jar
		  -keep public class PhotoStamper {
			public static void main(java.lang.String[]);
			  }
	</proguard>
</target>
</project>