DiegoAPP–整体架构介绍

21 篇文章 0 订阅
17 篇文章 0 订阅

更多创客作品,请关注笔者网站园丁鸟,搜集全球极具创意,且有价值的创客作品


1.开发环境

RobotCA是采用Eclipse进行开发,在DiegoAPP中将整个项目迁移到了Android Studio 3.4开发,有兴趣的同学可以到https://www.diegorobot.com下载试用。
在这里插入图片描述
Android Studio中Gradle 和Gradle Plugin的版本入下图,Gradle和Gradle Plugin的版本非常重要,其他的版本会出现一些编译错误。
在这里插入图片描述
Diego APP支持了Android8.0,Android8.1,Android9.0版本,适应现在主流的Android手机,其他版本的也可以下载最新的Android SDK进行编译,但有由于Android升级过程中接口函数会有所变化,故可能会影响正常的运行,如闪退等异常。
在这里插入图片描述
2.项目架构
Diego APP的目录组织结构符合Android Studio APP的项目组织规范
在这里插入图片描述
com.diegorobot.app是主要的程序目录

Core:主要的控制逻辑代码,包括Robot的控制,Map,导航等。
Dialogs:对话框的逻辑代码,对应res中的对话框资源
Fragments:对应与res中视图的控制代码
Layers:针对需要渲染的层的逻辑代码,现在只有针对激光雷达数据的渲染代码
Views:对应res的视图文件的控制代码
ControlAPP:主要的控制Activity,APP在连接进入控制模式后,运行此Activity
RobotChooser:APP启动时的Activity,用来配置连接信息,显示Robot列表
ToolbarActionItemTarget:Robot列表中的工具条对应的类

2.Build.gradle
App的编译配置文件中定义了App支持的版本,依赖的包等信息,特别是编译时所涉及到包,一定要正确,否则会出现编译异常, build.gradle代码如下

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.diegorobot.app"
        minSdkVersion 26
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}


configurations {
    all*.exclude group: 'org.ros.rosjava_bootstrap', module: 'gradle_plugins'
}
repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
    }
    //maven { url "https://jitpack.io" }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'org.ros.android_core:android_core_components:0.4.0'
    implementation 'com.github.rosjava.android_extras:gingerbread:[0.3,0.4)'
    implementation 'org.ros.rosjava_messages:tf2_msgs:[0.5,0.6)'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'org.apache.commons:commons-lang3:3.9'
    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
    //testCompile 'junit:junit:4.12'
}



dependencies {
    // Required -- JUnit 4 framework
    testImplementation 'junit:junit:4.12'
    // Optional -- Mockito framework
    testImplementation 'org.mockito:mockito-core:2.27.0'

    androidTestImplementation 'com.android.support:support-annotations:28.0.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    // Optional -- Hamcrest library
    androidTestImplementation 'org.hamcrest:hamcrest-library:2.1'
    // Optional -- UI testing with Espresso
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    // Optional -- UI testing with UI Automator
//    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v15'
}


configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    resolutionStrategy.force 'junit:junit:4.12'
}
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DiegoRobot

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值