Ionic:
Ionic CLI : 5.2.1 (/home/seanwu/.nvm/versions/node/v10.16.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.7
System:
Android SDK Tools : 26.1.1 (/home/seanwu/android-sdk-26.1.1-4333796)
NodeJS : v10.16.0 (/home/seanwu/.nvm/versions/node/v10.16.0/bin/node)
npm : 6.9.0
OS : Linux 4.18Assume the OS is Ubuntu 18.04.
sudo apt install openjdk-8-jdk gradleDownload and unzip Android SDK tools.
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d $HOME/android-sdk-26.1.1-4333796Configure command line tools by adding the environment variables to shell startup scripts (e.g. ~/.bashrc).
# ~/.bashrc
# JDK
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
# Android SDK
ANDROIDDIR="$HOME"
export ANDROID_SDK_ROOT="$ANDROIDDIR/android-sdk-26.1.1-4333796"
# avdmanager, sdkmanager
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
# adb, logcat
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
# emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/toolsUse the new startup script.
source $HOME/.bashrcInstall SDK tools.
sdkmanager 'build-tools;28.0.3' 'platform-tools' 'platforms;android-27' 'tools'Use NVM to install Node.js (highly recommended).
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bashInstall and use Node.js LTS version.
nvm install --ltsWe assume the version of Node.js for this project's development to be 10.x.
Install Ionic CLI and Cordova CLI.
npm install -g ionic cordova native-runnative-run is required if you want to run the app in mobile devices with Cordova.
You do NOT have to use
sudoto install global NPM packages if you install Node.js and NPM with NVM.
Clone project and check to feature-migration-ionic4 branch.
git clone git@gitlab.com:DT42/numbers/numbers-mobile-client.git
cd numbers-mobile-client
git checkout feature-migration-ionic4Install NPM packages.
npm installIonic:
Ionic CLI : 5.2.1 (/home/seanwu/.nvm/versions/node/v10.16.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.6.0
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed
native-run : 0.2.7
System:
Android SDK Tools : 26.1.1 (/home/seanwu/android-sdk-26.1.1-4333796)
NodeJS : v10.16.0 (/home/seanwu/.nvm/versions/node/v10.16.0/bin/node)
npm : 6.9.0
OS : Linux 4.18ionic serveRun in a browser would cause errors due to the lack of mobile API.
There are 2 different ways to run the app on mobile devices.
Use Ionic DevApp to run the app. If the app calls any native functionality, DevApp can handle this and return the correct native implementation. You do not have to install or configure complicated Native SDKs. Also, you do not have to use USB to debug the mobile devices.
Make sure your devices are connected via USB with debugging mode enabled.
Run the following to start a long-running CLI process that boots up a live-reload server.
ionic cordova run android -lPlease use Ionic CLI to generate pages, services, directives, etc. to keep the project structure consistent.
tour.page.ts排版出問題。可能需要重新設計 SCSS。- WORKAROUND:
cordova-plugin-background-geolocationv^3.0.3 has the, and thus we cannot build or run on Android with Cordova. Currently, we use this workaround to fix the problem. We should update this plugin after this issue has been closed.
- Ugly Ionic-Creator-generated IDs should be eliminated.
- Page name choice: record center (current one) or control center (better consistency)?
href-inappbrowser="/signup"inlogin.htmldoes not work.datetime.service.tsuses a string comparison to check object type, which might be a bad idea.- in
weather.service.ts,getWeatherByLocation()using possibly non-exist string-literal ('main') to accessResponseobject. Searchtslint:disable-next-line: no-string-literalto find them. - in
airquality.service.ts,getAirQualityByLocation()using possibly non-exist string-literal ('main') to accessResponseobject. Searchtslint:disable-next-line: no-string-literalto find them. - the page
account-settingshould be renamed asaccount-settings. - modulize page components. E.g. home, journal-daily-report, profile pages.
- menu or back button in the login page. 需要 App 頁面的狀態圖來確定設計。
- improve page (routing) structure.
- how to share:
SharePopUpPageorSocialSharing? - make injectable private in components.
- Do NOT try to import
AppModulein eachspec.tsfile, though it can make sure every service is provided, your tests have to reload everything every time, and the state of each test becomes hugely complex. - Because both ionic-native-mocks and ionic-mocks have not yet supported Ionic 4, we build our Ionic native mocks in
src/mocks. - If you use
ReactiveFormModulein component, you need to importReactiveFormModuleandIonicModule.forRoot()inspec.ts. - If you use
<ion-back-button>in component and importIonicModule.forRoot()inspec.ts, you need to importRouterTestingModuleinspec.ts. Rationale:IonicModule.forRoot()is the ngModule to make any<ion-*>directive work. When you useReactiveFormModuleto create form, you have to make sure<ion-input>is working, and thus, importIonicModule.forRoot()as well. Furthermore, due to<ion-back-button>is working by importingIonicModule.forRoot(), you need to importRouterTestingModulefor the provider ofLocationwhich is required for any routing behavior.