Tag Archives: eclipse

Xamarin vs Titanium vs FireMonkey: should cross-platform tools abstract the GUI?

Cross-platform development is a big deal, and will continue to be so until a day comes when everyone uses the same platform. Android? HTML? WebKit? iOS? Windows? Maybe one day, but for now the world is multi-platform, and unless you can afford to ignore all platforms but one, or to develop independent projects for each platform, some kind of cross-platform approach makes sense, especially in mobile.

Sometimes I hear it said that there are essentially two approaches to cross-platform mobile apps. You can either use an embedded browser control and write a web app wrapped as a native app, as in Adobe PhoneGap/Cordova or the similar approach taken by Sencha, or you can use a cross-platform tool that creates native apps, such as Xamarin Studio, Appcelerator Titanium, or Embarcardero FireMonkey.

Within the second category though, there is diversity. In particular, they vary concerning the extent to which they abstract the user interface.

Here is the trade-off. If you design your cross-platform framework to include user interface widgets, like labels, buttons, grids and menus, then you can have your application work almost the same way on every platform. You can also have tools that build the user interface once for all the platforms. This is a big win in terms of coding effort. If the framework is well implemented, it will still adopt some of the characteristics native to each platform so that it looks more or less native.

Some tools do this by drawing their own controls. Embarcadero FireMonkey is in this category. Another approach is to use native controls where possible (in other words, to call the API that shows a button, rather than drawing the button with the graphics API), but to use custom drawing where necessary, even sometimes implementing a control from one platform on another. The downside is that because those controls are not in fact native, there will be some differences, perhaps obvious, perhaps subtle. Martin Fowler at ThoughtWorks refers to this as the uncanny valley and argues against emulated controls.

Further, if you are sharing the UI design across all platforms, it is hard to make your design feel equally right in all cases. It might be better to take the approach adopted by most games, using a design that is distinctive to your app and make a virtue of its consistency across platforms, even though it does not have the native look and feel on any platform.

Xamarin Studio on the other hand makes no attempt to provide a shared GUI framework:

We don’t try to provide a user interface abstraction layer that works across all the platforms. We think that’s a bad approach that leads to lowest common denominator user interfaces.*

CEO Nat Friedman told me. He is right; but the downside is the effort involved in maintaining two or more user interface designs for your app.

This is an old debate. One of the reasons IBM created Eclipse was a disagreement with Sun over the best way to design a cross-platform user interface framework. Sun’s Swing framework, derived from Netscape’s Internet Foundation Classes first released in 1996, takes the custom-drawn approach, which is why Swing apps always look like Swing apps (even if you apply the “Windows” look and feel). A team from IBM, some originally from Object Technology International which was a company acquired by IBM, believed it was better to wrap native controls with a Java abstraction layer, created SWT (Standard Widget Toolkit) to do that, and used it to build Eclipse.

Personally I am wary of toolkits which rely heavily on custom-drawn controls rather than native controls, though I see their value. On the other hand, Xamarin Studio is so far in the other direction that it removes some of the benefit of a cross-platform framework.

My prediction is that Xamarin will come up with its own GUI abstraction framework in future, along the lines of SWT. It is a compromise; but one which delivers a lot of value to developers who want to create cross-platform apps with the maximum amount of shared code.

*I have never understood this use of the term “lowest common demominator”. The LCD in maths is the lowest number into which a specific group of numbers divide exactly, so it is an elegant thing. In cross-platform what you should strive for is the highest common intersection: to make available all the features common to each platform.

