In a recent blogpost, the Facebook engineering team talked about finally arriving at the conclusion that Messenger needed to be a native app. While I’m glad they are seeing the light, they have reached the wrong conclusion about the trade-offs that come with being native. They believe you cannot develop in a cross-platform way and deliver a native app.
You absolutely can. Xojo creates native apps that are also cross-platform. It can be done. It’s just a matter of choosing the right framework. At Xojo, we didn’t take the easy path of drawing controls ourselves or using HTML5. We didn’t dumb things down to the least common denominator. We did the hard work of creating a framework with an API that manages the nuances, intricacies, and subtle yet important differences between 7 different platforms (macOS, Windows, Linux, web, Raspberry Pi, iOS and soon, Android) and multiple OS versions so you can focus on what makes your application unique. We have been doing it for over 20 years.
When discussing Facebook’s blog post, John Gruber of Daringfireball.net said, “…native apps are smaller, faster, and more reliable.”
Nearly every user interface element in Xojo is native. The one exception is the desktop Listbox because way back when, none of the desktop operating systems provided one. Everyone made their own. Having said that, the Listbox is made up of native controls. The scrollbar is a native scrollbar. If the developer makes the contents editable by their end user, a native TextField control appears. The headers are native controls. The advantages of native controls can’t be overstated, Facebook was right about that. Modern operating systems provide an ever-increasing array of features via their native controls and thus using them gives you immediate and nearly free access to these features. From focus rings to spellchecking to accessibility and more much, using native controls makes the most sense.
Event aesthetics come into play. Because the Xojo framework uses native controls, when Apple and Microsoft make changes to the look and feel of their controls, apps made in Xojo automatically change in appearance and behavior. Most recently, Apple added Dark Mode to both macOS and iOS and for most Xojo developers, adding this support required nothing more than indicating they wanted their apps to support it by clicking a checkbox.
While Xojo provides the developer with an easy drag-and-drop way to create their application’s user interface, it also provides a straightforward API for interacting with controls via code. The TextField control, for example, provides events that tell you when the control has appeared for the first time, when the user has changed the selection or the text itself, and even when they press down on a key or release it. There are properties to change the size, style and behavior of controls. And all of this is a level of abstraction that lets you focus not on the details of the platform but on what makes your application unique.
For example, under the hood for the desktop, Xojo’s TextField uses NSTextField on macOS, EditControl on Windows and GTKEntry on Linux. On iOS it’s the UITextField, on Android it’s EditText and on the web it’s <input type=”text”>. Each of these is very different but Xojo has done the hard work to provide a standard, straight-forward API so that you get the benefit of native controls without needing to learn the thousands of APIs and unique behaviors necessary to create a cross-platform app.
It’s not just controls. The Xojo cross-platform framework includes dialog boxes, menus, access to the file system, printing, sockets, database access and much more.
Native is more than the user interface. It’s also about performance. Xojo compiles to native code for each platform as well. Behind the scenes it uses LLVM, the same optimizing compiler that Apple, Google, Intel, AMD, Nvidia and many others use. Native code means native speed.
Thousands upon thousands of Xojo users have built cross-platform apps. The Xojo IDE itself and much of the Xojo framework are written in Xojo. So yes, we eat our own dog food. Studiometry and Property Me are just two of the many examples of commercial cross-platform apps written in Xojo. There are countless others.
We have also done this in a way that makes it easy for students and hobbyists to learn programming so they can take it into their workplaces and build business applications. In some cases, those citizen developers create something revolutionary and become full-time professional developers. That’s why the Xojo user community is so diverse.
So yes, you can create native applications that are also cross-platform. You just have to choose the right tool.