亚马逊语义服务demo运行

1、下载官方demo(不知道是不是官方,中国论坛上很多都提到这个)

https://github.com/willblaschko/AlexaAndroid

2、导入Android studio后,注释掉app/build.gradle中signing.gradle的部分,因为demo中没有签名脚本

使用自己的签名,生成签名文件,在app/build.gradle中配置,如下所示

apply plugin: 'com.android.application'


//if (file('signing.gradle').exists()) {
//    apply from: 'signing.gradle'
//}else{
//    throw new TaskExecutionException(null, new Exception("Unable to find signing.gradle, please replace Android buildTypes > signing configs with your own configuration."));
//}

android {
    compileSdkVersion 24
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.willblaschko.android.alexavoicelibrary"
        minSdkVersion 21

        targetSdkVersion 24
        versionCode 5
        versionName "2.1.1"
        multiDexEnabled true;
    }

    signingConfigs {
        main {
            storeFile file("../demokey.jks") //签名文件路径
            storePassword "123456"
            keyAlias "key0"
            keyPassword "123456"
        }
    }
    buildTypes {
        debug{
            versionNameSuffix " Debug"
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.main
//            signingConfig signingConfigs.releaseConfig
        }
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.main
//            signingConfig signingConfigs.releaseConfig
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:multidex:1.0.1'

    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile project(path: ':libs:AlexaAndroid')
    compile project(path: ':libs:RecorderLevelView')
    compile project(path: ':libs:speechutils-master')

}

3、查看自己签名的md2,sha256配置在 开发者后台的设置里,并将api密钥拷贝在/assets/api_key.txt中,这里需要注意的是api密钥每次查看都会改变,查看了就要更新到文件中,没事别查看

https://developer.amazon.com/home.html

fae154652db66b6706d4974c27545066d39.jpg

配置完api密钥,还需要PRODUCT_ID

转载于:https://my.oschina.net/wfy94/blog/3029860

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值