Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android to be able to build with packages.json ready and Python script start bug #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ SepiaFW-P4-bck-old
Thumbs.db
Desktop.ini
*.DS_Store
node_modules
tmp
64 changes: 17 additions & 47 deletions create-android-project.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,45 @@
#
APP_NAME="SepiaFW-P4"
# create project
sleep 2
echo "#Creating '$APP_NAME' ..."
cordova create $APP_NAME de.bytemind.sepia.app.web $APP_NAME
npx cordova create $APP_NAME de.bytemind.sepia.app.web $APP_NAME
#
# copy folders
sleep 2
echo "#Transfering code ..."
cp -r www $APP_NAME
cp -r plugin_mods $APP_NAME
cp -r resources $APP_NAME
cp -r hooks $APP_NAME
cp config.xml $APP_NAME/config.xml
cp package.app.json $APP_NAME/package.json
cd $APP_NAME

#
# add plugins
sleep 2
echo "#Adding plugins ..."
cordova plugin add cordova-plugin-device
cordova plugin add cordova-plugin-geolocation
cordova plugin add cordova-plugin-inappbrowser
cordova plugin add cordova-plugin-tts
cordova plugin add cordova-plugin-whitelist
cordova plugin add cordova-universal-links-plugin
cordova plugin add cordova-plugin-statusbar
cordova plugin add cordova-plugin-splashscreen
#cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git -- NOTE: use this in case releases are too old
cordova plugin add cordova-plugin-cache-clear
cordova plugin add cordova-custom-config
cordova plugin add plugin_mods/speechrecognition/org.apache.cordova.speech.speechrecognition
#cordova plugin add de.appplant.cordova.plugin.local-notification
#cordova plugin add plugin_mods/localnotifications/de.appplant.cordova.plugin.local-notification
#cordova plugin add [email protected]
cordova plugin add cordova-plugin-local-notification
cordova plugin add cordova-plugin-file
cordova plugin add cordova-plugin-nativestorage
cordova plugin add cordova-android-support-gradle-release
cordova plugin add phonegap-plugin-media-stream
cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
cordova plugin add cordova-plugin-eddystone
cordova plugin add cordova-plugin-navigationbar-color
#NOTE: add before intent plugin if you use: plugin add cordova-plugin-camera
cordova plugin add com-darryncampbell-cordova-plugin-intent
#
# overwrite plugin mods
sleep 2
npm i
# NEW better one
npx cordova prepare
echo "#Updating plugins ..."
cp -f "plugin_mods/inappbrowser/android/InAppBrowser.java" "plugins/cordova-plugin-inappbrowser/src/android/"
cp -r -f "plugin_mods/inappbrowser/plugin.xml" "plugins/cordova-plugin-inappbrowser/plugin.xml"
cp -r -f "plugin_mods/inappbrowser/android/res/" "plugins/cordova-plugin-inappbrowser/src/android/res/"
cp -r -f "plugin_mods/inappbrowser/android/res" "plugins/cordova-plugin-inappbrowser/src/android/"
#cp -r -f "resources/icons/android/notifications/res/" "plugins/de.appplant.cordova.plugin.local-notification/src/android/res/"
#
# add android platform
sleep 2
echo "#Adding platform ..."
cordova platform add [email protected]
#
# prepare build
echo "#Preparing build ..."
cordova prepare android
# sleep 2
# overwrite icons (this will be replaced with a proper implementation)
sleep 2
echo "#Adding or overwriting resources, e.g. icons, themes, xml ..."
cp -r -f "resources/icons/android/notifications/res/" "platforms/android/res/"

# Fix a bug
[[ ! -d platforms/android/res/drawable ]] && cp platforms/android/res/drawable-port-hdpi platforms/android/res/drawable -recho "#Adding or overwriting resources, e.g. icons, themes, xml ..."

cp -r -f "resources/icons/android/notifications/res" "platforms/android/"
cp -r "resources/themes/android/background_splash.xml" "platforms/android/res/drawable/background_splash.xml"
cp -r "resources/themes/android/launch_screen.png" "platforms/android/res/drawable/launch_screen.png"
#cp -r "resources/themes/android/styles.xml" "platforms/android/res/values/styles.xml"
cp -r "resources/themes/android/values/" "platforms/android/res/values/"
# NEW
cp -r "resources/themes/android/values" "platforms/android/res/"
mkdir -p "platforms/android/res/values-v21"
cp -r "resources/themes/android/values-v21/" "platforms/android/res/values-v21/"
cp -r "resources/config/android/xml/" "platforms/android/res/xml/"
cp -r "resources/themes/android/values-v21" "platforms/android/res/"
cp -r "resources/config/android/xml" "platforms/android/res/"
echo "#DONE"
echo "If everything worked out fine the next step would be to build the app from the %APP_NAME% folder: cordova build android"
Empty file modified install-environment.sh
100644 → 100755
Empty file.
42 changes: 42 additions & 0 deletions package.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"devDependencies": {
"cordova-plugin-whitelist": "^1.3.4"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"browser"
]
},
"dependencies": {
"cordova": "^7.1.0",
"com-darryncampbell-cordova-plugin-intent": "^1.1.6",
"cordova-android": "^6.4.0",
"cordova-android-support-gradle-release": "^3.0.0",
"cordova-custom-config": "^5.1.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-ble": "^2.0.1",
"cordova-plugin-cache-clear": "^1.3.8",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-eddystone": "^1.3.0",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-inappbrowser": "^3.0.0",
"cordova-plugin-insomnia": "git+https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-navigationbar-color": "0.0.8",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-tts": "^0.2.3",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-universal-links-plugin": "^1.2.1",
"es6-promise-plugin": "^4.2.2",
"phonegap-plugin-media-stream": "^1.2.1",
"speechrecognition": "file:plugin_mods\\speechrecognition\\org.apache.cordova.speech.speechrecognition",
"org.apache.cordova.speech.speechrecognition": "plugin_mods/speechrecognition/org.apache.cordova.speech.speechrecognition"
}
}
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"devDependencies": {
"cordova-plugin-whitelist": "^1.3.4"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"browser"
]
},
"dependencies": {
"cordova": "^7.1.0",
"cordova-plugin-whitelist": "1"
}
}
4 changes: 2 additions & 2 deletions serve-via-python.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
cd www
start "http://localhost:20728"
python -m http.server 20728
google-chrome "http://localhost:20728"
python -m http.server 20728