Building Stunning UIs with C++ and FireMonkey

by May 16, 2018

With many companies taking the “mobile first” approach, building applications that work on multiple platforms is a requirement for success.
Developers who know how to build for more than one platform are in demand, while application users have become accustomed to stunning UIs and intuitive UX.
Normally, mobile app development requires learning multiple programming languages and tools like iOS’s Xcode or Android’s Android Studio, then replicating the same functionality for each platform’s display and unique UI requirements. With FireMonkey, there’s a better way.
FireMonkey, also known as FMX, is the multi-device application framework behind C++Builder. It is designed for teams building native apps for Windows, macOS, Android and iOS, and getting them to app stores and enterprises fast.  With C++Builder, we provide a full application stack: providing user interface, database, networking, inter-device communication, and other libraries across all platforms.

 

Do This to Stop Duplicating UI Work
With other tools, an app developer might create an iOS user interface using the default vendor tools in Xcode and Swift, and an Android user interface in Android Studio and Java or Kotlin. Despite being very similar, these efforts are entirely duplicated with no shared work. Even with other cross-platform solutions, the amount of shared work is limited. For example, Xamarin.Forms focuses on cross-platform development, but a lot of effort is duplicated since you need to interface in Swift (iOS) or Java (Android) to create anything non-standard. 
With FireMonkey, a developer creates an interface once. Developers can easily make per application or per platform level application tweaks. For example: in the iOS version ensuring one control is presented using the native implementation; then in Android, adjusting spacing and colors for material design. The only language you need to use is C++: all controls and UI interaction is in C++, and you don’t need to mix languages or create translation layers. Just bring your existing C++ code right into a native C++ app.

 

 
Shown: Native UI styling on Android and iOS with the ability to easily tweak button styles and more
Compared to other development tool vendors that only offer a small amount of controls, RAD Studio and C++Builder include hundreds of controls that can be used in multi-device applications, and has a rich 3rd party ecosystem. 
 
Building the User Interface
FireMonkey provides a large library of UI controls, including buttons, lists, input controls, switches, toolbars and more.You can leverage built-in pixel perfect native platform styling or apply fully custom themes to your application UI to match your company’s brand guidelines.
In addition to a full library of GUI controls with platform and custom styling support, we are providing a number of platform specific controls, such as input controls, and scrollable lists that can be implemented at runtime by the underlying operating system. This is supported on iOS and Windows, and we plan to bring this functionality to Android and macOS. This provides ultimate flexibility for developers building multi-platform applications.
As part of our IDE, we provide a visual designer. For FireMonkey, we call this the FireUI multi-device designer. The multi-device designer is extremely powerful and at the core of our multi-device application development approach: It allows you to design a user interface once, and create variations per device. This is a vast time and development saving.
C++Builder provides a set of predefined views, including Windows Desktop, Mac Desktop, iPhone, iPad, and several Android Phone and Tablet optimized views.
Views are a mechanism that allows you to define a different layout and components for the forms of your application depending on the device where your application is running.

 

  

 
The Multi-Device Runtime Library and Power of Components
FireMonkey relies on a multi-device runtime library that includes threading and parallel programming support, file system access, local and remote database access for relational and noSQL databases, HTTP and REST client library, specific Cloud and BaaS clients, and components for directly accessing embedded devices like GPS, gyroscope, and Bluetooth systems. All of these features are exposed with ready-to-use components and work the same way across all supported platforms, so developers can write single source applications leveraging device capabilities and data connectivity. 
Platform Specific API Calls
One concern often expressed by application developers evaluating cross-platform solutions is that they focus on the ‘lowest common denominator’, and provide a black box to developers, so to speak. If a component is not provided, whether that is maps support or in-app advertising, developers are mostly shut out from adding that functionality into their application. This is not the case with FireMonkey.  We provide full-featured and very powerful libraries in their own right, as well as full access to the native platform if required.
For example, the FireMonkey framework does not provide a device info component for quickly querying the device name and OS version. Given that you can access the native platform APIs through both our JNI Bridge on Android and our Objective C Bridge on iOS, you’re not blocked from accessing this functionality.

Summary
  • Customers expect stunning UI and intuitive UX and their apps to be available on their favorite devices
  • Building separate UIs is one of the lengthiest processes in application design for multiple platforms. Using vendor tools and other cross-platform frameworks requires a lot of duplicated effort for each target platform – something C++Builder developers using FireMonkey do not face
  • UI Customization is easy thanks to the FireUI Multi-Device Designer
  • C++Builder provides a large number of built-in, ready-to-use components and a rich 3rd party ecosystem
  • Accessing platform specific APIs is easy with C++Builder
 
Ready to have a look? Start a free 30-day trial today.