GoPaddler mobile app instructions
> git clone https://kimile@bitbucket.org/kimile/paddler-app.git
> npm install
> echo '<appname[gopaddler|uttercycling]>' > .app
> node scripts/generate-config-for-app.js
> cordova platform add android
> cordova platform add ios
> cordova plugin rm @mauron85/cordova-plugin-background-geolocation
> cordova plugin add @mauron85/cordova-plugin-background-geolocation
> node scripts/generate-images.js
> npm run build:dev [build:dev-remote-portrait|...]
> cordova run android
> Open android studio, but don't upgrade gradle version (unless cordova upgrades to gradle 7)
> Setup Icon (look section bellow in README)
Build (watch for changes)
> npm run build:dev [build:dev-remote-portrait|...]
Test in browser (by default, localhost:5000, user-agent: gp-dev-ck)
> npm run www
After doing the 1st step (cloning and running using _cordova run android_, open the project in Android Studio and manage execution from there).
Use Resource Manager > + > Image Asset;
- Foreground Layer: Choose file from res/<app>/icon-foreground.png
- Background Layer: Choose color #df4750 for Utter Cycling or #3D3D63 for GoPaddler
Updating requires removing and adding platform again
> cordova platform remove android|ios
Generate splash/icon images for the platform
> npm run build:generate-images
Open XCode/Android studio and confirm that images have been properly generated
iOS: "Utter Cycling" > Resources > Images.xcassets > AppIcon | LaunchStoryBoard
Android: Resource Manager > Mim Map (icon) | Drawable (splash)
Follow instructions on https://docs.google.com/spreadsheets/d/1ToKXbZJ-MfA47lgWT1xJlJshxDF8Np9Et8NNpjO1ddU/edit#gid=2058990100
Gopaddler tags up to 1.6.0 use just the version numbers; From 1.6.0 onwoards, use gp<a|i>-<build-number> instead (a = android, i = iOS); Example: gpa-1700 for GoPaddler android version 1.7.0
Uttercycling used cycling-<version> until version 0.9.0; After that, use uc<a|i>-<build-number>; Example: uca-1000 for Utter Cycling Android version 1.0.0;
Images are stored in res/{app-name}/[icon|splash].png. For iOS, splash must be available with the name Default@2x~universal~anyany.png
Replacing iOS splash image requires removing and adding the platform
Test cases are stored in local PostgreSQL database
> sudo npm install -g mocha
> npm install pg
> npm install bluebird
> cd src/test/js
> mocha .
cordova build android --release
> cordova plugin rm cordova-plugin-background-geolocation
> node scripts/generate-config-for-app.js
> cordova plugin add @mauron85/cordova-plugin-background-geolocation
Make sure that plist hook is defining the accepted view modes:
obj.UISupportedInterfaceOrientations = [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationLandscapeRight"
];
obj["UISupportedInterfaceOrientations~ipad"] = [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationLandscapeRight"
];
If truly desperate, edit ./platforms/ios/CordovaLib/Classes/Public/CDVViewController.m to the following:
- (BOOL)shouldAutorotate
{
return FALSE;
}
If multiple errors occur stating MissingDefaultResource where generating --release version, just like the one bellow,
> Task :app:lintVitalRelease
/Users/kimile/gopaddler/workspace/app/platforms/android/app/src/main/res/drawable-land-hdpi/screen.png: Error: The drawable "screen" in drawable-land-hdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
follow these instructions:
- Create a folder called drawable at /platforms/android/app/src/main/res/
- Copy screen.png to that folder (use larger image)
- Run cordova again
These files were included into android platform starting in version 6.x; Just remove duplicate files:
rm ./app/src/main/java/org/apache/cordova/PermissionHelper.java
rm ./app/src/main/java/org/apache/cordova/BuildHelper.java
If it does not work, try removing compat and adding again (version 1.2):
cordova plugin rm cordova-plugin-compat --force
cordova plugin add cordova-plugin-compat@1.2
Probably missing plugin: cordova plugin add cordova-sqlite-storage
org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;
- Edit platforms/android/build.gradle
- Change classpath version from classpath 'com.android.tools.build:gradle:3.3.0' -> classpath 'com.android.tools.build:gradle:4.0.0'