Skip to content

History / Overview of the Oppia Android codebase and architecture

Revisions

  • Fix part of #2747, #1532: Remove support for Gradle (#5652) ## Explanation Fixes part of #2747 Fixes #1532 This PR is doing a lot to address the vast majority of #2747--removing support for Gradle. It doesn't address everything, however--some items will need to be addressed in future PRs (largely new cleanup opportunities that are unlocked with the removal of Gradle). However, it does remove the entirety of Gradle definition infrastructure. This PR specifically: - Removes all Gradle build definitions (``.gradle`` files, ``settings.gradle``, the ``gradlew`` wrappers, and the ``gradle/wrapper`` directory). As a side benefit, this removes some of the last binary files from the codebase. :) - Removes a bunch of Gradle-specific files not actually used by the Bazel builds, including proguard-rules.pro files (Bazel has separate definitions under ``config/proguard/``), some manifest files, and some Robolectric-specific definitions. - Deletes the ``main.yml`` workflow (which was disabled in #5629). This is entirely a Gradle-specific workflow, so there's nothing that needs to be moved over as all of what's being tested is covered more efficiently and thoroughly in other specific workflow files. - Updates to ``.gitignore`` per the Gradle file removals (fewer files/directories need to be ignored). - Removed all TODOs on #1532 and marking it as fixed as part of this PR rather than performing the file rename. See https://github.com/oppia/oppia-android/issues/1532#issuecomment-2610933772 for an explanation on why. - Some comments have been updated rather than addressed where it made sense that addressing the problem was not exactly specific to Gradle support (there's a desire to remove all references to 'Gradle' as a clear way to ensure everything Gradle-specific has been successfully removed from the codebase--this has largely been done). - The infrastructure and definitions for segmenting tests between Bazel and Gradle has been completely removed (resulting in broad changes in the codebase) since Gradle-specific behaviors can't be tested anymore, and Bazel-specific behaviors are now the default. - Some of the waiting logic in ``StateFragmentTest`` and ``ExplorationActivityTest`` has been kept but had its removal TODO removed. This is because the code seems to have changed (or the original problem misunderstood). These waits seem actually necessary due to relying on real image loading, so the fix is more complex than simply "migrate to Bazel & move off of Gradle." There's real test infrastructure work needed to fix these tests properly, and it doesn't seem sufficiently important to prioritize (though note it did seem possible to remove the waits outright in ``ExplorationActivityTest`` without issue). The longer-term infrastructure work is tracked in #1523. - ``LoadLessonProtosFromAssets`` has been made default true (since it can't ever be false with Gradle removed). See the note below on removing JSON assets for the work to fully clean this up. - The removal of ``OppiaTestRunner`` as it was only used for Gradle builds to help it set up state correctly for orchestrated tests (i.e. Espresso). We may need to reintroduce something like this in the future, but for now there's no value in keeping an unused class. - Some simplifications in ``RepositoryFile`` and test removals in ``RepositoryFileTest`` now that Gradle build directories no longer need to be filtered. - ``TestEnvironmentConfig`` was removed since there's no longer a need to test which environment tests are currently running in. - Some Espresso documentation was removed since it's clearly no longer needed, but more documentation work is still needing to be completed (this was noticed due to the removal of ``OppiaTestRunner``). - ``ApiMockLoader`` was simplified now that test config artifacts are in a single location during testing time. - ``InitializeDefaultLocaleRule`` can now have nearly all of its reflection removed since it can be directly built to reference the classes that it's interacting with (which wasn't possible in the Gradle world, see the TODO in that class). Some new tests were added, as well, which brings its test coverage to 100%. - Updates CODEOWNERS to reflect all of the many file changes from the above. - Broad removal of the word 'module' in **many** locations and documentation. This term is generally replaced with the more architectural term 'layer' as to not overload 'module' from a Gradle, Bazel, and Dagger perspective (plus others). This required a lot of changes specifically in the Android Lint tool implementation and tests to try and keep the term 'module' specific to cases where it still makes sense (other than Dagger which is the bulk of the existing reference). - `TransformAndroidManifest` was updated to support adding top-level comments in manifest files (which are TODOs for #6010 to move or remove manifest files--see below). Tests were also added to test the new functionality. - A bunch of files were changed simply because my local editor removed trailing spaces and they were included in those various files that I happened to change (largely for 'module' reference renames and/or 'Gradle' reference removals/rewordings). Note also that this work opens up more things that still need to be, or can now be, addressed, including: - Removal of JSON lesson loading per #5663. We're no longer testing this behavior correctly as domain level tests would previously verify JSON loading logic in Gradle builds and proto logic in Bazel builds. This means there's a strong likelihood of breakages occurring if JSON loading isn't removed. - Ensuring Espresso tests can actually run with Bazel (see #4991). We no longer can verify Espresso behaviors now that Gradle is removed, which also subsequently means all test gating on Robolectric is redundant and all tests gated on Espresso never run. - It's possible #4748 is now made redundant with the removal of Gradle-specific ``robolectric.properties`` files, though I'm not entirely certain at this point which SDK version is used in Bazel tests for Robolectric (other than it being tied to Robolectric version and that we pull in all supported SDKs so that tests can selectively opt into specific SDKs for testing). - Possibly some of the language configuration bits can be simplified now that we don't need to gracefully fail if the configuration is missing (since it never should be), but there's no plan to audit or track work for this. - Reorganization of the codebase now that Gradle no longer imposes arbitrary modules (see https://github.com/oppia/oppia-android/issues/59#issuecomment-528217795) as well as fixing testing artifact isolation (multiple issues tracking parts of this, and ideas possibly not yet captured in issues). - `genrule`s can now be removed to improve symbol analysis in Android Studio (and general build system complexity). See #1617. - Some documentation can potentially be improved, but with the replacement of the terms 'Gradle' and 'module' (plus past documentation changes that happened as a result of moving the team over to Bazel exclusively) much of the existing documentation seems solid. - It may now be possible to update to newer versions of Kotlin and Robolectric without worrying about AGP incompatibilities. - Moving the app `AndroidManifest.xml` from the app directory to the top-level directory to address #1640. Unfortunately this can't be done as part of this PR (as previously attempted) due to #6010 and required changes to the Android Lint script. Note that the addressing of #6010 also allows other manifests to potentially be removed and, hopefully, a reduction of manifests to the bare minimum (the top-level plus any asset-holding libraries--at least for now). ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only There are no known UI effects from removing Gradle support, but build infrastructure is complex and this is _not_ a no-op change. It's expected that the Bazel builds are relatively the same as before, however (see the APK & AAB differences analysis), so there shouldn't be an UI or UX changes as a result of this work.

    @BenHenning BenHenning committed Dec 16, 2025
  • Rename tabs to 'Learn' and 'Study'; update 'revision card' to 'study … (#5668) ## Explanation Fixes #5651 ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [ ] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing ## UI Changes # Before ![image](https://github.com/user-attachments/assets/d4be38fb-6516-4a4d-a6d2-c704fb3acec7) # After ![image](https://github.com/user-attachments/assets/a6a9c255-89e7-4cfd-b68b-07738e9d0ea8) - I can't find the use of 'revision card' --------- Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>

    @jainv4156 jainv4156 committed Feb 6, 2025
  • Fix #5017 : Updated example screenshots in wiki as per new oppia-android ui (#5107) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fix #5017 : Updated example screenshots in wiki as per new oppia-android ui <!-- - Explain what your PR does. If this PR fixes an existing bug, please include - "Fixes #bugnum:" in the explanation so that GitHub can auto-close the issue - when this PR is merged. --> ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [ ] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

    @MohitGupta121 MohitGupta121 committed Jul 28, 2023
  • How to use GitHub’s search feature to search the wiki (#4961) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation How to use GitHub’s search feature to search the wiki - With this contributor easily search and navigate to desire wiki page. - Added TOC in all wikis pages. <!-- - Explain what your PR does. If this PR fixes an existing bug, please include - "Fixes #bugnum:" in the explanation so that GitHub can auto-close the issue - when this PR is merged. --> ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

    @MohitGupta121 MohitGupta121 committed May 9, 2023
  • Fix #4622: Android Wiki migration (#4893) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation <!-- - Explain what your PR does. If this PR fixes an existing bug, please include - "Fixes #bugnum:" in the explanation so that GitHub can auto-close the issue - when this PR is merged. --> - Fixes #4622 - The PR does the following: This PR moves the android wiki into the oppia-andoird codebase allowing contributors to make PRs to the wiki along with changes to the codebase itself. This PR also introduces a GitHub Action (Runs when a PR is merged into develop and when a user makes change to the wiki via the web interface) that copies the content of the wiki folder along with the git history of the wiki folder and deploys it to the oppia-android wiki repository. The steps followed to achieve this wiki migration are present here: [Oppia Android Wiki Migration V2 (1).pdf](https://github.com/oppia/oppia-android/files/10921370/Oppia.Android.Wiki.Migration.V2.1.pdf) ### Note: Please ensure GitHub actions have write permissions. Please follow these instructions to enable it: [GrantingReadandWritePermissionsonGitHub_PDF.pdf](https://github.com/oppia/oppia-android/files/10919834/GrantingReadandWritePermissionsonGitHub_PDF.pdf) ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-(A11y)-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --------- Co-authored-by: Rajat Talesra <rajattalesra4914@gmail.com> Co-authored-by: Ben Henning <henning.benmax@gmail.com> Co-authored-by: Akshay Nandwana <akshaynandwana001@gmail.com> Co-authored-by: Srikanth K B <srikanth.kadaba@gmail.com> Co-authored-by: Jan <fsharpasharp@users.noreply.github.com> Co-authored-by: Abhay Garg <54636525+prayutsu@users.noreply.github.com> Co-authored-by: Arjun Gupta <arjupta.90@gmail.com> Co-authored-by: Sparsh Agrawal <55937724+Sparsh1212@users.noreply.github.com> Co-authored-by: Farees Hussain <fareezzhussain@gmail.com> Co-authored-by: Sarthak Agarwal <agarwal.sarthak262012@gmail.com> Co-authored-by: Sean Lip <sean@seanlip.org> Co-authored-by: Apoorv Srivastava <53645584+MaskedCarrot@users.noreply.github.com> Co-authored-by: Vinita Murthi <murthi.vinita@gmail.com> Co-authored-by: Ankita Saxena <ankitasonu24@gmail.com> Co-authored-by: Vojtěch Jelínek <vojtech.jelinek@hey.com> Co-authored-by: Ben Henning <ben@oppia.org>

    @gp201 gp201 committed Mar 17, 2023