Apache Cordova provides many device APIs to get the native features of the mobile devices that are supposed to run in devices only. To run EGL Cordova projects in the local browser, EGL Cordova library simulates the device APIs with test data. For example, when CordovaLib.getDevice() is called in EGL, test device data is returned to the EGL to simulate the device information. You can even customize the test data for the device APIs to simplify the testing.
To specify test data, simply edit com.ibm.egl.rui.cordova_x.x.x/WebContent/runtime/cordovaData.js. There is already commented test data, just uncomment and update the test data with the desired data. The test data is written in JavaScript with prefix cordova-egl.cordovaData.
| Test data with prefix | Description |
|---|---|
| cordova-egl.cordovaData.AccelerometerData | Array of accelerometer {x,y,z}, which will be used by AccelerometerLib |
| cordova-egl.cordovaData.CompassData | Array of compassaccelerometer{trueHeading, magneticHeading, headingAccuracy}{x,y,z}, which will be used by CompassLib |
| cordova-egl.cordovaData.ContactData | Array of Contacts, which will be used by ContactLib |
| cordova-egl.cordovaData.CameraData | Array of camera properties {fileUrl}, which will be used by CameraLib |
| cordova-egl.cordovaData.DeviceData | Object of device {cordova, platform, model, uuid, version}, which will be used by CordovaLib.getDevice() |
| cordova-egl.cordovaData.GeolocationData | Array of geolocation {accuracy, heading, altitudeAccuracy, latitude, longitude, altitude}, which will be used by GeolocationLib |