A simple application that uses the Apache Cordova project to wrap a Javascript TicTacToe game as a native Android app.
- Install a JDK and required build tools:
sudo apt-get install openjdk-7-jdk ant
- Install cordova locally from
package.json
:npm install
- Define your
ANDROID_HOME
in your~/.bashrc
e.g.export ANDROID_HOME=~/.local/share/android-sdk-linux
- Install the web application dependencies:
cd wwwsrc && npm install
- Install the Gem to compile SASS scripts:
cd wwwsrc && gem install sass
Internally we use the jstictactoe web application imported directly into this project.
ant build
Alternatively you can execute both Grunt and Cordova build separately, based on the Cordova Command Line Interface:
cd wwwsrc
grunt build
cd ..
node_modules/.bin/cordova build
Make sure that you can run/debug Android devices through e.g. the Eclipse ADT, by setting USB debugging mode to "on" etc.
ant run
Alternatively you can execute both Grunt and Cordova build separately, based on the Cordova Command Line Interface:
cd wwwsrc
grunt build
cd ..
node_modules/.bin/cordova run android
Based on the Cordova Command Line Interface
node_modules/.bin/cordova platform add android
- Check in all files: "it is mostly build product but some things like the AndroidManifest.xml you will end up tweaking manually"