Pages

Saturday, 17 December 2011

Oxygene for Java takes Delphi programmers to the Java and Android platforms

At the end of November 2011, RemObjects released Oxygene for Java, previously known as Project “Cooper” as per this official blog post and, for that matter, the press release.

Anyone familiar with Delphi Prism, which is RemObjects’ .NET compiler (also known as Oxygene for .NET) will know it is a high-performance compiler with some lovely enhancements to Object Pascal and support for all features of its target platform, .NET.

Oxygene for Java is the same compiler, the same language, but targeting the Java platform. This allows you to build:

  • cross-platform applications running on the Java Virtual Machine (as per the trivial Mandelbrot example I blogged about before)
  • Java applets (some applets I built in Oxygene based on some online examples can be seen at this test page)
  • Tomcat servlets, as discussed by Sebastian Gingter in this blog post
  • probably most interestingly, Android apps. Oxygene for Java supports a full tool chain for taking Java compiled classes and making them digestible to Android’s Dalvik Virtual machine
  • pretty much any other Java-based utility

In the middle of November I popped over to Antwerp, Belgium to deliver the launch presentation for Oxygene for Java at Be Delphi 2011. There are some pictures from the day’s sessions here, including a couple from my presentation that have the tell-tale Oxygene logo on the screen.

Be Delphi was a great inaugural day-long conference from a new Belgium-based Delphi community.

Since that launch presentation (and after a couple of other small jobs) I’ve spent a couple of weeks working on an Android project for a client, writing it in Oxygene for Java. More on that in another post.

I’m hoping to be making plenty of noise about this product over coming months in various forms, but until the next post, just note that Oxygene for Java is now available at the RemObjects store.

Thursday, 15 December 2011

Android emulator speedy alternative?

I was very tempted to test out Android-x86 in a VM as per Thierry Delprat’s nice step-by-step tutorial How to speed up the Android Emulator by up to 400%. The article runs through how to take an .iso image targeted at an Eee PC, install it on a VirtualBox VM, tweak the display attributes to look like a telephone and then register its network address with Android’s adb tool to allow it to be accessed from Eclipse or Oxygene for Java.

The result is a lightning fast start-up time and a very performant emulator replacement.

However there are evident problems with this option. Firstly, it’s not an emulator – it’s not running ARM code as the emulator does. It’s running x86 code. But also, only the core open source Android libraries are ported to Android-x86. Proprietary libraries such as the Google Maps API are absent and a lack of approval from Google means they won’t be making their way to Android-x86 any time soon.

Given that the project that has occupied my time lately required use of the Google Maps library, that rather meant that Android-x86 was a non-starter. Though I may have a go for the next project…..

VCL to FireMonkey converter

Those of you getting to grips with Delphi XE2 and its portable and powerful FireMonkey component library will perhaps have wondered at the effort in porting VCL code to this new framework. manual conversion is very achievable but rather time-consuming and very laborious.

So it was with interest today that I happened upon Mida, a tool for doing the ‘grunt-work’ of the conversion. Some of the Mida features include:

  • support for converting around 250 components
  • converts VCL data-aware controls to FireMonkey controls with appropriate LiveBindings set up
  • support for custom component conversion for cases of components not yet covered by Mida
  • support for updating source code that is known to not be FireMonkey-compatible

Mida is being developed by Mauro Botta and seems to be getting regular updates and enhancements. You can read about Mida, which costs €99 or $US133, at its website or blog or Facebook page.

Delphi and Windows 8

As many of you will be aware, the upcoming version of Windows, Windows 8, will be based around the Metro user interface, currently used by Windows Phone 7.x. This major UI change heralds a new programming challenge for Delphi developers, as Metro uses Xaml controls and requires use of a new Windows API called WinRT, which I gather was announced in September 2011.

WinRT is COM-based, but programming against it won’t require too much raw COM thanks to higher-level ‘projections’ for any given client language.

Windows 8 is still some way away, but if you want to get a flavour of how Delphi can already partake in the Windows 8 experience, pop along and see the hard work done by Thom Gerdes in his Writing Hello World for WinRT in Delphi article. For a more C++ oriented approach to Windows 8, also take a look at Ian Griffiths’ articles Real Native WinRT Development and Native WinRT Inheritance.