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