Starting Your Own Project


Introduction

This tutorial will walk you through starting your own project that includes a server module and a client node (application) module in Android Studio. To get started, download the Berkeley Telemonitoring source code and extract it. We refer to the root directory as the directory that includes the directories lib and examples. In Android Studio, choose the option to open an existing project and point it to the root directory. Once this is done, the project structure should look as depicted in Figure 1.

The modules GenericExample-client, GenericExample-server, RunningCoach-client and RunningCoach-server are example modules that you can browse for further learning.

Creating a server module

To create a server module, select New Module from the File -> New menu as depicted in Figure 2. From the Create New Module dialog, select Java Library (Figure 3).

New module

Figure 2. Creating new module.

Creating a Java module

Figure 3. Creating a Java module

Java module settings

Figure 4. Java module settings

The server build.gradle file should look like this:

The highlighted lines can be edited to reflect your specific project. For the purposes of the running example in this tutorial, we will use the package name edu.berkeley.telemonitoring.runningexample.serverfor the server module.

Creating a client node module

To create a client module, select New Module from the File -> New menu as depicted in Figure 2. From the Create New Module dialog, select Phone & Tablet Module (Figure 5).

The client node build.gradle

The highlighted lines can be edited to reflect your specific project. For the purposes of the running example in this tutorial, we will use the package name edu.berkeley.telemonitoring.runningexample.clientfor the client module. The lines 30-35 are added in order to prevent conflicts in the resulting application package (.apk file) as a result of files with the same name coming from different dependencies and libraries. We are working on a better solution that would include all these files from the different libraries without any conflicts.