The Complete Magazine on Open Source

Tools to develop cross-platform mobile apps

SHARE
/ 10012 0

Main

Trending in the mobile application development world are cross-platform mobile apps. There are a great many tools and frameworks available for this specific purpose. This article offers a selection of what the author considers the five best cross-platform app development tools. A word of caution though—some of these tools come with certain strings attached.

With the increasing number of smartphones and tablets being used all over the world, mobile app development is becoming a major attraction among technologists, developers, enterprises and even everyday users. Android and iOS have become the main platforms for smartphones. With the aim of providing all sorts of services and improving business processes, companies today focus on creating the most effective and easy-to-use applications on smartphones.
The current requirements for mobile application development are cross-platform tools (CPTs), which enable developers to build apps that can be supported on both Android and iOS platforms.
Today, we have numerous CPTs available, but every development platform has its pros and cons. Ultimately, which CPT the developer chooses depends on the needs and goals of the app-based business.
Popular open source CPTs available are Sencha Touch, PhoneGap (Apache Cordova), Appcelerator Titanium, Qt and Xamarin SDK.
Let us delve deeper into these tools to get an idea of their unique features.

Figure 1

Figure 1: Sencha touch

Sencha Touch
Sencha Touch is an open source cross-platform mobile app development tool written in JavaScript. It supports development on all platforms like Android, iOS, BlackBerry, Kindle, Windows Phone and Tizen. It is a user interface JavaScript library or framework built specially for the mobile Web. It is used to develop GUIs for mobile Web applications, making the apps look like native applications on mobile devices. Sencha Touch is a product of Sencha, which was formed after popular JavaScript library projects Ext JS, jQTouch and Raphael were combined. It offers an MVC style architecture, an extensible API, a vast UI component library and several UI themes that can be used with the Sencha native packager and also PhoneGap.
Its features are listed below.

  • Faster layouts: The layout components are faster and, in turn, make apps run faster. The orientation of the layout is highly attractive and advanced.
  • Cordova support: Supports Apache Cordova APIs for the accelerometer, camera, capture, compass, connections, contacts, device, events, files, geolocation, InAppBrowser, media, notifications and storage.
  • HTML5 device APIs: A lot of native device APIs can be added to the packager API surface, which make it compatible with all Web browsers.
  • Native packaging: This inbuilt feature of Sencha Touch can now package applications for mobile platforms such as Android and iPhone.

Apache Cordova/PhoneGap
Apache Cordova (formerly known as PhoneGap) is an open source mobile application development framework originally created by Nitobi. After Nitobi was bought out by Adobe Systems, the company redesigned PhoneGap and released the software as Apache Cordova, which allows developers to use Web technologies like HTML5, CSS3 and JavaScript for cross-platform development. Cordova facilitates wrapping up of CSS, HTML and JavaScript code, depending on the platform of the device. The core of Apache Cordova applications makes use of CSS3 and HTML5 for rendering, and uses JavaScript for logic. In order to access hardware like the accelerometer, camera and the GPS, HTML5 is being used. Cordova can also be extended with native plugins, which add more functionalities via JavaScript, making the communication direct between the native layer and the HTML 5 page.
Apache Cordova supports the development of various mobile app platforms like iOS, Bada, BlackBerry, Firefox, Windows Phone, Android, WebOS, Symbian, Tizen and Ubuntu Touch.

Figure 2

Figure 2: Apache Cordova

The unique features of Apache Cordova are:

  • Cordova is regarded as a JavaScript API acting as a wrapper for native code and is consistent across devices. It is regarded as an application container with a Web view, which covers the entire screen of the device.
  • Cordova is bundled with predeveloped plugins to support access to the phone’s camera, GPS and file system.
  • Cordova installs just like native applications. It will produce an IPA file for iOS, APK file for Android and XAP file for Windows Phone.

Appcelerator Titanium
Appcelerator Titanium is an open source mobile app development framework for iOS, Android and Windows Phone from a single JavaScript code base. Appcelerator provides JavaScript API and native platform-specific features across devices. In addition to providing a development framework, it offers value add-ons including app analytics, Backend-as-a-Service (BaaS) and others. This tool has an edge in providing code reusability while creating native iOS and Android apps.

Figure 3

Figure 3: Appcelerator Titanium

