Posts Tagged “java”

Hibernate Dependencies for a Maven Web App

by Hendrik Will. 0 Comments

If you’re using Maven to build a Web App with the latest version of Hibernate you only need to add the hibernate-core dependency to your pom.xml (Project Object Model).  The Hibernate project added their own pom.xml which will download all other library dependencies from the Maven repository for you automatically.

I saw that many blogs still refer that you have to add many dependencies to use Hibernate which confused me a lot. Also JBoss recently started to sync their repository with the Maven repository. So there is no need to add another JBoss repository to your pom.xml.

Measure elapsed time with Java

by Hendrik Will. 0 Comments

For my recent experimental gaming project I wanted to measure the overall elapsed time since the beginning of a game.
In my main class I added a startup variable of type long which contains the current time in milliseconds. At the end of a game call the function stopWatch(startup); to get the elapsed time in seconds.

Getting HTC Desire to work with Android SDK on Vista 64

by Hendrik Will. 0 Comments

Even for the newest Android SDK I ran into problems getting it to work with my HTC Desire on Vista 64. Probably it’s the same problem for other Windows 64bit versions.

If you connect  your phone to your computer via USB you will be asked to install a USB driver for ADB.
You will point the installer to your \android-sdk-directory\usb_driver\ but it won’t be able to find a matching driver.

Find \android-sdk-directory\usb_driver\android_winusb.inf and open it with your favorite text editor.
Now find the line with [Google.NTx86] and [Google.NTamd64]

Enter the following after both of these lines:

;HTC Desire
%SingleAdbInterface%        = USB_Install, USB\VID_0BB4&PID_0C87
%CompositeAdbInterface%     = USB_Install, USB\VID_0BB4&PID_0C87&MI_01
;

Save the file and try again to install the drivers. Point the installer to \android-sdk-directory\usb_driver\. Do not choose one of the sub directories.

svntask examples for Apache Ant

by Hendrik Will. 5 Comments

A couple days ago I had my first experience with Apache Ant. If you have never heard of it before you should definitely check it out. Apache Ant is a very simple JAVA-based build tool with xml-based configuration files for automation.

I wanted to automate the process of importing/exporting specific MySQL database tables.In the next step I wanted to update and commit the data to SVN. After a quick research I found the JAVA lib svntask which is based on SVNKit very useful.