Android File Storage App

Build an Android file storage mobile app using Android Studio, and associate it with a Catalyst project using Catalyst Android SDK to store files securely in the project's File Store

Update Gradle Build Scripts

You must make some minor updates in the Gradle build scripts of the Android project. Gradle provides you with the flexibility to define your own custom build configurations, in place of the default build configurations that an Android project is created with. Gradle entirely handles the app's build process and enables you to run the app effectively.

You must update two of the build configuration files in your Android project: settings.gradle, and the module-level build.gradle.

settings.gradle:

  1. Open settings.gradle from the Gradle scripts and locate the dependencyResolutionManagement{} interface.
  2. Replace the default code with the following code:
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
            maven {
                url = uri("https://maven.zohodl.com/")
            }
    jcenter()
        }
    }
    

    This defines the repositories to be added to the project, and configures the dependency resolution for the build.

    Ensure that the following last two lines of the default code are still present, because Gradle will not be able to process the build without them:

    rootProject.name="ZCDrive"
    	include':app'
    	

build.gradle:

The module-level build.gradle file enables you to configure build settings specific to that particular module. For example, you can configure the minimum SDK and target SDK the app must be compatible with, the compile options, dependencies, or the JVM bytecode the Kotlin compiler must generate.

  1. Open build.gradle (Module: ZCDrive.app) from the Gradle scripts and locate the android{} object. Set the following values for these parameters in it:

    compileSdk 30
    targetSdk 30
  2. Replace the default dependencies{} module with the following code:
    Copied dependencies {
    	implementation 'androidx.core:core-ktx:1.6.0'
    	implementation 'androidx.appcompat:appcompat:1.3.1'
    	implementation 'com.google.android.material:material:1.4.0'
    	implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    	implementation 'com.zoho.catalyst:android-sdk:2.0.0'
    	testImplementation 'junit:junit:4.+'
    	androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    	androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    	}
    	
    After you have made these changes, Gradle will need to synchronize the project build. Click Sync Now if prompted.

The custom build configurations are updated. We can now build the Android project and test the app in Android Studio.