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:
|Services to Expose||
|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:
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|
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|
||Tutorials|| iOS: Dev Center
| jQuery Mobile
||Basic Tutorial|| Android: Developers
| Kendo UI
||Getting Started|| Cordova: Getting started
|| iOS Basic Tutorial
Android Basic Tutorial
| Intel App Framework
||Basic Tutorial|| Xamarin: Getting started
||Essentials of Zepto|| Corona SDK: Getting started
Special Considerations for Developing Native Apps
There are two approaches:
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.
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:
- Introducing Support for OAuth Flows for External Applications and Mobile Clients
- Authentication and Authorization: User Agent or Mobile Flown
- List of OCLC Web Services
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.