Native mobile application development

Last updated on
11 November 2021

Drupal isn't just a web-based content management system - you can use Drupal as the back-end for mobile application development. Drupal can contain your content, business logic, user management, and search functionality, and your app can be a front end that talks to Drupal using the Services module.

Native mobile application capabilities

Building a native mobile application gives you two things that mobile web applications don't provide - distribution through mobile app stores and access to native functionality. Some things you can get with a native mobile application are:

  • Ability to charge for app in Google Play or App Store
  • In-app purchase and subscriptions through the App Store, Google Play, or other app stores
  • In-app advertising from native mobile app networks
  • Access to the device's camera to take images or video
  • Access to the device's file system for caching
  • Access to the device's contacts
  • Access to the device's accelerometer, gyroscope, compass, and map
  • Native map functionality
  • Background location awareness (starting with iOS 5)
  • Image filters (such as sepia, halftone, etc.) (starting with iOS 5)

Many of these things will be available to mobile web applications in the future, but native mobile applications are the only way to get many of these things right now.

UPDATE Nov 2021

At the end of 2021, an low-cost alternative to deliver native apps experiences are the Progressive Web Apps (PWA). They provide a subset of the native apps functionalities: look&feel, push notifications, offline work, device hardware access, etc. The good news is the existence of a Drupal module (Progressive Web App) that easily injects the PWA features into your Drupal site.

Useful articles about PWA Drupal integration:

Mobile application strategy

Before starting your mobile application development project, it helps to determine which platforms you want to target and whether you want to use platform-specific capabilities within your app. For instance, with iOS, you can have a mobile application that gets activated when your users cross a location boundary. Or on Android, your mobile application can be integrated with other Android applications using the Android Intent framework. Sometimes, you can access this functionality through cross-platform native mobile application development tools, but then you lose many of the advantages of cross-platform development.

You should also consider what technical skills your team has before chosen a solution. Android applications are typically written in Java, and iOS applications are written in Objective-C or Swift. These languages are significantly different from a typical Drupal developer skillset of PHP/SQL/HTML/CSS/JS. To make use of existing language skills, consider using either Appcelerator Titanium or Cordova PhoneGap to develop your mobile applications. Or the more recent Google Flutter platform.

Developing native apps for iPhone/iPad/iPod Touch

Apple's devices run the iOS operating system, and native apps running on iOS are generally written in Objective-C or Swift. You will need a Mac for iOS development that is capable of running Apple's XCode IDE. Connecting to a Drupal site running the Services module is very straightforward, especially with one of two HTTP libraries:

Waterwheel Swift provides a layer of abstraction on top of AlamoFire for working with Drupal nodes, files, users, and views. It works with iOS, macOS, tvOS and watchOS. Also, provides default view implementations to get you started quickly.

Things to consider when developing a native RESTful iOS app are caching strategies, using asynchronous methods to download data and then refreshing data as downloads complete, pre-fetching data on application load, and managing network timeout issues.

For more information about developing native mobile apps for the iPhone or iPad:

Links for these projects:

Other Examples/Projects:

Developing native apps for Android

Developing native apps with Appcelerator Titanium

IMPORTANT

The Appcelerator SDK offering will be discontinued and unsupported by March 1, 2022.

Appcelerator Titanium is a mobile application development tool that uses Javascript as the development language. Titanium produces both iOS and Android applications from one code base. Below are some resources that may be helpful:

Developing native apps with Apache Cordova (formely PhoneGap)

Apache Cordova (formely PhoneGap) is a native application wrapper for mobile web content that also provides access to device-level services. PhoneGap supports the iOS, Android, Windows Phone, and BlackBerry mobile application operating systems, and can run on both smartphones and tablet devices.

Several projects for integrating Drupal with PhoneGap exist:

Developing native apps with Google Flutter

Google Flutter is a UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded devices from a single codebase.

Additional resources

Several different ways of integrating Views into mobile applications exist. Depending on what you are trying to accomplish, you may want to consider one of these modules:

Help improve this page

Page status: No known problems

You can: