android - 应用程序特定目录未在 android 的外部存储目录中创建
问题描述
我的应用程序名称是“com.example.storagecheckapp”
1)我已经使用命令“adb install storagecheckapp.apk”安装了应用程序
- 检查是否在存储目录中创建了应用程序特定目录。但默认情况下不创建该目录
adb shell ls -la /storage/emulated/0/Android/data/com.example.storagecheckapp /storage/emulated/0/Android/data/com.example.storagecheckapp :没有这样的文件或目录
- 然后,我调用了 api“File(getExternalFilesDir(null);”这有助于在外部存储目录中创建“com.example.storagecheckapp”。
adb shell ls -la /storage/emulated/0/Android/data/com.example.storagecheckapp/
共 9 个
drwxrwx--x 3 u0_a146 sdcard_rw 3488 2021-02-06 14:45。
drwxrwx--x 30 根 sdcard_rw 3488 2021-02-06 15:39 ..
drwxrwx--x 2 u0_a146 sdcard_rw 3488 2021-02-06 14:45 文件
问题是:为什么没有在外部存储中创建应用程序特定目录(安装 thapp 后自动创建)?
我已经检查了 sdk 29 和 30,同样的问题仍然存在吗?请建议..
解决方案
为什么没有在外部存储中创建应用程序特定目录(安装 thapp 后自动创建)?
这不是 Android 的工作方式。Android 会根据需要延迟创建目录。毕竟,并不是每个 Android 应用程序都需要该目录。
推荐阅读
- spring - Spring RestTemplate Gzip 响应缺少 Content-Length 标头
- odbc - 在 Linux mint 中安装 ODBC
- javascript - 在节拍器播放时数音符
- java - 如何在html中循环遍历对象的ArrayList
- javascript - const 关键字和方法声明的问题
- c - 需要帮助在我的自定义 CLI 中使用 ncurses 进行命令输出分页
- javascript - 从 iframe 发出的消息上的 window.addEventListener
- google-apps-script - 使用 Google Apps 脚本的 Google 表格中的协作者人数上限
- javascript - Ionic 4 和使用材料标签路由器出口
- javascript - 反应返回错误解码器消息消息