On this page
- Native mobile application capabilities
- UPDATE Nov 2021
- Mobile application strategy
- Developing native apps for iPhone/iPad/iPod Touch
- Developing native apps for Android
- Developing native apps with Appcelerator Titanium
- IMPORTANT
- Developing native apps with Apache Cordova (formely PhoneGap)
- Developing native apps with Google Flutter
- Additional resources
Native mobile application development
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:
- All about Progressive Web Apps and Implementing it in Drupal 9.
- Progressive Web App (PWA) integration with Drupal.
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:
- Waterwheel Swift - provides classes to natively connect iOS, macOS, tvOS, and watchOS applications to Drupal 7 and 8.
- Drupal 8 iOS SDK - SDK and sample app to connect native iOS app with D8
- Example iOS app for Drupal 8 - Very simple iOS example app that uses AFNetworking 2.x and works on generic Drupal 8 iOS SDK based on this app is going on. To join this development please contact Vivek Pandya or Jeff Linwood.
Other Examples/Projects:
- DrupalRESTKit: https://github.com/vivekvpandya/DrupalRESTKit
- Tips&Tricks AFNetworking: https://github.com/vivekvpandya/TipsAndTricksAFNetworkingDrupal
- Tips&Tricks NSURLSessionAPI: https://github.com/vivekvpandya/TipsAndTricksCFNetworkingDrupal
- Demo: https://www.youtube.com/watch?v=iny71Kwgn_I
Developing native apps for Android
- One Drupal – Content Builder - Login, Create & edit nodes, Upload images, Autocomplete term reference fields, Publish, Unpublish, Promote to front page, remove from front page(Demote).... with a source repository on Github
- DrupalCloud - Android library for Drupal Services by INsReady Inc. (引锐信息科技有限公司)
- My Android application for TShirtSlayer - discussion of an Android, Drupal, XML-RPC app, with a source repository on GitHub
- Building Android Apps with Drupal - Presentation at DrupalCon Denver 2012 by Jingsheng Wang
- Architect your business with Drupal and Android - Business and strategy presentation from DrupalCon Chicago 2011 by Jingsheng Wang
- Drupal 8 Android SDK - SDK and sample app to connect native Android app with D8
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:
- Introduction to Using Titanium with Drupal Services - presentation by Stephen Barker at Florida DrupalCamp 2012
- Rapid native mobile app development with Drupal and Titanium / PhoneGap - presentation by Scott Falconer at the Pacific Northwest Drupal Summit 2012
- Titanium API Group Discussion Group for Drupal and Titanium
- Developing Apps for iPhone/iPad/Android using Drupal as Base System - Presentation on using Titanium to build iPhone and Android apps for Drupal by Sumit Kataria
- Creating an iPhone App for a Drupal Website- case study about building an iPhone app for Drupal using Titanium
- DrupalCon Chicago 2011 App Source Code - large example Titanium application for Drupal
- Mobilizing DrupalCon Chicago - Larry Garfield shares a case study about building the DrupalCon Chicago 2011 app with Titanium
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:
- Drupal Plugin for PhoneGap for iOS, which makes the Drupal iOS SDK accessible through PhoneGap.
- DrupalGap - An open source mobile application development kit for Drupal websites, with PhoneGap and jQueryMobile.
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:
- Web services
- Services module
- Content API module - provides additional ways of accessing content through Services
- JSON:API (only for D7, since the module is part of Drupal core in D8/D9). See JSON:API vs. core's REST module article for comparing both approachs to expose your data from Drupal.
- Using Drupal Views
- Services Views - provides a Views resource for the Services module
- Views Datasource - provides representations in JSON, XML, RDF, xHTML microformats, Atom, and several other formats
- Views Atom - Creates an Atom-formatted View for the "Feed" display type
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion