问题标签 [android-internal-storage]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
931 浏览

android - Android - 如何从内部存储中获取所有文件路径或从内部存储中删除所有文件

我在一个项目的中间,我将文件存储在内部存储中,如下所示:

创建文件后,我可以按我在创建文件时给出的名称删除文件,如下所示:

这一切都已经完成并且正在工作。

我的问题是我想获取存储在内部存储中的所有文件而不指定文件名。

注意:我可以通过一个一个指定名称来获取文件。

但是我可以从内部存储中获取所有文件还是直接删除所有文件而不指定每个文件名。

0 投票
0 回答
55 浏览

android - 为什么将项目添加到 Arraylist 时,我的 android 应用程序的内部文件大小会翻倍?

情况:我有一个安卓应用程序。在这个 android 应用程序中,我有一个包含“用户”类的内部文件(参见下面的代码),这个用户类有一个由支出组成的数组列表,“支出”类由几个不同的基本属性组成。

问题:当我从内部文件中获取此用户时,将“支出”对象添加到用户的数组列表中,然后重新保存此用户(删除文件并重新创建),它将支出数组列表的大小翻倍。我什至通过查看文件本身来观察它,并且可以清楚地看到每次添加支出时整个数组列表都会翻倍。用户似乎没有重复。我只尝试了相同的过程而没有增加支出,而且它保存得很好,没有重复。

用户类:

我的消费类:

}

我的班级 StorageHelper:

主要活动 :

0 投票
0 回答
999 浏览

android - 如何获取用户手机中相册的URL?

我想要一个 OpenCV4Android 方法imwrite()将图像保存在用户手机的照片库中:

第一个参数是用户照片库的路径。我需要那条路。

例如,如果我想将照片存储在external storageDCIM内部的目录中,我会使用路径。"/mnt/sdcard/DCIM/file_name.jpg"

理想情况下,我想在照片库中创建一个新文件夹并将文件存储在该文件夹中(就像 Instagram 一样,当我们在 Instagram 中捕获或编辑照片时,Instagram会在照片库中创建一个名为的文件夹,并且捕获的照片或编辑的存储在那里)。

0 投票
3 回答
81 浏览

java - Populating an Android ListView with data from an ArrayList is setting each item to be the same as the first

I'm working with the android studio and trying to populate a ListView with data, which is stored in files on the devices internal storage. I am able to create a list with the exact number of item as there are files but they should all be displaying different information. At the moment, they are all displaying that same data as the first item in the ArrayList.

Here is the code:

I can confirm that different data is being stored. Changing the item which comes first is the array changes all the items.

Thanks for the help.

0 投票
1 回答
187 浏览

android - Copying from /data/app folder using superuser

I am trying to copy files from /data/app folder, but facing the following issues, please advice.

  1. Error is, Required : android.os.Process, Found : java.lang.Process in the first line of the code.
  2. Cannot resolve symbol, getOutputStream in the second line.

Kindly let me know why these issues occur, and how do I resolve them. Thanks.

0 投票
2 回答
193 浏览

android - 如何将 txt 数据文件从 Android 应用程序传输到 Windows

我有一个 Android 应用程序,它生成一些数据(简单文本文件),我想将这些数据传输到我的 PC 以进行进一步处理。我的理解是,我保存此类文件的位置的存储选项是 a) 内部存储或 b) 外部存储。我的设备是运行 Marshmallow 的根深蒂固的 Nexus 7,我无法使用任何一个选项。

使用内部存储,我可以编写文件,但是使用 ADB 或 Eclipse DDMS 找不到它。使用外部存储我得到FileNotFoundExceptions 我猜这是由于新的复杂权限,所以Android 将文件保存到外部存储都没有工作。

这可能吗?如果可以,有没有简单的方法可以做到?

0 投票
0 回答
44 浏览

android - android中文件的安全性

我正在开发一个应用程序,我需要在其中下载一些文件并保护它们,以便用户看不到这些文件。现在我正在使用点前缀方法隐藏文件并使用密码保护保存 zip,但是,提取 zip 以使用文件需要很长时间。有没有办法实现将原始文件保存在android内部存储中的安全性

0 投票
1 回答
3772 浏览

android - android从内部存储器中的url存储下载图像,然后在imageview中显示该图像

我想从 url 下载图像并在存储后将其存储到内存中获取存储在内存中的图像并在 imageview 中显示

0 投票
1 回答
46 浏览

android - 在 android 中保存、读取和保护应用程序目录的数据

我正在尝试将文件保存到内部存储器中,并且应该只能由我的应用程序读取。到目前为止,我已经尝试过了。

但此代码段引发 FileNotFound 异常。请同样建议我。提前致谢

0 投票
0 回答
224 浏览

android - 从 Internet 下载文件并将其保存在 Android 内部存储中

如何从服务器下载文件并将其保存在 android 内部存储中?

到目前为止,我一直在使用 DownloadManager 类,但 DownloadManager 只允许文件保存在外部存储中。

还有什么其他方法可以实现?