This tutorial will guide you through downloading, building and running the telehealth chat demo for Android. You will then optionally make some basic changes to the app. Don’t worry if you have little or no Android experience because this tutorial is aimed at all levels but if you are comfortable with Android Studio, you might want to clone the code and skim this step.
You’ll need the following before you begin:
The Telehealth demo app for Android is available from https://github.com/pubnub/chat-components-android-examples. This patient-doctor chat application uses PubNub’s Chat Components, which are pre-built UI and data building blocks to quickly create functional and visually appealing chat apps.
You can either:
Launch Android Studio and from the welcome screen and select ‘Get from Version Control’ which can be found under the three dots next to the ‘Open’ button.
Then when prompted to enter the repository URL, enter the following: https://github.com/pubnub/chat-components-android-examples and press ‘Clone’.
Or you can invoke the git tool from a terminal to clone the source code. Navigate to an empty folder and enter the following command:
Or if you would rather download the source code as a zip file, click on the ‘Code’ button on GitHub and select ‘Download ZIP’. You will need to unzip the file before you can load the source.
Other options exist, GitHub is very flexible :)
If you do not already have the project loaded, launch Andriod Studio then select File → Open.
Select the directory where the source code is located and ‘Open’
IMPORTANT NOTE: If you do not see the '
telehealth-example' project in Android Studio then the most likely reason is because the files are temporarily unavailable on the master branch. To fix this, switch to the
telehealth-example branch. If you are unsure how to do this please see the above video or follow this guide.
Scroll to the bottom of the project files list and open gradle.properties. At the bottom of gradle.properties you will notice two entries for PubNub keys:
You are not ready to run the application until you obtain those PubSub keys, so that is the next step.