问题标签 [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.
android - 测试低手机存储的解决方案?
我正在寻找一种解决方案来测试 Android 上其他一些应用程序的低手机存储空间。一种解决方案是创建一个会填满整个内存但似乎不起作用的应用程序。有人可以建议其他解决方案吗?
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.
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.
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.
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.
android - ObjectInputStream readObject() 行为不稳定?
我目前正在为我们高中的小组制作一个应用程序。我们决定制作一个个人理财应用程序来组织您的支出。我正在尝试使用内部存储来存储数据。我为此创建了一个InternalStorage
类(这是其他人对像我这样的问题的回答,但我忘记了从哪里来的。哎呀。),具有相应write
的read
方法。但是,在调试时,我发现了一些令人难以置信的行为。
我在所有代码行中都设置了断点,read()
从我所见,代码运行ois.readObject()
,然后没有运行 e.printStackTrace() 和 Toast,直接跳回到return null
.
有人知道发生了什么吗?
编辑:
进行检查转换仍然会发生同样的事情-类是相同的,但是进行转换仍然会使其跳转到上一个,最后一个null
。
android - 如何使用 FileProvider 在内部存储/缓存中创建和显示 PDF?
以下是在外部存储中创建 PDF 的代码。
同样,请使用 Android 的 InBuilt Feature FILEPROVIDER 为内部存储提供解决方案。
上面的代码存储在外部存储中。现在几乎每部手机的内部存储器都有足够的空间,所以不需要外部。在这种情况下,我希望在创建和生成 pdf 后存储和检索 pdf。
请建议更改。
android - 如何保存在内部存储中录制的音频
我正在开发的安卓应用程序;它有一个录音选项;我希望它将新的音频录制文件保存在设备的内部存储中,这样用户和其他应用程序都无法访问这些录制的音频文件,除非他们打开我的应用程序。
我的主要斗争是能够将该音频文件保存在内部存储中:我花时间查看了我的 android 编程书籍并在这里阅读了一些问题和答案:如何在内部存储中保存音频文件 android和https:// developer.android.com/guide/topics/data/data-storage#filesInternal和https://www.tutorialspoint.com/android/android_internal_storage.htm但不幸的是我从那里得到的东西根本没有解决我的问题。
我用来记录的代码如下:
不幸的是,我在那里所做的是将我的文件保存在外部存储上,这意味着在录制后,该文件对设备文件资源管理器中的每个人都是可见的,他们甚至可以删除该文件。
所以!拜托,我需要你们的帮助,如果有任何帮助,我将不胜感激。谢谢!
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?
android - 尝试从内部存储中读取文件时,图库会立即打开和关闭
我使用这种方法将图像保存到应用程序内部存储中的我的文件夹中。
在应用程序的另一个选项中,我想在 android 库中打开图像,我尝试使用此代码执行此操作
我的清单上也有这个声明
我的 file_provider_paths 看起来像这样
发生的情况是,当我按下按钮打开图库上的图像时,我会看到该文件类型的应用程序选择器,当我选择图库时,它会立即打开和关闭。
问题1:为什么会这样?
问题 2:如何打开图库以显示内部存储“文件”文件夹中的所有图像?
android - 访问 Android 应用程序内部存储中的子目录以进行写入
我在我的应用程序的内部存储中创建了一个图像子目录。因此完整的路径是,
/data/data/{app_namespace}/images
现在,我已经成功创建了一个/data/data/{app_namespace}/images/enh.jpeg
用于存储图像的 uri。
但是,当我想打开文件进行写入时,我分别在使用的两种方法中遇到了两个问题:
FileOutputStream out = new FileOutputStream( uri_path)
: ENOENT 没有这样的文件或目录。FileOutputStream out = context.openFileOutput(uri_path, Context.MODE_PRIVATE)
: 文件包含路径分隔符。
我想了解如何打开/data/data/{app_namespace}/images/enh.jpeg
写作?还有其他我不知道的方法吗?