X-plat tooling

What are the right tools to create cross-platform applications?

In the last two days I've been attending the community open day at Microsoft. One of the sessions was about cross-platform (I just abbreviate it x-plat) development. The session itself was fairly broad and only provided common knowledge. Nevertheless, the talk actually resulted in an interesting discussion. In this post I want to present the major views and my opinion related to the topic.

First of all we should distinguish between kinds of x-plat strategies. Do we want to program for a single form factor across platforms, or across form factors within the same platform? Or do we even want to go x-plat without obeying to the same form factor? For simplicity (and to stay coherent with the discussion after the formerly mentioned session) I will limit myself to the first scenario: Same form factor, but x-plat. The second scenario is conquered, e.g., via universal apps (in the Windows world; other platforms may offer other solutions). I am not aware of any available solution for the third scenario. I would argue that a combination of Apache Cordova together with nw.js would be the way to go here. At least this comes close to a proper solution.

Coming back to the first scenario. What options do we have here? Obviously Apache Cordova is a contender. There are plenty of available IDE available. We could use the Intel XDK, Microsoft's Visual Studio, Eclipse or our own solution based on the official command line tools. I do not want to list all the other HTML5 / JavaScript options, since they are playing in the same ballpark. The next contender is Xamarin, which gives C# developers the option to write a single codebase for three platforms (iOS, Android and Windows Phone). I will omit three more contenders: Sencha, Unity and Qt. The latter is interesting, because usually get the best performance (sometimes even better than with the Xamarin solution).

So what is better: Apache Cordova (HTML5 / JavaScript) or Xamarin (C#)? The audience was divided. Some thought that Xamarin is more than a mess and Cordova feels natural. Others felt that Xamarin offers a mature solution, which feels much more native on the various platforms. It was obvious that web developers seemed to prefer Cordova, while client devs tended to use Xamarin.

My opinion on that matter is simple: If a lot of code already exists in one or the other language (JavaScript or C#), then the corresponding tooling (Cordova or Xamarin) should be picked. Otherwise, if the project is rather small and functionality is worth more than look and feel, any HTML5 solution should do the job. In any case, if we want a superb looking application, that also feels natural on the respective platform, we should aim for Xamarin. Smaller apps might be well-suited for using Xamarin forms. Here we do not even have to create a proper UI for every platform. If that is not the case, then we shouldn't worry about creating new looks for every platform.

Adjusting the look and feel is actually crucial. One of the most important aspects in going x-plat is the separation between layout and logic. The logic should be independent of the platform. The layout could be shared depending on the scenario, however, in general we have to respect the uniqueness of the platform. This comes with certain responsibilities. We should follow the design guide of a particular platform. We also should place animations and behaviors as usually used within a given system.

Should we worry about different layouts for different platforms? No, not at all. It will show our customers that we care. We care a lot. We respect every system, where we roll out our software. Is it always required to have different layouts? No, there are cases where a unified layout is sufficient or makes even more sense (e.g. games, which come with their own kind of behavior and layout anyway).

Choosing the right tool for the task is not trivial and highly project dependent. There is no absolute solution. The only thing we can do is discuss possible solutions and work out their advantages and disadvantages.

Created .

References

Sharing is caring!