This is a reasonably configured skeleton application for Cordova based mobile apps, because I don't want to spend all morning setting this lot up again.
On startup the app will set up everything device related, and then pull
www/application.js from the content server to start the actual application.
- Edit
config.xmland set an application name and identifier. - Make sure you have Node.js installed. (Homebrew, apt, etc can help)
- For extra awesome, install direnv to automated
environment configuration. (Run
direnv allowto let it load the project's config). - Install dependencies with
npm install. - Add any platforms you're going to work with:
cordova platform add android.
The app pulls its assets from an HTTP server, so you'll need to start that up for local development.
nf start -p$AN_EMPTY_PORT
The file config.json contains configuration for the application, at the moment
just a content endpoint to get additional content from. You can add extra variables
to that file, and accompanying meta tags to the head of www/index.html to have
them replaced as well. Substitution is done on building the app.
- Set up the Android depedencies using the Cordova Android Platform Guide
- Make sure you can connect to your device in debug mode with
adb devices. It should list your phone as connected. If it isn't, find out how to turn on USB Debugging. - Forward the development server port to your device.
adb forward $PORT 8888. Leave 8888 as is, since the Cordova app assumes that port is being used. - Push the app to your device with
cordova run.
TODO