简体   繁体   English

外部存储未指向大型内部SD卡

[英]External storage doesn't point to large internal SD card

I check whether external storage is mounted and available for read/write, and then I read from it. 我检查外部存储器是否已安装并且可以读取/写入,然后从中读取。 I'm using the exact official Android sample code ( from here ). 我使用的是确切的官方Android示例代码( 从此处开始 )。

It says external storage is not mounted. 它表示未安装外部存储器。 getExternalFilesDir(null) returns null . getExternalFilesDir(null)返回null

First, I experienced it with a HTC One V that had no external SD card inserted (but has a large storage internally). 首先,我体验了没有插入外部SD卡(但内部具有大容量存储)的HTC OneV。

Now, I'm experiencing the same on a WayteQ xTAB-70dci tablet, which has a huge "internal SD card" (this is how the tablet calls it), but no external SD card inserted. 现在,我在WayteQ xTAB-70dci平板电脑上遇到了同样的情况,该平板电脑具有巨大的“内部SD卡”(这是平板电脑称呼它的方式),但是没有插入外部SD卡。

In both cases, the standard Android APIs ( getExternalStorageState() , getExternalFilesDir() etc.) return false. 在这两种情况下,标准的Android API( getExternalStorageState()getExternalFilesDir()等)均返回false。

I'm absolutely fed up. 我绝对受够了。 Obviously, users who pay for my app (game with much graphics) will expect it to be installed properly on their phone/tablet having a huge internal SD card (like the WayteQ). 显然,为我的应用(具有很多图形的游戏)付费的用户会希望它可以正确地安装在具有巨大内部SD卡(例如WayteQ)的手机/平板电脑上。

What is wrong here? 怎么了 Why do these devices (HTC, WayteQ, come on!) point to ext SD card (which is usually missing by default from the product) instead of their huge internal SD storage? 为什么这些设备(HTC,WayteQ,加油!)指向外部SD卡(产品默认情况下通常不提供)而不是巨大的内部SD存储设备? Absolutely illogical and even harmful. 绝对不合逻辑甚至有害。 What can I do, is there a standard workaround to this? 我该怎么办,对此有标准的解决方法吗?

As said it's up to the device manufacturer. 如前所述,这取决于设备制造商。 I do believe the trickery with internal/external storage points does Samsung on their phones. 我确实相信内部/外部存储点的骗术会在手机上使用三星。

In addition to checking if external is available you'd have to check /data directory size to see if you can cache your app on the internal part. 除了检查外部是否可用之外,还必须检查/data目录大小,以查看是否可以在内部缓存应用程序。 See here . 这里 I assuming you are downloading rest of the app on request anyway due to filesize limits, right? 我假设由于文件大小限制,您仍然应要求下载应用程序的其余部分,对吗?

Bonus info: This shouldn't really bother you much, but as a good developer you may take this into account too. 奖励信息:这实际上并不会打扰您,但是作为一个好的开发人员,您也可以考虑到这一点。 Some people use CronMod scripts that will mount different folders under external storage. 某些人使用CronMod脚本,这些脚本将在外部存储下挂载不同的文件夹。 So they have more space. 因此,它们有更多空间。 Great, right? 太好了吧? Problem arises when you use different version and /data/data is on the SD (which on the phone appears as a larger internal memory) but /data/cache is still on the internal for speed. 当您使用不同的版本,并且/data/data位于SD上(在电话上显示为更大的内部存储器),但/data/cache仍位于内部以提高速度时,就会出现问题。 Suddenly you may have no real, hard data about internal size of cache available to you. 突然之间,您可能没有可用的关于缓存内部大小的真实的硬数据。 But then again, this is done by the power users mostly, which ought to have an inkling about what is up. 但是话又说回来,这主要是由电力用户完成的,他们应该对最新情况有所了解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在android中找到内部(默认手机存储)和外部存储(可移动SD卡)? - How to find Internal(Default Phone Storage ) and External Storage(Removable sd card) in android? 文件保存到内部存储器,而不是SD卡 - Files save to the internal storage, not to the SD card 将文件从 SD 卡移动到应用程序内部数据(存储) - Move file from SD card to app internal data (Storage) 如何在Android中获取内部存储而不是SD卡? - How can i get internal storage and not sd card in android? 我的android应用程序是否安装在SD卡或内部电话存储中 - Is my android application installed on the SD-Card or Internal Phone storage Android获取OTG USB /外部SD卡存储设备及其路径 - Android Get OTG USB/External SD CARD Storage devices and their paths 应用无法访问外部SD卡(只读) - App can't access external SD card (read-only) Android 保存到外部 SD 卡? - Android saving to external SD card? 为什么返回空数据是将其保存还是不保存在内部存储中,因为没有SD卡电话就无法工作 - Why null data is returned is it saving or not in internal storage because not working in without sd card phone 我的代码只从内部存储中获取 mp3 文件,而不是从 SD 卡中获取 - My code only fetches mp3 files from internal storage and not from SD card
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM