Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 1 | # Croupier |
Alex Fandrianto | c22f9f7 | 2015-08-11 14:32:57 -0700 | [diff] [blame] | 2 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 3 | Croupier is a Vanadium demo app of a general card playing game for multiple |
| 4 | devices. The app combines Syncbase with Mojo and Flutter and in the near future, |
| 5 | will also demonstrate P2P discovery and Syncgroup formation. |
Alex Fandrianto | c22f9f7 | 2015-08-11 14:32:57 -0700 | [diff] [blame] | 6 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 7 | Croupier's primary card game is Hearts, but it is only available in single-device |
| 8 | form. More games will be added in the future. |
Alex Fandrianto | c22f9f7 | 2015-08-11 14:32:57 -0700 | [diff] [blame] | 9 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 10 | In order to run the program, it is recommended to use Android devices. (Support |
| 11 | for desktop is deprecated and will be removed soon.) |
| 12 | |
| 13 | # Prerequisites |
| 14 | |
| 15 | ## Mojo |
| 16 | |
| 17 | Currently, development is heavily tied to an existing installation of Mojo. |
| 18 | Please ensure that your Mojo checkout is located at $MOJO_DIR and has built |
| 19 | out/android_Debug. Instructions are available [here](https://github.com/domokit/mojo). |
| 20 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 21 | ## Dart |
| 22 | |
| 23 | Flutter depends on a relatively new version of the Dart SDK. Therefore, please |
| 24 | ensure that you have installed the following version or greater: |
| 25 | ``` |
| 26 | Dart VM version: 1.13.0-dev.3.1 (Thu Sep 17 10:54:54 2015) on "linux_x64" |
| 27 | ``` |
| 28 | |
| 29 | If you are unsure what version you are on, use `dart --version`. |
| 30 | |
| 31 | To install Dart, visit [their download page](https://www.dartlang.org/downloads/). |
| 32 | You may need to manually download a specific version of Dart. If so, visit their |
| 33 | [archives](https://www.dartlang.org/downloads/archive/) for exact downloads. |
| 34 | |
| 35 | ## Vanadium |
| 36 | |
| 37 | A Vanadium installation is expected, since Croupier also depends on the |
Alex Fandrianto | f6ce4eb | 2015-10-27 10:49:18 -0700 | [diff] [blame] | 38 | https://github.com/vanadium/mojo.discovery project. |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 39 | |
| 40 | # Running Croupier |
| 41 | |
| 42 | ## Credentials |
| 43 | |
| 44 | Begin by creating your credentials. These are used to determine who can access |
| 45 | your Syncbase instance. Note that running the following command will pop-up the |
| 46 | standard `principal seekblessings` tab in order to obtain your approval to use |
| 47 | OAuth. |
| 48 | |
| 49 | ``` |
| 50 | make creds |
| 51 | ``` |
| 52 | |
| 53 | __Any time you clean the credentials, you will need to obtain fresh credentials.__ |
| 54 | |
| 55 | ## Note on Multiple Devices |
| 56 | |
| 57 | If you have more than 1 device plugged into the computer, you will need to specify |
| 58 | which device to use. `adb devices` will tell you the order of your devices. |
| 59 | |
| 60 | It is highly recommended that you mark/remember the order of the devices; it is |
| 61 | the same as the order they were plugged into the computer/workstation. |
| 62 | |
| 63 | For later devices, instead of `ANDROID=1` use `2`, `3`, `4`, etc. |
| 64 | |
| 65 | __Note:__ Running Croupier on multiple Android devices simultaneously is still a work-in-progress. |
| 66 | The workaround is to launch Croupier on a single device at a time. |
| 67 | |
| 68 | __Note:__ This example currently relies on a mount table on the local network at |
| 69 | `192.168.86.254:8101`. This may be changed to the global mount table at a later time. |
| 70 | https://github.com/vanadium/issues/issues/782 |
| 71 | |
| 72 | ## Start |
| 73 | |
| 74 | Start Croupier on your USB-debugging enabled Android device. |
| 75 | ``` |
| 76 | ANDROID=1 make start |
| 77 | ``` |
| 78 | |
| 79 | Alternatively, use a different integer. Since the first device creates a syncgroup, |
| 80 | it is recommended that you wait a short duration before starting up any other devices. |
| 81 | |
Alex Fandrianto | f6ce4eb | 2015-10-27 10:49:18 -0700 | [diff] [blame] | 82 | Note: Some devices may limit the number of characters the `adb connect` command |
| 83 | accepts. If this is the case, the app will not launch under `make start`. One |
| 84 | workaround is to delete some non-critical lines in the Makefile, such as |
| 85 | `--checked` and `--free-host-ports`. |
| 86 | See https://github.com/vanadium/issues/issues/831 |
| 87 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 88 | ## Deleting Mojo Shell |
| 89 | |
| 90 | On your Android device, go to the Apps that you downloaded and Uninstall Mojo |
Alex Fandrianto | d0233fd | 2015-10-14 12:50:06 -0700 | [diff] [blame] | 91 | Shell from there. This cleanup step is important for when Mojo is in a bad state. |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 92 | |
Alex Fandrianto | d0233fd | 2015-10-14 12:50:06 -0700 | [diff] [blame] | 93 | __Note__: Syncgroup data and some Syncbase data is not cleaned up between runs. |
| 94 | This means that deleting Mojo Shell can often be helpful in cases where clearing |
| 95 | Mojo Shell's data is insufficient. |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 96 | |
| 97 | ## Cleaning Up |
| 98 | |
| 99 | Due to some issues with mojo_shell, you may occasionally fail to start the |
| 100 | program due to a used port. Follow the error's instructions and try again. |
| 101 | |
Alex Fandrianto | d0233fd | 2015-10-14 12:50:06 -0700 | [diff] [blame] | 102 | Between builds of Mojo and Syncbase, you may wish to clean the app and database |
| 103 | info (for rooted devices only) up. |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 104 | |
| 105 | ``` |
| 106 | ANDROID=1 make clean |
| 107 | ``` |
| 108 | |
Alex Fandrianto | d0233fd | 2015-10-14 12:50:06 -0700 | [diff] [blame] | 109 | For non-rooted devices, you can manually clear the data of the Mojo Shell app. |
| 110 | |
Alex Fandrianto | b3ff376 | 2015-10-13 13:31:12 -0700 | [diff] [blame] | 111 | You can also clean credentials instead: |
| 112 | |
| 113 | ``` |
| 114 | ANDROID=1 make clean-creds |
| 115 | ``` |
| 116 | |
| 117 | Don't forget to do `make creds` to rebuild them. |
| 118 | |
| 119 | Lastly, you can also clear out the pub packages: |
| 120 | |
| 121 | ``` |
| 122 | make veryclean |
| 123 | ``` |