2

我正在尝试使用基于 android 的移动应用程序访问存储在 aws-ssm 参数存储中的值。

android 支持几乎所有 aws 服务,但不支持 aws-ssm。

https://aws-amplify.github.io/aws-sdk-android/docs/reference/index.html

在java库中已经有一个ssm的子库:

https://github.com/aws/aws-sdk-java/tree/master/aws-java-sdk-ssm

但这并没有真正帮助我。

我将不胜感激这方面的任何帮助。

4

1 回答 1

0

We got this to work by creating a new library for our project by ourselves, which imported the java classes and we modified them to work with android.

Project Screenshot Android Studio

In the main app in the build.gradle file

implementation project(':aws-android-sdk-ssm')

and the build.gradle of that library

apply plugin: 'com.android.library'

android {
    compileSdkVersion project.ext.compileSdkVersion
    defaultConfig {
        minSdkVersion project.ext.minSdkVersion
        targetSdkVersion project.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles 'consumer-rules.pro'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.amazonaws:aws-android-sdk-core:2.13.4'

    testImplementation 'junit:junit:4.12'

    androidTestImplementation 'androidx.test:core:1.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'

    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
}
于 2020-01-27T09:45:11.423 回答