eZ Community » Learn » eZ Publish » Building native mobile applications...

Building native mobile applications with the eZ Publish REST API

Thursday 13 October 2011 4:21:48 pm

  • Currently 4 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

eZ Publish is a Web Content Management System that provides a platform to publish content via any channel. Its powerful presentation engine enables you to create websites and pages that display your content in a variety of renderings. Its powerful API directly and simply integrates your content with any web-enabled application on any device, such as the iPad, iPhone, or an Android device, without ever interfering with, or impacting the platform itself.

At the end of this tutorial, you will have learnt the basics of mobile application development for both iOS and Android platforms, consuming content from eZ Publish. CMS-side adjustments for the mobile channel will be acquired too. This cheatsheet will help you leverage the multichannel capabilities of eZ Publish, and its REST API in future projects, in a more systematic fashion.

 

Download as PDF

Introduction

This article is the second in a two-part series. The first article introduced the foundational concepts for mobile web development with eZ Publish by showing how to create a mobile siteaccess as well as basic apps that act as simple wrappers for that siteaccess. This document focuses on creating native mobile applications that communicate with eZ Publish via a REST interface.

Background

Native applications are applications designed to work on a specific device such as an iPhone or BlackBerry. Users download these applications from an app store or through an internal enterprise program. The main advantage of native applications is that they offer access to built-in device features such as cameras or GPS functionality. Native applications often perform better than other types of apps, as they live on the device itself. These applications can also present unique marketing opportunities if they are distributed via an app store.

Hybrid applications access the mobile website (which is also accessible through a URL outside of the app) through an app, bringing together features of both web and native applications. They are downloaded via an app store and look and feel like a native application, although they are simply displaying the mobile website. The main advantage of a hybrid application over a native application is that a consistent user experience can be enjoyed by a wider audience (via the mobile URL) while still making the most of the marketing opportunities presented by app store distribution. Changes are made on the web application end rather than requiring the user to perform the update manually via the app store.

 

Pre-requisites and target population

This guideline is aimed at eZ Publish developers, partners, and integrators who need to build and native mobile applications that communicate with the eZ Publish REST interface. It outlines the steps required to create web service enabled native mobile applications for eZ Publish. The instructions described herein assume that you have already set up eZ Publish 4.5 or higher. It is recommended that you read the eZ Publish REST API documentation, as the focus of this article is not to explain all of the details of the interface, but to show how to connect a mobile application to it. You should also be familiar with some basics about setting up an iOS or Android application, although anybody should be able to copy and paste the code examples to create a working application.

 

What do I need before I can start?

General requirements

  • Web server with PHP installed
  • Relational Database Management System
  • Installed eZ Publish 4.5 instance
  • Configured development environment for at least one platform: iOS (using Xcode) or Android (using Eclipse)

eZ Publish Requirements

  • OS: Linux 2.6, Windows 2008 (IIS 7 only)
  • Web Server: Apache 2.2.x (prefork mode), MS IIS 7 (with Microsoft URL Rewrite Module 1.1 )
  • DBMS: MySQL 5.0.x, MySQL 5.1.x, PostgreSQL 8.4, Oracle 11g
  • PHP (mod_php) + PHP CLI + apache: PHP 5.2.1 -> PHP 5.2.17, PHP5.3.x
  • PHP (FastCGI) + PHP CLI + IIS: PHP 5.3.x
  • Graphic handler: ImageMagick >= 6.4.x, PHP extension GD2
 

General guidelines for eZ Publish REST based mobile clients

  • List all the features necessary for the application
  • Determine who your users are and define a usage context
  • Do not block the main thread; always fetch data asynchronously
  • When communicating over a network, write code as robust as possible when it comes to failure handling
  • Minimize the amount of time spent transmitting or receiving data. Make use of pagination, and fetch only the data that is absolutely necessary.
  • Alert users if they are using your application when their device is set to “airplane mode”
 
36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)

Proudly Developed with from