In this guide, we will get you up and running quickly with a sample application you can build on as you learn more about Sync.
Table Of Contents
The first thing we need to do is grab all the necessary information from our Twilio account. To set up our back-end for Sync, we will need four values from our account:
|Service Instance SID||A service instance where all the data for our application is stored and scoped. Generate one using the console Sync Services tool.|
|Account SID||Your primary Twilio account identifier - find this on the main page of the Twilio console.|
|API Key||Used to sign tokens. Generate one using the console API Keys tool.|
|API Secret||Used to sign tokens, together with the corresponding API Key.|
A Sync application has two pieces - a client (our Android app) and a server. You can learn more about what the server app does by going through this guide. For now, let's just get a simple server running so we can use it to power our Android application.
Choose a download package for your server-side language of choice. If you're primarily a front-end developer and don't have a strong preference, Python, Node.js, or Ruby will probably get you up and running the fastest.
- Download for C#
- Download for Java
- Download for Node.js
- Download for PHP
- Download for Python
- Download for Ruby
Follow the instructions in the README for each starter application to configure and run it on your machine, using the four values we created above:
- Instructions for C#
- Instructions for Java
- Instructions for Node.js
- Instructions for PHP
- Instructions for Python
- Instructions for Ruby
Now that our server is set up, let's get the starter Android app up and running.
To get going quickly, there is a starter Android app. Download it now:
You can run the mobile app in the android emulator or on your own phone or tablet. Make sure the server is externally accessible, using ngrok or running it on a server with public IP.
Once the app loads in the simulator, you should see a UI like this one:
You can play tic-tac-toe with yourself or fire up a second emulator and have a crosses-vs-naughts battle! Add a third emulator to be a passive observer of changes on the board.
You're all set! From here, you can start building your own application. For guidance on integrating the Android SDK into your existing project, head over to our install guide. If you'd like to learn more about how Sync works, you might want to dive into our user identity guide, which talks about the relationship between the mobile app and the server.
Good luck and have fun!