Setup - MarkTime/MarkTimeJS GitHub Wiki
This page will demonstrate how to setup MarkTimeJS on a personal computer, to develop and test it.
All commands in this guide begin with a dollar sign (`$`). This is simply to represent the prompt in the console, and shouldn't be typed. MarkTimeJS requires [Apache Cordova](https://cordova.apache.org/). For development, we use [Apache Ripple](http://ripple.incubator.apache.org/) for emulation, however, you can use the [Android Virtual Device](http://developer.android.com/tools/devices/index.html) system along with the [Cordova emulation command](http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_test_the_app_on_an_emulator_or_device), or even run the application on your own device if you wish.Both Cordova and Ripple Emulator require NodeJS. Before continuing, verify that this is installed correctly and available from your command line by running the following command:
$ npm version
Apache Cordova and Ripple are both available on NPM. At the time of this writing, to download and install them into Node, use the following commands:
$ npm install -g cordova
$ npm install -g ripple-emulator
$ git clone git://github.com/MarkTime/MarkTimeJS.git /path/to/folder/
This will download the Git repo into the specified folder (replace /path/to/folder/
with the folder to download into).
Otherwise, if you don't have Git, you can also download a ZIP file.
Note: Cordova and Ripple require that you are in the root directory of the MarkTimeJS application before running any commands.
There are various ways to emulate the MarkTime application. This guide will demonstrate how to run MarkTime as an Android application, or in the Ripple Emulator. See the Cordova documentation for more information on how to run MarkTime in other emulators.
Warning! Use of the Ripple emulator is discouraged, as various parts of MarkTime may not work. For this reason, we recommend using the AVD Emulator, instead.
To run MarkTimeJS in the Ripple Emulator, first navigate to the repo folder:$ cd /path/to/folder/
Now, use the ripple emulate
command to begin emulating:
$ ripple emulate
A new browser window will open containing the emulation. If Ripple comes up with an error, first try a different browser, and then try restarting Ripple. MarkTimeJS outputs messages to the console when an activity occurs. Opening the Javascript console is different for different browsers, so check your browsers documentation for information on how to do this.
The Android SDK comes with an emulator which can also be used with MarkTimeJS. The following instructions are for Windows, but should be similar on other operating systems.To open the AVD Manager, first open a command window and navigate to the Android SDK path:
$ cd /path/to/sdk/
Now, navigate to the tools
folder in this folder:
$ cd tools
To run the AVD manager, enter the following command:
$ android avd
To add a new Android Virtual Device, click on the New...
button to the right. This will open a window similar to the following:
Fill out this field with the desired options. Note that Android Virtual Devices generally need a relatively large amount of RAM and SD Card size to run (possibly 500MB or more). If the Virtual Device fails to run, try fiddling with these values.
Once you have finished filling out the field, select the OK
button.
To run the new AVD, select the AVD in the list and click the Start...
button to the right. If the AVD fails to start, try changing the RAM and SD Card size, and then restarting the AVD Manager.
Once the virtual device has started, navigate to the MarkTimeJS folder in the command prompt:
$ cd /path/to/folder/
Now, use the cordova emulate
command to install the program onto the virtual device:
$ cordova emulate android
Cordova will now build and install the program onto the device, and then run the program.
MarkTime outputs information to the console when an activity occurs. When running an AVD, this can be accessed using Chrome by going to the following URL: chrome://inspect/#devices
. Once Cordova has completed building and uploading MarkTime, the device will appear on this list. Click the inspect
link to open an interactive console.
$ cd /path/to/folder/
Depending on your device's operating system, you may need to add the required platform to the Cordova system:
$ cordova platform add <platform>
See the Cordova reference for more information on what plaforms are supported. Replace <platform>
with the name of the platform.
You must build MarkTimeJS before uploading it to your device:
$ cordova build <platform>
Replace <platform>
with the name of the platform. Cordova will now build the MarkTimeJS project. Once this has completed, run the following command to upload the program to your device:
$ cordova run <platform>