Its features are:

  • Provides JavaScript based SDK with other 5000 APIs for iOS, Android, Windows, BlackBerry and HTML5.
  • Developers can make use of their Web development skills to build rich and fully native mobile apps for almost any mobile platform.
  • Reuses 60-90 per cent of code when supporting multiple platforms.
  • Has a cross-platform APU for accessing native UI components such as navigation bars, menus and dialogue boxes and native device functionality including the file system, network geolocation, accelerometer and maps.
Figure 4

Figure 4: Qt

Qt
Qt is an important cross-platform mobile application framework mostly used for developing application software that can run on various software and hardware platforms with little or no change in the underlying code base. Qt is mainly used for developing various application software with or without GUI interfaces like command line tools, mobile apps, etc.
Qt chiefly uses C++ with signal and slot extensions, which makes it easy when handling events and helps in both developing the GUI and the server applications. Qt supports many compilers like G++ and even Microsoft Visual Studio. It has a declarative scripting language called QML, which facilitates using JavaScript being integrated with any sort of development. With activated support for the development of various apps and software for desktops and mobile platforms, Qt declares the UI layouts using QML-JSON like declarative languages. It supports development in various platforms like Android, Embedded Linux, OS X, iOS, Windows Phone, etc.
Its features are listed below.

Qt Core:
1. WinRT: Support for native settings container.
2. QStorageInfo: A class for providing information about currently mounted storage volumes and drives.
3. QByteArrayList: Convenience class adding similar extra methods on top of QList.
4. QTabletEvent: Added information about which stylus buttons are pressed; rotation and proximity events.
Qt Widgets:
1. Improved scaling of widget styles based on DPI.
2. Android style; also works even when not using Ministro for deployment.
Qt QML:
1. Declarative State Machine (DSM): QML wrapper for Qt’s State Machine Framework.
Qt Bluetooth:
1. Support for Bluez5.
2. Preview of Bluetooth Low Energy.
Qt Web Engine:
1. New module with Web engine based on Chromium.
Qt GUI:
1. QOpenGLContext: Allows interoperability between Qt and other frameworks.
2. OpenGL is improved.
3. QOpenGLWidget: Modern replacement for QGLWidget.
4. QRasterWindow: Class for performing OpenGL drawing onto a QWindow.
5. WinRT: Added support for native file dialogues.
Qt Webkit:
1. Added support for OpenGL accelerated 2D canvas to QtWebKitWidgets.
2. OpenGL acceleration now also works with QOpenGLWidget.
3. Qt Webkit module is replaced by Qt WebEngine.
Qt is available in four editions: Community, Indie Mobile, Professional and Enterprise. The Community edition is available under the open source GNU License 2.1.

Xamarin SDK
Xamarin has created a robust cross-platform mobile application development platform that has been adopted by various IT tech giants like Microsoft, Foursquare, IBM, etc, using Ruby or C#. With the C# shared code base, developers use Xamarin tools to write native Android, iOS and Windows apps with native user interfaces and shared code across multiple platforms.
Xamarin offers two commercial products: Xamarin.iOS and Xamarin.Android. Both are built on top of Mono, an open source version of the .NET framework and can run on various platforms like Linux, UNIX, FreeBSD and MAC OS X.
On iOS, Xamarin’s Ahead-of-Time (AOT) compiler compiles Xamarin.iOS applications directly to native ARM assembly code.
On Android, Xamarin’s compiler compiles down to the Intermediate Language (IL) which is then Just-in-Time (JIT) compiled to the native assembly when the application launches.
The various products under the Xamarin platform are: Xamarin 2.0, Xamarin.Forms, Xamarin Test Cloud, Xamarin for Visual Studio, Xamarin Studio, Xamarin.Mac, .NET Mobility Scanner, RoboVM, etc.

Figure 5

Figure 5: Xamarin SDK

Xamarin’s features are listed below:

1. Objective-C, Java, C and C++ Interop: Xamarin provides a platform for directly invoking Objective-C, Java, C and C++ libraries, which provide the unique advantage of existing iOS and Android libraries being written in Objective-C, Java and C/C++.
2. Modern language constructs: Xamarin applications are written in C#, a modern language that includes significant improvements over Objective-C and Java such as dynamic language features; functional constructs such as Lambdas, LINQ, parallel programming features, sophisticated generics, and more.
3. Binding for SDKs: Xamarin contains bindings for the entire underlying platform SDKs in both iOS and Android. Being strongly-typed, they are easy to navigate and use, providing robust compile time type checking during any sort of app development.
4. Cross-platform support: Xamarin offers cross-platform support for three major application platforms – Android, Windows Phone and iOS. Applications can be written to share up to 90 per cent of their code.