Version 21 (modified by 5 years ago) ( diff ) | ,
---|
Development Environment
Table of Contents
Eden Mobile is built on the Apache Cordova platform (sometimes known as Adobe PhoneGap).
- Cordova runs on NodeJS. If your OS distribution does not provide a NodeJS bundle, you can get one from here:
- Use the NodeJS package manager npm to install Cordova (9.0.0 currently):
npm install -g cordova
See also: https://cordova.apache.org/#getstarted
- If you want to build and test EdenMobile, you also need
- Java JDK
- an SDK for the target platform, e.g.: Android SDK
- NB Android Tools 25.3.1+ are NOT compatible with Cordova-Android 5.1.1 (see https://issues.apache.org/jira/browse/CB-12554) so need to downgrade to 25.2.5
- Configure as per https://cordova.apache.org/docs/en/latest/guide/platforms/android
- Ensure the SDK tools are in your PATH, e.g. for Windows 10:
- %USERPROFILE%\AppData\local\android\sdk\platform-tools
- %USERPROFILE%\AppData\local\android\sdk\tools
- Ensure that ANDROID_HOME environment variable is set, e.g. for Windows 10:
- %USERPROFILE%\AppData\local\android\sdk
- You can fork/clone EdenMobile from here:
For some reason sqlite-native-driver.jar
is not in the repo, so download from:
& extract this to plugins\cordova-sqlite-storage\node_modules\cordova-sqlite-storage-dependencies\libs
- Run the application
- You cannot run in the 'browser' platform as it doesn't support the local database
- It is easier to run on a real device than the emulator
- to run on a real device, you need to enable 'Developer Options' by tapping 7 times on the 'Build Number' in the About section (http://www.greenbot.com/article/2457986/how-to-enable-developer-options-on-your-android-phone-or-tablet.html) and then open the new Developer Options panel & enable USB Debugging to allow access in Chrome's Developer Tools (More | Remote Devices | Inspect) NB Do NOT 'reconnect dev-tools' when reinstalling, close window & 'inspect' again, otherwise you will have lots of browser windows left open)
- see also: Remote-Debugging on Android Device
- to run on emulator you need to create an avd:
android avd
cd eden_mobile npm install q-io cp default.config.xml config.xml # or ucce.config.xml cordova platform add android adb uninstall org.sahanafoundation.eden_mobile # Needed on some platforms anyway, on others just to clear data, when-desired cordova run android # Builds apk & adb install platforms\android\build\outputs\apk\android-debug.apk
- Accessing your developer PC's version of Sahana Eden.
Uisng Chrome Tools' Port Forwarding, you can redirect e.g. localhost:8000 on the Android device to localhost:8000 on your Developer PC when connected via USB. This allows you to use that in your Sync Settings.
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/local-server
- jshint is a tool recommended to ensure Code Quality:
npm install -g jshint
Suggested .jshintrc attached (store in the folder just up from eden_mobile):
- Some developers may have problems with settings being retained even when uninstalled due to cloud backup (https://developer.android.com/guide/topics/data/autobackup.html#EnablingAutoBackup), in which case adjust
platforms/Android/AndroidManifest.xml
:<application android:allowBackup="false"
- Currently only Android 6.0 Marshmallow,or later, is supported. Configure the targeted platform in
platform/android/project.properties
target=android-23 # 6.0 Marshmallow
Cordova still supports down to 4.4 KitKat: https://cordova.apache.org/docs/en/latest/guide/platforms/android/
However, many of our plugins require a minimum of Build.VERSION_CODES.M (i.e. Marshmallow)
Attachments (1)
-
.jshintrc
(384 bytes
) - added by 7 years ago.
jshintrc
Download all attachments as: .zip