当前位置 博文首页 > mdxiaohu的博客:Android个人项目之虎宝语音

    mdxiaohu的博客:Android个人项目之虎宝语音

    作者:[db:作者] 时间:2021-07-09 12:33

    GitHub地址:https://github.com/mdxiaohu/androidHuBaoVoice


    这是之前做的一个简单个人APP。

    我将它命名为虎宝语音。

    主要实现的是登录、注册和语音的听写功能。

    当时的目的是为了试验调用讯飞语音识别功能,所以只是简单做了下。

    先看下界面。

    主要代码:

    build.gradle

    apply plugin: 'com.android.application'
    
    apply plugin: 'com.mob.sdk'
    
    // 在MobSDK的扩展中注册SMSSDK的相关信息
    MobSDK {
        appKey "你自己的"
        appSecret "你自己的"
    
        SMSSDK {}
    }
    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "com.example.dhy203grapp01"
            minSdkVersion 22
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
        implementation 'com.android.support.constraint:constraint-layout:1.1.1'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
        implementation files('libs/Msc.jar')
    }
    
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        
        repositories {
            google()
            jcenter()
            // 添加MobSDK的maven地址
            maven {
                url "http://mvn.mob.com/android"
            }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            // 注册MobSDK
            classpath 'com.mob.sdk:MobSDK:+'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    应该还要改一些东西,具体你可以直接将项目下载后看。

    项目比较简单,没什么大的难点,我就不多说了。

    感兴趣的可以去讯飞官网看一下接口文档。

    cs