Android 如何使用浓缩咖啡从多媒体资料中选择多个图像?

Android 如何使用浓缩咖啡从多媒体资料中选择多个图像?,android,mockito,android-testing,android-espresso,android-uiautomator,Android,Mockito,Android Testing,Android Espresso,Android Uiautomator,正如我在文档中读到的那样,浓缩咖啡无法访问外部应用程序,如camera、gallery,但在我的应用程序中,我想测试从gallery添加图像,从camera拍摄照片并添加它。 我听说过UiAutomator,但它只支持API 18+,我的应用程序使用API 14及以上版本 现在如何测试从多媒体资料中添加多张图像和添加从相机拍摄的照片? 我听说了Intento,但不知道如何使用它以及它的具体功能是什么?我猜它是模仿Intento的结果 您可以为测试模块设置不同的minSdk。在..android

正如我在文档中读到的那样,浓缩咖啡无法访问外部应用程序,如camera、gallery,但在我的应用程序中,我想测试从gallery添加图像,从camera拍摄照片并添加它。

我听说过UiAutomator,但它只支持API 18+
,我的应用程序使用API 14及以上版本

  • 现在如何测试从多媒体资料中添加多张图像和添加从相机拍摄的照片?

  • 我听说了Intento,但不知道如何使用它以及它的具体功能是什么?我猜它是模仿Intento的结果


您可以为测试模块设置不同的minSdk。在..androidTest/文件夹中创建一个包含以下内容的AndroidManifest.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:tools="http://schemas.android.com/tools"
    package="your.app.package">

    <uses-sdk tools:overrideLibrary="android.support.test.uiautomator.v18"/>
</manifest>

现在,当您使用uiautomator的依赖项执行gradle同步时,它应该可以工作了