diff --git a/.gitignore b/.gitignore index 60317e5..fb79d5f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist node_modules test/tests.js forms/forms.js +cordova diff --git a/Gruntfile.js b/Gruntfile.js index 6b8f535..92ae956 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -100,7 +100,7 @@ module.exports = function(grunt) { }, cordova_config: { expand: true, - cwd: 'cordova/', + cwd: 'app/', src: 'config.xml', dest: 'cordova/www/' }, diff --git a/cordova/config.xml b/app/config.xml similarity index 93% rename from cordova/config.xml rename to app/config.xml index f4f794b..92fa507 100644 --- a/cordova/config.xml +++ b/app/config.xml @@ -7,6 +7,7 @@ mWater Team + diff --git a/app/js/launcher.coffee b/app/js/launcher.coffee index 517bae3..b8d22d8 100644 --- a/app/js/launcher.coffee +++ b/app/js/launcher.coffee @@ -16,10 +16,12 @@ exports.createAppUpdater = (success, error) -> , error exports.launch = () -> + console.log("Launcher called") exports.createAppUpdater (appUpdater) -> appUpdater.launch (url) -> # Create full url to index.html indexUrl = url + "index.html?cordova=" + origUrl + console.log("Launcher redirecting to " + indexUrl) window.location.href = indexUrl , (err) -> alert("Failed to launch app: " + err) diff --git a/setup_cordova.sh b/setup_cordova.sh new file mode 100644 index 0000000..bb2e7cc --- /dev/null +++ b/setup_cordova.sh @@ -0,0 +1,15 @@ +#!/bin/bash +rm -r cordova +cordova create cordova co.mwater.clientapp ClientApp +cd cordova +cordova platform add android +cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git +cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git +cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git +cordova plugin add https://github.com/mWater/cordova-plugin-camera-foreground.git +rm platforms/android/res/drawable-hdpi/icon.png +rm platforms/android/res/drawable-ldpi/icon.png +rm platforms/android/res/drawable-mdpi/icon.png +rm platforms/android/res/drawable-xhdpi/icon.png +cp ../dist/img/mwater-large.png platforms/android/res/drawable/icon.png +rm -r www/*.*