Update: in April 2014 Xamarin announced Xamarin Forms, a GUI framework which wraps native controls in a XAML implementation (XAML is the presentation language also used by Microsoft, for WPF, Silverlight, Windows Phone and Windows Runtime (Windows 8) apps. There is a quick hands-on here.

LocationTech: a new Eclipse working group for location technologies

The Eclipse Foundation has announced a new working group, called LocationTech.

What is it? There is only one project currently, called LocationTech Technology.

Here is what it covers:

LTT projects provide artifacts such as libraries, user interfaces, and methodology logic that enable location aware applications and services. The nature of this work is scoped as follows:

  • Developing and delivering location aware services for web, mobile, and desktop based systems.
  • Storage, exchange, processing, and interpretation of massive data volumes with a component of spatial information
  • Apply Model based design in the context of geospatial information systems, building information modeling, and computer aided design
  • Aggregating and relating data from diverse sources including a spatial component. e.g. Analytics, Geospatial Business Intelligence, Geocoding, Routing
  • The implementation of generally applicable geospatial standards (e.g., Open Geospatial Consortium, ISO TC211, SQL MM, etc.)

The group is sponsored by IBM, Oracle, OpenGeo and Actuate.

Projects hosted at LocationTech benefit from a range of services, including git code repository, bugzilla bug tracking, hudson continuous integration, apache and drupal for a project dashboard, and “intellectual property services” covering licensing and related areas.

LocationTech is seeking involvement from OpenStreetMap (discussed here) and MapBox, among others.

Names not on the list of sponsors include Google and Nokia. Is this, perhaps, an effort to support location-based development in a manner that does not include a dependency on Google?

NVIDIA Nsight comes to Eclipse for Mac, Linux GPU programming

NVIDIA has ported its Nsight development tools, previously a plug-in for Visual Studio, to run within the open source Eclipse IDE for use on Mac and Linux.

image

The Nsight tools include profiling, refactoring, syntax highlighting and auto-completion, as well as a bunch of code samples.

The Windows version for Visual Studio has also been updated, and now supports local GPU debugging as well as new support for DirectX frame debugging and analysis.

Although Eclipse of course runs on Windows, Nsight users should continue to use the Visual Studio version. NVIDIA is not supporting use of the Eclipse Nsight on Windows.

The tools are in preview and you can sign up to try them here.

Another significant development is the availability of the CUDA LLVM Compiler. NVIDIA has contributed CUDA compiler code to the open source LLVM project. This means that other languages which compile to LLVM intermediate assembly language can be adapted to support parallel processing on NVIDIA GPUs. The CUDA Compiler SDK will be made available this week at the NVIDIA GPU Technology Conference in San Jose.

How to brew better software: The Monki Gras in London

I attended The Monki Gras in London yesterday, a distinctive developer event arranged by the analyst firm RedMonk.

This was not only a developer event, with the likes of Andre Charland and Dave Johnson from the PhoneGap team at Adobe, Mike Milinkovich the executive director of the Eclipse Foundation, and Jason Hoffman with Bryan Cantrill from cloud services (and Node.js sponsors) Joyent. It was also a serious beer event, complete with a range of craft beers, a beer tasting competition with nine brews to try, and a talk plus a free book from  beer expert Melissa Cole. An unusual blend of flavours.

image

In charge of the proceedings was RedMonk co-founder and all round impressario James Governor. I am a big fan of RedMonk and its developer-focused approach; it has been a fresh and heady brew in the dry world of IT analysts.

image

The Monki Gras did seem like an attempt by a regular IT conference sufferer to fix problems often encountered. The Wi-Fi worked, the food was fresh, unusual and delicious, the coffee was superb; though brewing good coffee takes time so the queues were long. Not everything scales. Fortunately this was a small event, and a rare treat for the couple of hundred or so who attended.

That said, there were frustrations. The sessions were short, which in general is a good thing, but left me wanting more depth and more details in some cases; we did not learn much about PhoneGap other than a brief overview, for example.

Nevertheless there was serious content. Redmonk’s Stephen O’Grady made the point succinctly: IT decision makers are ignorant about what developers actually use and what they want to use, which is one reason why there is so much dysfunction in this industry. Part of the answer is to pay more attention, and several sessions covered different aspects of analytics: Matt LeMay from bitly on what users click on the Web; Matt Biddulph (ex BBC, Dopplr, Nokia) gave a mind-stretching talk on social network analysis which, contrary to what some think, was not invented by Facebook but predates the Internet; and O’Grady shared some insights from developer analytics at RedMonk.

I had not noticed before that github now gets nearly double the number of commits than does Google Code. That is partly because developers like git, but may also say something about Google’s loss of kudos in the open source developer community.

Kohsuke Kawaguchi, lead for Jenkins Continuous Integration and an architect at CloudBees, spoke on building a developer community. His context was how Jenkins attracted developers, but his main point has almost limitless application:  “Make everything easy, relentlessly.”

Something I see frequently is how big companies (the bigger the worse) place obstacles in front of developers or users who have an interest in their products or services. Examples are enforced registration, multiple clicks through several complex pages to get to the download you want, complex installs, and confusing information. It all adds friction. If the target is sufficiently compelling, like apps on Apple’s app store, developers will get there anyway; but it all adds friction, and if you are not Apple that can be fatal.

The Joyent guys did not speak about Node.js, sadly, but rather on the distinction between a VP of engineering and a Chief Technology Officer. Sounds dry and abstruse? I thought so too, but the delivery was so energetic that they were soon forgiven. Hoffman and Cantrill moved on to talk about management antipatterns in the software industry, prompting many wry nods of recognition from the audience. “It is very hard for middle management to add value,” said Cantrill.

Milinkovich made the point that the most valued open source projects generally make their way to a software foundation; PhoneGap to Apache is a recent example. He then gave the talk he really wanted to give, noting that as new software stacks emerge they have a tendency to re-implement CORBA, a middleware specification from the Nineties that tackled problems including remote objects, language independence, and transactions across the Internet. CORBA is remembered for drowning in complexity, but Milinkovich’s point is that the creators of exciting new stacks like Node.js should at least research and learn from past experience.

Milinkovich also found time to proclaim that “Flash is dead, Silverlight is dead, browser plugins are dead.” Perhaps premature; but I did not hear many dissenting voices.

I tweeted the conference extensively yesterday (losing at least one follower but gaining several more). Look out also for a couple of follow-up posts on topics of particular importance.

What is the best way to choose a development tool?

Research company Evans Data sent me a link this morning to its new Tool Grader service. This is a simple web application for reviewing and rating software tools. The same tool may rated separately rated for different platforms. For example, there is one entry for Eclipse under UNIX/Linux, and another separate one under Tools for Mobile.

I took a quick look and rate the site mostly useless. There are not many reviews, and most of the reviews are of little value, for example “This Is The Best Programming Tool i Have Ever Used,” from somebody who says that Eclipse “Must be used as a competitor for Java.”

image

The site would improve of course if a lot of people were to use it; but currently there is little incentive to do so, since most developers will take one look and never return. Evans Data could do better; it has a ton of data from surveys it has conducted and if it were to take some of the more useful data from those reports and integrate it with the Tool Grader the site would be more valuable. It will not do that I guess because its business model is to sell those reports, and because it would be a lot of work.

It gave me pause for thought though. What is the best way to choose a development tool? Part of the problem is that context is everything. The same tool will be great for one purpose and poor for another; it depends what you want it for, especially when it is a multi-faceted product like Eclipse or Visual Studio, both of which are really tool platforms.

If you are looking for information on which tool will be best for your project, I doubt that either Tool Grader or even purchasing an expensive report will help you much. One approach that has value is to install several candidates and try them out, but it takes considerable time and effort. Another idea is to go along to an active community like Stack Overflow, describe your project in some detail including any constraints like “our developers span three continents” or “the boss insists we use Rational ClearCase for source code management”, and ask for opinions from other users.

When I am assessing a tool I always try to visit forums where it is discussed and get a flavour of the types of problems and queries users have. If there is little discussion that suggests the tool is most likely little used, usually a bad thing. If the vendor has no open discussion on its site and emphasises the “contact support” route that suggests a weak community. I also look for potential showstoppers like instability or intractable problems such as difficulty wresting acceptable performance from either the tool or its output.

I do not pretend it is easy though. Tool choices are important because they have a significant impact on productivity, and it is hard to change your mind once you and your team have invested money, skills and code in a particular product.

Eclipse and Xtend: some confusion in getting started

Last weekend there was some publicity around Xtend, an Eclipse project which extends Java with new language features. Xtend now has a new landing page, as announced by the lead architect Sven Efftinge.

I did intend to post about this yesterday, but I wanted to see it in action first, so I tried to download it and have a look. I believe this is a case where those who wrote the new landing page are too close to the project and made some assumptions, because I did not find it obvious how to proceed.

If you follow the Download link you are invited to paste one of the three URLs into the Eclipse update manager.

image

As a newcomer to the project, I did not want three URLs to choose from, I wanted just one. I picked Release as in general this one is likely to work.

Now, the instructions say:

To install the Xtend plugins open the update manager and paste one of the URLs on the right into the field ‘Work with’ and select the Xtend SDK.

The update manager actually presents you with a long list of updates, none of which say Xtend. I took a stab at what I thought was the right thing.

image

The All-In-One includes the Xtend SDK, which is what I want, right?

Wrong. After installation I could not find the tutorial which the docs said would be available.

I did some messing around with Eclipse and got the occasional error like this one:

image

Then I realised that I should have looked under the TMF Xtext-2.1.0 tree, which is where the correct Xtend SDK resides:

image

Except that if you find this helpful post by  Max Rohde you will know:

The other packages need to be selected since otherwise the Xtend editors will not work.

So you should select all of TMF Xtext-2.1.0 (or the latest release). Easy when you know, but not obvious since the word Xtend does not appear in the top node of the tree.

I was then able to create the tutorial project. I opened HelloWorld.xtend and got this:

image

Ah, but you have read Rohde’s post so you know this is expected and that you should run this as a JUnit Test. However it does not have any output. To see some output, you have to run one of the other examples, like Xtend08_RichStrings, or perhaps add:

sayHelloToSystemOut2(‘Tim’)

to the testHelloWorld() method in HelloWorld.xtend.

image

OK, it works.

So what is Xtend? It is essentially a code generator which lets you write in Xtend and generate Java. You can see the generated code in the tutorial project under xtend-gen.

image

Xtend adds some nice features: type inference, property syntax, closures, switch expressions with no fall-through, template expressions, extension methods, and multiple dispatch.

I can imagine C# creator Anders Hejlsberg smiling here, as most of this is already in C# in some form or other.

But is Xtend the right way to bring these features to Java? I am not convinced so far. It is an interesting Eclipse project, but it may be more significant in speeding the implementation of features like these into Java itself, than as a mainstream approach to writing applications. Xtend is a kind of hybrid approach, where you will be switching between Java and Xtend while you code and debug your application, and I suspect it would get frustrating.

There is also the question of widespread community support – beyond Eclipse.

Finally, it would be good if the new landing page could be made more helpful for those getting started.

Android only 23% open says report; Linux, Eclipse win praise

Vision Mobile has published a report on what it calls the Open Governance Index. The theory is that if you want to measure the extent to which an open source project is really open, you should look at its governance, rather than focusing on the license under which code is released:

The governance model used by an open source project encapsulates all the hard questions about a project. Who decides on the project roadmap? How transparent are the decision-making processes? Can anyone follow the discussions and meetings taking place in the community? Can anyone create derivatives based on the project? What compliance requirements are there for creating derivative handsets or applications, and how are these requirements enforced? Governance determines who has influence and control over the project or platform – beyond what is legally required in the open source license.

The 45-page report is free to download, and part-funded by the European Union Seventh Framework Program. It is a good read, covering 8 open source projects, including the now-abandoned Symbian Foundation. Here is the result:

Open Governance Index (%open)
Eclipse 84%
Linux 71%
WebKit 68%
Mozilla 65%
MeeGo 61%
Symbian 58%
Qt 58%
Android 23%

The percentages are derived by analysing four aspects of each project.

  • Access covers availability of source code and transparency of decisions.
  • Development refers to the transparency of contributions and acceptance processes.
  • Derivatives covers constraints on use of the project, such as trademarks and distribution channels.
  • Community structure looks at project membership and its hierarchy.

What is wrong with Android? I am not sure how the researchers get to 23%, but it scores badly in all four categories. The report observes that the code to the latest “Honeycomb” version of Android has not been published. It also has this to say about the Open Handset Alliance:

When launched, the Open Handset Alliance served the purpose of a public industry endorsement for
Android. Today, however, the OHA serves little purpose besides a stamp of approval for OHA
members; there is no formal legal entity, no communication processes for members nor frequent
member meetings.

By contrast, Eclipse and Linux are shining lights. MeeGo and Mozilla are also praised, thought the report does mention Mozilla’s “Benevolent dictators”:

In the case of conflicts and disputes, these are judged by one of two Mozilla “benevolent dictators” – Brendan Eich for technical disputes and Mitchell Baker for non-technical disputes.

Qt comes out OK but has a lower score because of Nokia’s control over decision making, though it sounds like this was written before Nokia’s Windows Mobile revolution.

WebKit scores well though the report notes that most developers work for Apple or Google and that there is:

Little transparency regarding how decisions are made, and no public information provided on this

Bearing that in mind, it seems odd to me that WebKit comes above Mozilla, but I doubt the percentages should be taken too seriously.

It is good to see a report that looks carefully at what it really means to be open, and the focus on governance makes sense.

Appcelerator has released Titanium Studio, IDE for cross-platform mobile development

Appcelerator has released Titanium Studio, an IDE built with Aptana, the Eclipse-based IDE which the company acquired in January. It is an interesting products because it lets you build cross-platform mobile apps for Apple iOS, Google Android, and Blackberry, as well as desktop applications.

I downloaded the community edition and gave it a quick try. The download includes the Titanium SDK and is around 150MB.

Titanium Studio wanted to grab file associations for CSS, JS and PHP by default – but at least it asked first

image

I noticed lots of Python scripts getting installed. The install completed and I was up and running.

Running the IDE requires login, which seems intrusive. You can avoid this by going offline.

image

I created a new empty Android 2.2 project and got an error on first run. Required jarsigner not found. Required javac not found.

image

I fixed this by adding the JDK to the path and setting Java_home to the JDK; previously my Adobe CS5 install had set this to its own JRE install.

Next, I built a hello world application.

image

It feels like a version 1.0 release. When I clicked Run it started the emulator but did not run the app for some reason. A second run after the emulator had opened worked. Code Assist seems a bit hit or miss. There it tooltip help for some keywords, but too brief to be much use, and pressing F1 is unrewarding. No visual GUI designer. Finally, and this is purely a personal thing, the editor has a black background – something I will be sure to change soon.

Nevertheless, this is a step forward for Titanium and presuming the apps perform well I think it is significant and worth investigating.

Mobl: a new language for mobile applications, with Eclipse integration

It has gradually dawned on me that, contrary to first appearances, the Apple iPhone and iPad do come with a capable application runtime for those who would rather not tangle with Objective C; and one on which you can run applications without the hassle of negotiating the App Store. This runtime is the WebKit-based browser and JavaScript engine. This is for web apps of course; but as noted in my look at NS App Studio last week, you can blur the boundaries between web and local by creating a local shortcut and designing your app to work offline. Here is the Apple documentation, which notes:

Offline application support is available in iOS 2.1 and later and in Safari 4.0 and later

So you can do offline. There is also a local database, based on SQLite, documented by Apple here – putting iOS ahead of Windows Phone 7, which has no built-in relational database for Silverlight applications. Another plus is that other WebKit-based mobile browsers should work as well, including the one in Android devices.

It is possible to create application frameworks that wrap these features into a single development platform that compiles to JavaScript, HTML and CSS. PhoneGap is one example, and NS App Studio another; but today Reddit alerted me to another, Mobl, which has a modern feel and benefits from Eclipse integration. It is also free and open source, and with the right community momentum looks like it could be interesting.

Mobl is a statically-typed language with a syntax similar to Javascript – there is a guide and language reference here. The goal is to create a complete DSL (Domain Specific Language) for mobile development, which according to the web site:

Integrates all aspects of a mobile web application into a single language: data modeling, user interfaces, application logic, styling and web services.

The main author is Zef Hemel, from the Delft University of Technology in the Netherlands. Mobl makes use of Stratego/XT, which is a language and toolset for program transformation, and SDF  (Modular Syntax Definition Formalism), a language for defining syntax.

Mobl includes data modelling which handles object persistence and a concise language for defining user interfaces. AJAX support is built-in and there is integrated support for RESTful web services and for JSON (JavaScript Object Notation). The Eclipse add-in includes syntax highlighting, inline error reporting, code completion, and reference resolving.

All rather impressive for a project that has just burst onto the scene. I installed the Eclipse add-on and enjoyed its simple license:

image

“This software is distributed in the hope that it will be useful.” – though I have not found time yet to try creating an application.

There is more information on the nicely-designed website and blog and in the Google Group.

Update: thanks to @FransBouma for the link to the Mobl guide.