问题标签 [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 回答
244 浏览

android - 测试低手机存储的解决方案?

我正在寻找一种解决方案来测试 Android 上其他一些应用程序的低手机存储空间。一种解决方案是创建一个会填满整个内存但似乎不起作用的应用程序。有人可以建议其他解决方案吗?

0 投票
1 回答
196 浏览

android - A folder created by my app is missing on Marshmallow (6.0.1)

In my android-app I have created a folder on the internal storage of my device. When I browse the internal storage I can see the folder and its content. Browsing through device

When I connect the device to my pc and open the internal storage, the folder is missing. All other folders are available, but not the folder I created from my app. Browsing through Windows-Explorer

I tried to turn on "show invisible files" for my windows, but the folder is still missing. Any suggestions?

I tried to use MediaScannerConnection.scanFile from Vijai's answere. After this, i can see the file, but is not displayed as a directorie. Nothing happens with double click on it.

enter image description here

The folder itself is beeing created by my databasemanager. Its an extensionclass of the SQLiteOpenHelper-class.

This was working fine for so long. I was able to see the directory in the past. Since my customer changed his phone to android 6.0.1, the file is no more visible.

0 投票
0 回答
35 浏览

android - ObjectInputStream readObject() 行为不稳定?

我目前正在为我们高中的小组制作一个应用程序。我们决定制作一个个人理财应用程序来组织您的支出。我正在尝试使用内部存储来存储数据。我为此创建了一个InternalStorage类(这是其他人对像我这样的问题的回答,但我忘记了从哪里来的。哎呀。),具有相应writeread方法。但是,在调试时,我发现了一些令人难以置信的行为。

我在所有代码行中都设置了断点,read()从我所见,代码运行ois.readObject(),然后没有运行 e.printStackTrace() 和 Toast,直接跳回到return null.

有人知道发生了什么吗?

编辑:

进行检查转换仍然会发生同样的事情-类是相同的,但是进行转换仍然会使其跳转到上一个,最后一个null

0 投票
0 回答
577 浏览

android - 从 App info 获取我的应用程序使用的内部存储大小

从我的 Android 应用程序中,我试图使用内部存储。换句话说,我需要在应用信息中显示存储值(检查屏幕截图)。我尝试了下面的代码,但我得到的价值低于 appinfo 中显示的存储价值。请帮助我解决我所缺少的。

存储映像

0 投票
1 回答
1204 浏览

android - 如何使用 FileProvider 在内部存储/缓存中创建和显示 PDF?

以下是在外部存储中创建 PDF 的代码。

同样,请使用 Android 的 InBuilt Feature FILEPROVIDER 为内部存储提供解决方案。

上面的代码存储在外部存储中。现在几乎每部手机的内部存储器都有足够的空间,所以不需要外部。在这种情况下,我希望在创建和生成 pdf 后存储和检索 pdf。

请建议更改。

0 投票
1 回答
5176 浏览

android - 如何保存在内部存储中录制的音频

我正在开发的安卓应用程序;它有一个录音选项;我希望它将新的音频录制文件保存在设备的内部存储中,这样用户和其他应用程序都无法访问这些录制的音频文件,除非他们打开我的应用程序。

我的主要斗争是能够将该音频文件保存在内部存储中:我花时间查看了我的 android 编程书籍并在这里阅读了一些问题和答案:如何在内部存储中保存音频文件 androidhttps:// developer.android.com/guide/topics/data/data-storage#filesInternalhttps://www.tutorialspoint.com/android/android_internal_storage.htm但不幸的是我从那里得到的东西根本没有解决我的问题。

我用来记录的代码如下:

不幸的是,我在那里所做的是将我的文件保存在外部存储上,这意味着在录制后,该文件对设备文件资源管理器中的每个人都是可见的,他们甚至可以删除该文件。

所以!拜托,我需要你们的帮助,如果有任何帮助,我将不胜感激。谢谢!

0 投票
1 回答
584 浏览

android - Playing audio files from device internal storage. It keeps throwing IOException on void prepare()

I want to play audio files which are stored on internal storage of my application from a user device: here below are the full code of extracting and showing list of those audio files=

Whenever I click on an item, the toast of player couldn't be prepared to play keeps appearing; I think there is no problem with setDataSource(); so what is wrong with my codes. Is there any error that I am putting that I don't see? Or I am not calling MediaPlayer well?

0 投票
1 回答
41 浏览

android - 我们如何将位图图像存储到移动内存中?

我的bitmap图像在bitmap变量中,其名称是imageFile我们如何进一步命名此bitmap图像并将其存储在我的移动内存中

在这张图片中,一个函数显示接收图像文件并将其转换为bitmap

在此处输入图像描述

0 投票
0 回答
17 浏览

android - 尝试从内部存储中读取文件时,图库会立即打开和关闭

我使用这种方法将图像保存到应用程序内部存储中的我的文件夹中。

在应用程序的另一个选项中,我想在 android 库中打开图像,我尝试使用此代码执行此操作

我的清单上也有这个声明

我的 file_provider_paths 看起来像这样

发生的情况是,当我按下按钮打开图库上的图像时,我会看到该文件类型的应用程序选择器,当我选择图库时,它会立即打开和关闭。

问题1:为什么会这样?

问题 2:如何打开图库以显示内部存储“文件”文件夹中的所有图像?

0 投票
1 回答
169 浏览

android - 访问 Android 应用程序内部存储中的子目录以进行写入

我在我的应用程序的内部存储中创建了一个图像子目录。因此完整的路径是,

/data/data/{app_namespace}/images

现在,我已经成功创建了一个/data/data/{app_namespace}/images/enh.jpeg用于存储图像的 uri。

但是,当我想打开文件进行写入时,我分别在使用的两种方法中遇到了两个问题:

  1. FileOutputStream out = new FileOutputStream( uri_path): ENOENT 没有这样的文件或目录。
  2. FileOutputStream out = context.openFileOutput(uri_path, Context.MODE_PRIVATE): 文件包含路径分隔符。

我想了解如何打开/data/data/{app_namespace}/images/enh.jpeg写作?还有其他我不知道的方法吗?