Mobile Apps - Introduction to Development

With more patrons than ever interacting with institutions from their mobile devices, OCLC users have been expressing interest in developing their own mobile apps. OCLC offers support with new APIs and OAuth2 security patterns. In this blog post, we take a high level view of mobile app development for libraries, consider which devices to design for and look at framework selection.

Exposing data securely from the enterprise side requires planning, and this leads us to consider a mobile strategy.

Create a Mobile Strategy

Devising a mobile strategy for your institution involves choosing the data and services you wish to expose, creating a security strategy for the data exposed by the mobile app, choosing the devices you wish to target and selecting a development environment. By its nature, an institution mobile app is a "mash-up" of services from a variety of sources.

Here is a proposed plan for a general mobile app for a library that presents institution hours, location, exposes some institution specific databases and gives the patron access to their fines, loaned items and reserved items via an OCLC API. In addition we are targeting a broad range of patrons by going after both iOS and Android devices:

Item List
Services to Expose
  • Library Hours - Our Institution's Schedule API
  • Interactive Map to Our Locations - Google Maps API
  • Patron Data - OCLC WMS NCIP
  • Historical Document Collection Abstracts - Our Institution's History Database API
Security Strategy
  • Authenticate users and control access
  • Obtain Keys for OCLC services
  • Obtain Keys for Google Maps & Other Services
  • Consider exposing your institution's data - implement APIs with OAuth2?
Devices
  • iPhone, versions 4 and 5 running iOS 7
  • Android Phone, like Samsung Galaxy running Android 2 or higher
  • iPad, both mini and full size
  • Android Pad, like Nexus 7, Kindle Fire HD or Nook HD
Development Environments The selection of a development environment is considered in detail in "Native App vs. Webapp" and "Selecting a Development Environment." Here is summary of the considerations:


  • Native app - the kind you download from the Apple App Store or Google Play

    • iOS - XCode / Objective-C
    • Android - Eclipse / Java
    • Adobe Cordova - HTML 5 / CSS 3 / Javascript (possible cross device framework that could replace both the iOS and Android development environments)
  • Web App - associated with a URL and accessed through the mobile device's browser

    • HTML 5 / CSS 3 / Javascript
    • Note that writing a "web app" is similar to writing an app store app in Adobe Cordova above.
    • A webapp cannot access a mobile device's camera or other hardware like a native app can.

 

This is a bold plan - but it scopes out the final product as envisaged by the library's director. So how to get started? Well first, we have to make the decision between a native app and a webapp, and then pick our development environment.

Native App vs. Webapp

There are two ways to interact with your mobile users. The first is through their device's browser with a web app. The second is to provide a native app in the Apple App Store, Google Play or Amazon App Store (Android | Kindle).

Web App Native App
Pros Cons Pros Cons
  • Write once in HTML/CSS/JS and runs on multiple devices.
  • Can be conveniently updated without placing in Google Play or App Store.
  • Can be part of a combined mobile and pc UI strategy.
  • Excellent frameworks available for developers.
  • Requires user to remember URL and enter it into the device's browser.
  • Not available in App Stores.
  • Does not have access to device's hardware.
  • More likely to be used. Usage statistics. show that mobile users spend 80% of their time in native apps and just 20% in the web browser.
  • Available from App Store.
  • Has access to device's hardware.
  • Fast integrated user interface.
  • New frameworks ease development effort and work across multiple devices.
  • Two projects required: Objective-C (iOS) and Java (Android)
  • Getting App Store approval can be a hassle.
  • Cannot update as frequently as a web-app

Guide to Development Environments

We selected some popular web application and native application frameworks to suggest a good starting point for app development. Features that we value are cross-device compatibility and abstraction of boilerplate so you can concentrate on your app.

Web Apps   Native Apps
Frameworks Tutorials   Frameworks Tutorials
Sencha
 
Tutorials   iOS: Dev Center
 
Basic Tutorial
jQuery Mobile
 
Basic Tutorial   Android: Developers
 
Basic Tutorial
Kendo UI
 
Getting Started   Cordova: Getting started
 
iOS Basic Tutorial
Android Basic Tutorial
Intel App Framework
 
Basic Tutorial   Xamarin: Getting started
 
Basic Tutorial
Zepto
 
Essentials of Zepto   Corona SDK: Getting started
 
Basic Tutorial

Special Considerations for Developing Native Apps

Webapps are more familiar to traditional web designers because of their HTML/Javascript/CSS code base. Native apps require specialized tools to develop for the Apple (iOS), Android and Windows Phone and Blackberry markets.

There are two approaches:

  1. Write the app in the native language of the device. You have to write two separate apps - one in Objective-C for iOS and one in Java for Android. For example, start with iOS and develop a basic UI with basic API calls. Review that app with internal and external customers to refine the user experience and nail down the functionality.

    Once the iPhone App is complete, development can transition to Android. With the UI worked out, as well as the logic for getting through security and calling the APIs, Android Development is a matter of translating the concepts into Java, as the API calls and concepts are similar in both frameworks.

    A final step might be revising the UI's of both apps so that they work on larger iPads and Android tablets. Separate apps for tablets might be developed, making a total of four apps! Or the phone apps could be tested to make sure they work sufficiently on the tablets.

  2. Use a cross-device framework, like Adobe Cordova, Corona SDK or Xamarin. With this technique, you can write code for one app, depending upon which framework you choose. Unlike a web app, which is developed in a similar fashion, this app could be submitted to the Apple App Store or Google Play.

    Be aware there are still some differences between Android and iPhone that can be tricky to work with. For example, bar code scanning. Bar code scanning involves including native code libraries specific to Objective-C (iOS) and Java (Android). Careful research is required on multiple devices when using hardware intensive tasks to make sure they work properly with a "do everything" framework.

An Introduction to the Programmable Web for Library Developers

Through our developer network, OCLC provides many resources of interest to mobile developers:

In addition to OCLC's offerings, there are many data resources available on the web with more added each day. Here is a list of 100 APIs of interest to Library Developers from Programmable Web.

Note that when working with APIs, it is helpful to find an API Explorer tool as well. For example, Google documents their APIs and offers a Google API Explorer to test them. This is especially important as many sites require OAuth2 authentication, and an "API Explorer" can help you test the authentication process before coding it into the app.