Saturday, 28 May 2011

Native Android development for Delphi programmers

As you may know, and indeed as I have written about, Mono for Android has taken a bit of a hiatus. While it is still expected to be a viable development tool, and still a very convenient option for .NET developers, I thought it would be prudent to look up other options and ensure I covered various angles.
Naturally I considered regular Java development, using wither Eclipse or IntelliJ. However getting to grips with distinguishing the idiosyncrasies of one C-based language from another (Java vs. C#') wasn’t enormously high on my agenda.
It turns out there is another option looming on the horizon, which should be of high interest to Delphi developers.
“Diane, I'm holding in my hands a small box of chocolate bunnies.”
If you’re in the Delphi world you should already be aware of RemObjects Oxygene compiler for .NET, sold as Delphi Prism by Embarcadero. Oxygene for .NET is a native compiler that generates .NET executables. It encompasses all the latest aspects of the .NET framework and makes them available in a Delphi-like Pascal-based syntax, but doesn’t trouble itself with supporting decades of legacy DOS and Win16/Win32 specifics that have no purpose in the managed .NET world. This gives a smooth, fast .NET compiler that works very nicely from within the Visual Studio development environment.
“Diane, never drink coffee that has been anywhere near a fish.”
Coming later this year from the same stable is Project Cooper. This is the same Oxygene compiler offering the same Delphi-like language but generating code for the Java VM. It is in early stages of development as yet, but is already showing great promise. You can see a video of an early build here.
“Oh Diane, I almost forgot. Got to find out what kind of trees these are. They're really something.”
Of course, targeting the Java VM means it is ideally suited for developing native Android applications, and already does so even at this early point. I’m currently testing out Project Cooper, getting to know how to use the Android SDK more directly (i.e. not through the Mono for Android layer), and planning on what to put in a couple of talks I have planned on the product.
“Diane, I am now upside-down.”
On 14th June I’ll be talking to the Developers Group about Project Cooper in London. Then on 17th June I’ll be in The Netherlands talking about it at an SDN event.
I’m also hoping to write about the product as it develops its way towards release, showing how to accomplish various things that Android apps commonly need to do using Project Cooper.
“Harry, I have no idea where this will lead us, but I have a definite feeling it will be a place both wonderful and strange.”
Before signing off this time, I have to say that, given the lack of space on my Android phone I’m really enjoying the native app sizes you get from Project Cooper. And being a Delphi developer since 1994 (yes, I know it came out in 1995) the language fits like a favourite glove. So, right now I’m rather pleased Mono for Android has a 4 month break so that I can enjoy getting to know Project Cooper.
“Damn fine coffee! And hot!”
Oh. And in case you are wondering, Project Cooper is named after FBI Special Agent Dale Cooper from the classic series Twin Peaks by David Lynch.


Update 1: Project “Cooper” was released at the end of November 2011 by RemObjects under the name Oxygene for Java and can be purchased from the RemObjects store.

Update 2: I've started writing some articles on Project “Cooper”, or Oxygene for Java as it is now called. If interested, you can find them on my web site here, and of course you can see all my Oxygene for Java blog posts by clicking on the Oxygene for Java filter link just below.

Friday, 20 May 2011

Mono for Android and MonoTouch status change

Anyone who keeps an ear to the Mono world will have doubtless heard of the recent corporate changes that have impacted the Mono product line. For some while Novell have owned Mono, having previously absorbed the original developer, Miguel de Icaza, and his company, Ximian. Recently, Attachmate completed their acquisition of Novell and there have been the usual consequential streamlining processes occurring.
One of the casualties of this process is the Mono team, who were all released. This means that formal development of the commercial tools MonoTouch for iPhone development and Mono for Android for Android development have now halted. There’s been little noise on this subject from Attachmate, but the current thinking is that people who’ve already bought these products are still entitled to support. How supportive this support turns out to be is, perhaps, questionable. Certainly the store mechanisms that allow purchasing of MonoTouch and Mono for Android licenses have been disabled.
I should just add at this point that these events should not affect Mono itself, which is and always has been an open source platform. It’s the commercial tools for iOS and Android that are primarily affected.
For those who have been taking advantage of the homely feel of .NET development for iOS and Android devices, this news has set the cat among the pigeons, or thrown a spanner in the works, or whatever your preferred cliché may be. However, all is not lost.
As soon as Miguel and his team were let go, they immediately set up Xamarin. Xamarin is already working on producing API-compatible tools, similar to MonoTouch and Mono for Android, currently named .NET for iOS and .NET for Android respectively. The projected time for these tools is 3-4 months with the iOS product coming first.
Clearly this 4 month gap may prove logistically troublesome for some, but if you have already bought one of the Novell tools you can carry on working with it with an eye to switching to the Xamarin equivalent towards the Autumn.
If this time window is too much, well, you can always spend some time picking up native Objective-C skills or learning Java and use the normal development process in Xcode or AppCode for iOS, or Eclipse or IntelliJ IDEA for Android.
It seems that interest in the Mono-based tools continues. Various scheduled conference talks around the world on the topics are still going ahead rather than being cancelled. Personally, I will still be talking on Mono for Android at a Dutch User group (SDN) event in June.
That said, the timing of this unsettling news is not great for me as I’d started work on a series of tutorials for Mono for Android. I’ll probably put them on hold until the Xamarin products show some life, but since I’d finished the first one, I’ve put it on my web site. It’s looks at how you get going with Mono for Android and looks at the way Android applications operate, to get you started in the Android world, from a Mono for Android perspective. You can find the tutorial here on my web site.

Update: In case you came here and weren't aware of news happening in between when this was written and now, Mono for Android and MonoTouch came back and are flourishing away now.
Update: The introductory article mentioned is somewhat out of date now, but I have recently updated it to work with the current Mono for Android v4.

Alternative to Eclipse for Java development

If you find Eclipse a little clunky for Java development, then you might take a look at JetBrains IntelliJ IDEA Community Edition, which is intended to offer a smoother experience developing Java apps, with support for Java 7, JUnit and TestNG, Maven and Ant, Groovy, Scala, Clojure, Subversion, Git, Mercurial and CVS, as well as Swing UI design.

It also supports Android app development, including the latest Android SDK.

Alternative to Xcode for Mac development

Whilst on the subject of what JetBrains is up to, I recently learned that they are working on an alternative to Apple’s Xcode for Mac programmers who are building OS X and iOS applications in Objective-C.

AppCode is still under development, and an EAP (Early Access Program) is available. AppCode being pushed as an alternative to the Apple IDE, with various refactorings and active code analysis and intelligent Code Completion, as well as a debugger.

This will likely appeal to developers who have used JetBrains ReSharper in Microsoft Visual Studio but are expanding over to the Mac world to develop Mac or iPhone applications.

Alternative to Reflector available

Tools vendor JetBrains have announced development of an alternative to Reflector.

You’ll recall that Reflector was originally developed and maintained by Microsoft’s Lutz Roeder and for many years was a free tool. Not so long ago it was taken over by Redgate Software and remained free for a while, but then got a price tag attached to it (you can have a 14-day trial but after that it will cost you $35 or £20.

JetBrains have announced dotPeek, which is to do similar things to Reflector and will be free forever. An Early Access Program (EAP) is now open and you can download an early build and have a play.

Like Reflector, it supports navigating to types, symbols and members, will decompile to C#, support searching, support source servers, locate derived symbols, use syntax highlighting and so on.