Skip to content

Latest commit

 

History

History
111 lines (86 loc) · 5.3 KB

README.md

File metadata and controls

111 lines (86 loc) · 5.3 KB

Asgardeo Android SDK

To see the full details on how to integrate the Asgardeo Android SDK, refer to following documentation link.

Architecture of the Asgardeo Android SDK

The full details on the architecture of the Asgardeo Android SDK can be found here.

Development of the Asgardeo Android SDK

The Asgardeo Android SDK is developed using Kotlin and is built using the Android SDK. The SDK is developed to be optimized with the MVVM architecture.

Setup the Development Environment

  • Required versions.

Build the SDK

  1. Clone the repository.
  2. Open the project in Android Studio, and select the project to open with an Android view from the project view selection.
  3. You may require to sync the gradle files again. This can be done using the Sync project with Gradle files icon in the top right hand corner of the IDE (or in Apple Shift + Command + O).
  4. Build the project using the following command.
    ./gradlew clean build
    This can also be done using the Gradle side panel in Android Studio.

Release the SDK to Local Maven Repository

  1. Now you can make changes to the SDK. Once you have made the changes, you can build the SDK again using the above command.
  2. After building the SDK, you can release the SDK to the local Maven repository using the following command.
    ./gradlew clean assembleRelease
    ./gradlew publishToMavenLocal
    This will publish the SDK to the local Maven repository. You can find the SDK in the following location.
    ~/.m2/repository/io/asgardeo/asgardeo-android/<MAIN_VERSION>
    
    You can also find the SDK in the External Libraries section in the project view of Android Studio.
  3. Note the version of the SDK that you have released to the local Maven repository. You can find the version in the gradle.properties file in the root of the SDK project, in the variable MAIN_VERSION.

Caution

When commiting changes to the Github, make sure NOT TO UPDATE the version of the SDK in the gradle.properties file. This should be updated only when releasing the SDK to the Maven repository using the release Github Action.

Test the Changes

You can test the changes by running any Android application and including the SDK as a dependency. But it is recommended to use the sample application provided in wso2/sample-is repository.

Setup the Sample Application

  1. Clone the wso2/sample-is repository.
  2. Open the petcare-with-sdk(/petcare-sample/b2c/mobile-app/petcare-with-sdk) project in Android Studio.
  3. Read this documentation and setup the sample application with the necessary configurations to test your changes.

Include the changed SDK in the Sample Application

  1. Open the libs.version.toml file in the root of the sample application and change the version of the SDK to the version that you have released to the local Maven repository.

    [versions]
    ...
    asgardeoAndroid = "1.0.0-SNAPSHOT"
    ...
  2. Open the settings.gradle file in the root of the sample application and include mavenLocal() in the repositories.

    pluginManagement {
        repositories {
            ...
            mavenLocal()
        }
    }
    
    dependencyResolutionManagement {
        repositories {
            ...
            mavenLocal()
        }
    }

Tip

There are some reports that the mavenLocal() repository is not being resolved in the settings.gradle file. To resolve this issue, please refer to this StackOverflow thread.

  1. Build and run the sample application using the above mentioned documentation.

Create a Pull Request

After testing the changes, you can create a pull request to the asgardeo/mobile-ui-sdks repository. For more details about this, refer to the CONTRIBUTING.md file.