Bing-Maps-Fleet-Tracker/MobileClient
Elon Jiang 133cf3953d rm package-lock 2020-01-24 10:33:35 -08:00
..
resources Initial code version 2018-01-29 16:07:35 +02:00
scripts/MicrosoftMaps Initial code version 2018-01-29 16:07:35 +02:00
src bump major libary versions 2020-01-23 16:58:56 -08:00
.editorconfig Initial code version 2018-01-29 16:07:35 +02:00
.gitignore Initial code version 2018-01-29 16:07:35 +02:00
README.md Apply suggestions from code review 2019-07-19 14:33:28 -07:00
config.xml bump major libary versions 2020-01-23 16:58:56 -08:00
ionic.config.json bump major libary versions 2020-01-23 16:58:56 -08:00
package.json bump major libary versions 2020-01-23 16:58:56 -08:00
tsconfig.json Initial code version 2018-01-29 16:07:35 +02:00
tslint.json Initial code version 2018-01-29 16:07:35 +02:00

README.md

Bing Maps Fleet Tracker - Mobile Client

This section details how to build and run the mobile application from source, for pre-built artifacts see deployment guide.

Prerequisites

Once you have these tools set up, move to the MobileClient/ folder and run the following command to install the remaining dependencies:

npm install

Running as web application

Any ionic application can be run on a browser for testing basic functionality. To ensure correct installation, from the MobileClient/ folder run:

ionic serve

You should be greeted by a registration page in your browser. If this command fails to run, ensure all the prerequisites have been installed correctly.

If you click scan in the registration page, you will get the following error:

Error: Uncaught (in promise): ReferenceError: 'cordova' is not defined ReferenceError: 'cordova' is not defined at Anonymous function (http://localhost:8100/build/main.js:371:13) at t.prototype.invoke (http://localhost:8100/build/polyfills.js:3:9008) at onInvoke (http://localhost:8100/build/vendor.js:30921:21) at t.prototype.invoke (http://localhost:8100/build/polyfills.js:3:9008) at e.prototype.run (http://localhost:8100/build/polyfills.js:3:6455) at Anonymous function (http://localhost:8100/build/polyfills.js:3:4574) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at onInvokeTask (http://localhost:8100/build/vendor.js:30912:21) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at e.prototype.runTask (http://localhost:8100/build/polyfills.js:3:7057) at s (http://localhost:8100/build/polyfills.js:3:4205) at Anonymous function (http://localhost:8100/build/polyfills.js:3:4612) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at onInvokeTask (http://localhost:8100/build/vendor.js:30912:21) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at e.prototype.runTask (http://localhost:8100/build/polyfills.js:3:7057) at i (http://localhost:8100/build/polyfills.js:3:3664) at invoke (http://localhost:8100/build/polyfills.js:3:10870)

If you click dismiss in the registration page, you will get the following error:

Error: Error in ./RegistrationPage class RegistrationPage - inline template:40:2 caused by: Object doesn't support property or method 'dismiss' at DebugAppView.prototype._rethrowWithContext (http://localhost:8100/build/vendor.js:89149:17) at Anonymous function (http://localhost:8100/build/vendor.js:89162:17) at Anonymous function (http://localhost:8100/build/vendor.js:35817:9) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at onInvokeTask (http://localhost:8100/build/vendor.js:30912:21) at t.prototype.invokeTask (http://localhost:8100/build/polyfills.js:3:9614) at e.prototype.runTask (http://localhost:8100/build/polyfills.js:3:7057) at invoke (http://localhost:8100/build/polyfills.js:3:10827)

Those errors are expected.

If this step succeeds, you are ready to run on an emulator or device.

Android

Android Prerequisites

Ensure that you have the Android SDK downloaded

To download the native plugins and setup the cordova android project run:

ionic cordova platform add android@6.4.0

Android Build and run

To build application:

ionic cordova build android

To run the application on a device or emulator:

ionic cordova run android

Android troubleshooting

In some environments, building fresh clones may fail with the errors:

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

To solve these issues, go to the plugin/ directory, search for "com.android.support:support-v4:+" and replace it with "com.android.support:support-v4:27.1.0". You will need to change that in two files: build.gradle and barcodescanner.gradle.

Then remove and add the Android platform directory using the commands:

ionic cordova platform remove android
ionic cordova platform add android@6.4.0

For Windows, if you get errors like "Error occurred during initialization of VM. Could not reserve enough space for 2097152KB object heap", make sure your jvm is in the correct architecture. You can check your system type in System Information APP. For example, you may see x64-based PC for your system type. Then you will need to download Windows x64 Java SE Development Kit from JDK.

iOS

iOS Prerequisites

  • XCode 7 or higher
  • iOS 9
  • A free Apple ID or paid Apple Developer account

To download the native plugins and setup the cordova iOS project run:

ionic cordova platform add ios

iOS Build and run

To build application:

ionic cordova build ios

To run the application on a device or emulator, you will need to set up a provisioning profile, and follow the steps outlined in the ionic documentation.