Donnerstag, 7. Januar 2010

Android and XML

As mentioned in an earlier post, the goal is to run an 8-Puzzle game on Android and let Prolog agents analyze the moves. The communication between Prolog and Android should be achieved by using the SQLSpaces. If you want to read more about SQLSpaces go here or more general here. The SQLSpaces communication is using a XML protocol over sockets. The server is implemented in Java and client libraries exist in Java (of course), Prolog, C#, PHP and ruby.

The first though was, hey, client lib is in Java, so most probably it should work on Android! Unfortunately not! The problems was, that the latter versions of the SQLSpaces client have used StAX for parsing the incoming XML messages and DOM to generate XML for requests to the server. However, StAX is not supported on Androids - javax.xml.stream.* is not provided by the Android API. Yet DOM is only implemented in level 2! The result was, that we had change the SQLSpaces client to use DOM level 2 only and extract the XML parsing and make it adaptable. The first issue was not a big deal. We only had to remove some convenient access methods to Text nodes and some minor issues. The parsing was a bigger story!

Android supports two ways of parsing XML: SAX and XMLPull (of course you can also use DOM but this comes as always with a huge memory overhead)! It is recommended to use the SAX parser over XMLPull parser, as the latter one is slower. Actually, the decision depends on what you need: Speed vs. a simple way for parsing XML. You can find a very nice example presenting Android and all kinds of XML processing at IBM.

Finally, we have now a very nice mechanism for the SQLSpaces that will choose the best suited XML parser on the Desktop and on Android. We haven't compared speed yet, we are first happy that it is working at all and in a very short time.

Sonntag, 3. Januar 2010

AndREight-Puzzle on Kenai

The 8-Puzzle game for Android, now named AndREight-Puzzle, is proceeding. I have created a project on Kenai.com and commited the sources to the SVN.

http://kenai.com/projects/andreight-puzzle

Before being able to commit the sources from a fresh Eclipse installation, I had to install the SVN plugin - standard for Eclipse is now Subversive. I remembered from old days, that you had to add lots of update sites manually. Now - in 3.5 - you can just activate the update site, install Subversive and on the next restart of Eclipse it will pop-up a dialog to install the connectors. Very elegant!

Mittwoch, 30. Dezember 2009

Android programming is fun!

It's been a long time since my last post. Much happend and I had few time to post some stuff. But new fun is on the horizon. We have ordered some Android phones (HTC Magic) and I started to develop a new application to proof the concept of heterogeneous programming languages and devices in one system.

The target is to program the 8-Puzzle game (http://www.8puzzle.com/) as an Android app and connect it through SQLSpaces (http://sqlspaces.collide.info) to Prolog agents, that will analyse the moves and provide feedback.

I already started with the UI and postet some screenshots on flickR:
http://tinyurl.com/yh4qv9z
http://tinyurl.com/yjnnyof
http://tinyurl.com/yfscd23


Next year (I could also say next weekend) I will continue on the connection to SQLSpaces and some game logic...

Freitag, 24. Juli 2009

Update: Create an image of an invisible Swing component

In a recent post I have described the way how to print a invisible (better say, not yet added) component. It seams that we were not the only ones with this problem. Here is a second solution (in German, but code still in Java):

http://www.java-blog-buch.de/d-gui-objekte-als-bild-speichern/

Montag, 29. Juni 2009

NetBeans 6.7 is out - without JavaFX!

As already mentioned in my last post, the new release of NetBeans was scheduled for end of June. And today, as June is quite at its end, NetBeans 6.7 is out. The new outstanding features are the tight integration with Kenai and the integration of a new build system, namely maven! These two features really rock! You can connect your Kenai project, access the issue tracker directly from NetBeans as well as check out the source and more! With the integration of maven, the main build system based on ant has a tough competitor. A new view has been integrated to visualize the dependencies of modules, which helps a lot if you have many.

There is one very big issue for me about the latest NetBeans release: JavaFX support is missing! Again: JavaFX support is missing! How could they do that? JavaFX was the main reason to use NetBeans! Now I have also used the new Kenai feature with the last milestones. I wanted to switch immediately to the new release, but without JavaFX support I still have to stick with the predecessor 6.5.1. We'll see when the support will be out!

Overall, as I said, good times in the Java eco system :D

Dienstag, 23. Juni 2009

Galileo is approaching

Few hours left until Galileo is finally released. Plan for tomorrow afternoon: Download, install, install plugins, migrate workspaces, have fun :D

All in all a very nice month for Java developers. Tomorrow Eclipse 3.5, later this month Netbeans 6.7 (see their roadmap). I just want to get good JavaFX support, either for Eclipse or for Netbeans. Currently Netbeans has better support for JavaFX, but still not as good as for "pure" Java. We'll see what the future will bring...

Sonntag, 21. Juni 2009

iPhone finally jailbroken

The Dev-Team has finally released the Pwanage Tool for OS 3.0 (and meanwhile even a second tool called redsn0w) to jailbreak updated devices. First I had some problems with error 1600 and 1604, but after some search I have finally solved them and everything is fine! An iPhone without Winterboard just sucks.

One thing I really hate about the new update is that the "old" iPhone (2G or Classic) does not provide all the new cool features that were announced for this release. No MMS, no Stereo Bluetooth profile, no tethering, and so forth. In the end you will get a voice recording tool and copy & paste. Wow! Thanks Apple!