/html5-app-container

HTML5 application container for Android and iOS

Primary LanguageShellMIT LicenseMIT

HTML5 Application Container

This is a Cordova-based container for HTML5 applications, currently targeting Android and iOS.

On Android, the container uses the Crosswalk WebView for modern and consistent Chrome functionality.

Running a HTML5 application (site) in a Cordova container has the following advantages:

  • no permissions, e.g. to play audio files
  • platform abilities, e.g. wake locks

Prerequisites

If you have Homebrew, the following command installs Imagemagick correctly.

brew install librsvg
brew install imagemagick --with-librsvg

Personalize

Check out the repository, set your application name and package name in script/vars.sh and app/config.xml.

The script/setup-*.sh files (executed in the Setup step described below) install Cordova plugins that extend the native capabilities of the container. The following commands may reveal new useful plugins.

./node_modules/.bin/plugman search org.apache.cordova
./node_modules/.bin/plugman search org.chromium

Setup

Run the commands below to create the application container.

./script/setup.sh

This will create keys for releasing the container application in keys. Back up the directory somewhere safe (Google Drive, Dropbox, S3). When using other computers, delete the keys directory generated by the setup script, and replace it with the saved contents.

Build

The following commands place build products in the bin/ directory.

./script/build-android.sh
./script/build-ios.sh

The app/ directory has HTML / CSS / JS and image files that are copied into the application container. When changing those, only the build step needs to be re-executed.

Develop

The following commands have proven useful in debugging the application container.

./node_modules/.bin/ios-sim launch bin/*-debug.app
./node_modules/.bin/ios-deploy -b bin/*-release.app

The iOS application container can be debugged easily by Safari's Remote Inspector.

adb install -r bin/*-debug.apk

The Android application container can be debugged easily by Chrome's Remote Debugger.

License

This project is Copyright (c) 2014 Victor Costan, and distributed under the MIT License.