-
Notifications
You must be signed in to change notification settings - Fork 533
Installing Oppia Android
This wiki page explains how to install Oppia Android on your local machine. If you run into any issues with the installation process, please feel free to ask on GitHub Discussions, so that we can help you while also making these instructions better for other developers. Thanks!
Note: Once you have set up the app locally, you might want to contribute code to the repository. Please follow our onboarding instructions to get started!
-
Download/Install the latest version of Android Studio.
-
Download and Install Java 8 using the links from the Java website.
-
Note for Windows users: Make sure to also set up the PATH system variable correctly for
Java
, following these instructions. - Instructions for Linux users.
- Instructions for Mac users.
-
Note for Windows users: Make sure to also set up the PATH system variable correctly for
-
In Android Studio, open Tools > SDK Manager.
- In the "SDK Platforms" tab (which is the default), select
API Level 28
and alsoAPI Level 31
(for Bazel support). - Also, navigate to the "SDK Tools" tab, click the "Show Package Details" checkbox at the bottom right, then click on "Android SDK Build-Tools 34-rc1" and select 29.0.2 (this is needed for Bazel support).
Then, click "Apply" to download and install these two SDKs/Tools.
- In the "SDK Platforms" tab (which is the default), select
Please follow these steps to set up Oppia Android on your local machine.
-
Create a new, empty folder called
opensource/
within your home folder. Navigate to it (cd opensource
), then fork and clone the Oppia-Android repo. This will create a new folder namedopensource/oppia-android
. Note that contributors who have write access to the repository may either create branches directly on oppia/oppia-android or use a fork.Note: Please keep the folder name as
oppia-android
. Changing the project folder name might lead to future issues with running the pre-push checks on your machine. -
Run the setup script, which adds some development tools for Oppia Android (ktlint, checkstyle, etc.):
-
For Mac or Linux
- Open a terminal and navigate to
opensource/oppia-android/
. - Run the script
bash scripts/setup.sh
.
- Open a terminal and navigate to
-
For Mac with Apple M1 chip
- Locate Terminal in Finder.
- Right-click and create a duplicate Terminal (and rename it accordingly, say Terminal x86, to avoid confusion).
- In the Terminal x86, right-click and click "Get info", and check the option "Open using Rosetta".
- Navigate to
opensource/oppia-android/
in Rosetta. - Finally, run
bash scripts/setup.sh
in Terminal x86 and all the required files should be generated. (You should see messages likeKtlint file downloaded
, etc.)
-
For Windows
- Install Git Bash Command Line
- Open Git Bash Command Line.
- Navigate to
opensource/oppia-android/
. - Run the script
bash scripts/setup.sh
. - Download the google_checks.xml file. To do this, you can simply right-click on the
Raw
button and click onSave Link as
. - Copy this file to the directory where Git is installed (usually C:/Program Files/Git/).
-
-
In Android Studio, select
File > Open
, navigate toopensource/oppia-android/
, and clickOK
to load the project. -
Click the elephant icon in the toolbar ("Sync Gradle") to ensure that all the correct dependencies are downloaded. (In general, you'll want to do this step any time you update your dependencies.)
-
Go to Tools > Device manager, click "Create Virtual Device...". Then:
- Select a preferred device definition. In general, any device is fine, but you can use Pixel 3a as a default (if you're developing for phones) or Nexus 7 (if you're developing for tablets). After selecting a device, click "Next" at the bottom right to continue.
- Select a system image (in general, API Level 28, unless you're an M1 Mac user, in which case use API Level 29). Then click "Next".
- Click "Finish" to complete setup.
-
To run the app, select the emulator device you want from the dropdown menu to the left of the "Run" button in the toolbar.
-
Finally, click the "Run" button.
Have an idea for how to improve the wiki? Please help make our documentation better by following our instructions for contributing to the wiki.
Core documentation
Developing Oppia
- Contributing to Oppia Android
- Bazel
- Key Workflows
- Testing
- Developing Skills
- Frequent Errors and Solutions
- RTL Guidelines
- Working on UI
- Writing Design Docs
Developer Reference
- Code style
- Background Processing
- Dark mode
- Buf Guide
- Firebase Console Guide
- Platform Parameters & Feature Flags
- Work Manager
- Dependency Injection with Dagger
- Revert & regression policy
- Upgrading target SDK version
- Spotlight Guide
- Triaging Process
- Bazel
- Internationalization
- Terminology in Oppia
- Past Events