These instructions will help you to set up your development environment, get the source code of the Nextcloud Talk for Android app and build it by yourself. If you want to help developing the app take a look to the contribution guidelines.
Sections 1) and 2) are common for any environment. The rest of the sections describe how to set up a project in different tool environments. Nowadays we recommend to use Android Studio (section 2), but you can also build the app from the command line (section 3).
If you have any problem, remove the 'talk-android' folder, start again from 1) and work your way down. If something still does not work as described here, please open a new issue describing exactly what you did, what happened, and what should have happened.
There are some tools needed, no matter what is your specific IDE or build tool of preference.
git is used to access to the different versions of the Nextcloud's source code. Download and install the version appropriate for your operating system from here. Add the full path to the 'bin/' directory from your git installation into the PATH variable of your environment so that it can be used from any location.
Android Studio is currently the official Android IDE. Due to this, we recommend it as the IDE to use in your development environment. Follow the installation instructions here.
We recommend to use the last version available in the stable channel of Android Studio updates.
The Android SDK is necessary to build the app. Install it via Android Studio itself:
After installing it, add the full path to the directories 'tools/' and 'platform-tools/' from your Android SDK installation into the PATH variable of your environment.
Open the Android SDK Manager under Android Studio's settings
Settings→
Languages & Frameworks→
Android SDK```
To build the Nextcloud for Android app you will need to install at least the next SDK packages:
Install any other package you consider interesting, such as emulators.
After installing it, add the full path to the directories 'tools/' and 'platform-tools/' from your Android SDK installation into the PATH variable of your environment.
Fork and download the nextcloud/talk-android repository.
You will need git to access to the different versions of the Nextcloud's source code. The source code is hosted on GitHub and may be read by anybody, without a GitHub account. You will need one if you want to contribute to the development of the app with your own code.
The next steps will assume you have a GitHub account and that you will get the code from your own fork.
git clone --recursive https://github.com/YOURGITHUBNAME/talk-android.git
.cd talk-android
.git pull origin master
git remote add upstream https://github.com/nextcloud/talk-android.git
git pull upstream master
At this point you can continue using different tools to build the project. Sections Working with Android Studio and Working in a terminal with gradle describe the existing alternatives.
To set up the project in Android Studio follow the next steps:
Settings
→ Editor
→ Code Style
→ Scheme: Project
and Enable EditorConfig support
(should be enabled by default)Gradle is the build system used by Android Studio to manage the building operations on Android apps. You do not need to install gradle in your system, and Google recommends not to do it, but instead trusting on the Gradle wrapper included in the project.
gradlew.bat clean assembleGplay
or gradlew.bat clean assembleGeneric
./gradlew clean assembleGplay
or ./gradlew clean assembleGeneric
The first time the gradle wrapper is called, the correct gradle version will be downloaded automatically. This requires a working Internet connection.
The generated APK file is saved in app/build/outputs/apk
as app-generic-debug.apk
.
The app is currently equipped to be built with three flavours:
The default settings for gradle is to limit the compilation to 1GB of heap. You can increase that value by:
org.gradle.jvmargs=-Xmx4G
to gradle.properties
andGRADLE_OPTS="-Xmx4G" ./gradlew clean build"