Welcome to the Sync Demo application. This application demonstrates a basic Tic-Tac-Toe client with the ability to make moves by any number of players, by synchronising the game state across the clients.
What you'll minimally need to get started:
- A clone of this repository
- A running instance of the backend quickstart of your choice (Ruby, Python, Node.js, Java, C#, or PHP) to issue Access Tokens
Generate google-services.json file and place it under sync-quickstart-android/
.
Set the value of ACCESS_TOKEN_SERVICE_URL
in gradle.properties
file to point to a valid Access-Token server. If you're using one of the quickstarts to provide tokens, you'll probably want to use ngrok
to direct a publicly-accessible URL to your localhost service.
$ ngrok http localhost:4567
Your gradle.properties
file should look something like this, borrowing from the output of the above.
ACCESS_TOKEN_SERVICE_URL=http://9349392.ngrok.io/token
You can also pass this address to gradle during the build.
./gradlew assembleDebug -PACCESS_TOKEN_SERVICE_URL=http://example.com/get-token/
Run ./gradlew assembleDebug
to fetch Twilio Sync SDK files and build application.
You can import this project into Android Studio and then build as you would ordinarily. The token server setup is still important.
If you want to see crashes reported to crashlytics:
-
In order to see native crashes symbolicated upload symbols into the Firebase console:
./gradlew sync-quickstart-android:assembleBUILD_VARIANT
./gradlew sync-quickstart-android:uploadCrashlyticsSymbolFileBUILD_VARIANT
for example to upload symbols for debug
build type run:
./gradlew sync-quickstart-android:assembleDebug
./gradlew sync-quickstart-android:uploadCrashlyticsSymbolFileDebug
Select "Simulate crash" from the app menu to force an app crash.
Read more about Android NDK crash reports.