Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update project documentation #255

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Documentation/APIs_Compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# APIs Compatibility

This documentation offers guidance on a workaround for utilizing mobile APIs with earlier versions of Open edX releases.

In December 2023, the [FC-0031 project](https://github.com/openedx/edx-platform/issues/33304) introduced new APIs, and the Open edX mobile apps were transitioned to utilize them.

If your platform version is older than December 2023, follow the instructions below:

1. Setup the [mobile-api-extensions](https://github.com/raccoongang/mobile-api-extensions) plugin to your platform.
The Plugin contains extended Open edX APIs for mobile applications.
2. Roll back the modifications that brought in the new APIs [3bca8bf](https://github.com/openedx/openedx-app-ios/commit/3bca8bfa994163635e1128f0404007c6d0d4761f).
HamzaIsrar12 marked this conversation as resolved.
Show resolved Hide resolved
97 changes: 97 additions & 0 deletions Documentation/ConfigurationManagement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Configuration Management

This documentation provides a comprehensive solution for integrating and managing configuration files in Open edX Android project.

## Features
- Parsing config.yaml files
- Adding essential keys to `AndroidManifest.xml` (e.g. Microsoft keys)
- Generating Android build config fields.
- Generating config.json file to use the configuration fields at runtime.
- Generating google-services.json with Firebase keys.

Inside the `Config.kt`, parsing and populating relevant keys and classes are done, e.g. `AgreementUrlsConfig.kt` and `FirebaseConfig.kt`.

## Getting Started

### Configuration Setup

Edit the `config_settings.yaml` in the `default_config` folder. It should contain data as follows:

```yaml
config_directory: '{path_to_config_folder}'
HamzaIsrar12 marked this conversation as resolved.
Show resolved Hide resolved
config_mapping:
prod: 'prod'
stage: 'stage'
dev: 'dev'
# These mappings are configurable, e.g. dev: 'prod_test'
```

- `config_directory` provides the path of the config directory.
- `config_mappings` provides mappings that can be utilized to map the Android Build Variant to a defined folder within the config directory, and it will be referenced.

### Configuration Files
In the `default_config` folder, select your environment folder: prod, stage, dev or any other you have created.
Open `config.yaml` and fill in the required fields.

Example:

```yaml
API_HOST_URL: 'https://mylmsexample.com'
APPLICATION_ID: 'org.openedx.app'
ENVIRONMENT_DISPLAY_NAME: 'MyLMSExample'
FEEDBACK_EMAIL_ADDRESS: 'support@mylmsexample.com'
OAUTH_CLIENT_ID: 'YOUR_OAUTH_CLIENT_ID'

PLATFORM_NAME: "MyLMS"
TOKEN_TYPE: "JWT"

FIREBASE:
ENABLED: false
ANALYTICS_SOURCE: ''
CLOUD_MESSAGING_ENABLED: false
PROJECT_NUMBER: ''
PROJECT_ID: ''
APPLICATION_ID: ''
API_KEY: ''

MICROSOFT:
ENABLED: false
CLIENT_ID: 'microsoftClientID'
```

## Available Third-Party Services
- **Firebase:** Analytics, Crashlytics, Cloud Messaging
- **Google:** Sign in and Sign up via Google
- **Microsoft:** Sign in and Sign up via Microsoft
- **Facebook:** Sign in and Sign up via Facebook
- **Branch:** Deeplinks
- **Braze:** Could Messaging
- **SegmentIO:** Analytics

## Available Feature Flags
HamzaIsrar12 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to mention other features like Agreement Urls, Discovery, Program etc? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel it's necessary to mention them now, since we store their default keys in the config.yaml file.
We can add documentation on them later.

- **WHATS_NEW_ENABLED:** Enables the "What's New" feature to present the latest changes to the user.
- **SOCIAL_AUTH_ENABLED:** Enables SSO buttons on the SignIn and SignUp screens.
- **COURSE_NESTED_LIST_ENABLED:** Enables an alternative visual representation for the course structure.
- **COURSE_BANNER_ENABLED:** Enables the display of the course image on the Course Home screen.
- **COURSE_TOP_TAB_BAR_ENABLED:** Enables an alternative navigation on the Course Home screen.
- **COURSE_UNIT_PROGRESS_ENABLED:** Enables the display of the unit progress within the courseware.

## Future Support
- To add config related to some other service, create a class, e.g. `ServiceNameConfig.kt`, to be able to populate related fields.
- Create a `function` in the `Config.kt` to be able to parse and use the newly created service from the main Config.

Example:

```Kotlin
fun getServiceNameConfig(): ServiceNameConfig {
return getObjectOrNewInstance(SERVICE_NAME_KEY, ServiceNameConfig::class.java)
}
```

```yaml
SERVICE_NAME:
ENABLED: false
KEY: ''
```

The `default_config` directory is added to the project to provide an idea of how to write config YAML files.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EducationX Android
# Open edX Android

Modern vision of the mobile application for the Open EdX platform from Raccoon Gang.
Modern vision of the mobile application for the Open edX platform from Raccoon Gang.

[Documentation](Documentation/Documentation.md)

Expand All @@ -14,17 +14,16 @@ Modern vision of the mobile application for the Open EdX platform from Raccoon G

3. Choose ``openedx-app-android``.

4. Configure the [config.yaml](default_config/dev/config.yaml) with URLs and OAuth credentials for your Open edX instance.
4. Configure `config_settings.yaml` inside `default_config` and `config.yaml` inside sub direcroties to point to your Open edX configuration. [Configuration Docuementation](./Documentation/ConfigurationManagement.md)

HamzaIsrar12 marked this conversation as resolved.
Show resolved Hide resolved
5. Select the build variant ``develop``, ``stage``, or ``prod``.

6. Click the **Run** button.

## API plugin
## API
This project targets on the latest Open edX release and rely on the relevant mobile APIs.

This project uses custom APIs to improve performance and reduce the number of requests to the server.

You can find the plugin with the API and installation guide [here](https://github.com/raccoongang/mobile-api-extensions).
If your platform version is older than December 2023, please follow the instructions to use the [API Plugin](./Documentation/APIs_Compatibility.md).

## License

Expand Down
Loading