简体   繁体   English

在Android上写入内部SD卡

[英]Writing to internal SD card on Android

有没有办法在具有内置闪存,内置SD和外置SD卡的Android设备上访问内部SD卡?

In Android 2.2 and previous, there is only one "external storage" ( Environment.getExternalStorageDirectory() ). 在Android 2.2和之前的版本中,只有一个“外部存储”( Environment.getExternalStorageDirectory() )。 The definition of where this points is up to the device manufacturer. 此点的定义取决于设备制造商。 The Compatibility Definition Document (CDD) merely mandates that it be at least 2GB, IIRC. 兼容性定义文档(CDD)仅要求它至少为2GB,IIRC。 It is not even required for "external storage" to be removable. “外部存储”甚至不需要可拆卸。

At this time, there are no standard APIs to get to other partitions or cards. 目前,没有标准API可以访问其他分区或卡。 A device manufacturer might document how to access these -- you would have to see if they have anything on their respective developer sites. 设备制造商可能会记录如何访问这些 - 您必须查看他们各自的开发人员网站上是否有任何内容。

Bear in mind that on some of these devices, other partitions or cards may not be readable or writable from regular SDK applications. 请记住,在某些设备上,其他分区或卡可能无法从常规SDK应用程序读取或写入。

Problem is not there in your memory card/sd card. 您的存储卡/ SD卡中没有问题。 There is non-writing setting enable in default mobile setting. 默认移动设置中启用非写入设置。

  • First, navigate to /system/etc/permissions/platform.xml 首先,导航到/system/etc/permissions/platform.xml
  • After the location been located, make the coding as: 找到位置后,将编码设为:

     <permission name="android.permission.WRITE_EXTERNAL_STORAGE"> <group gid="sdcard_r"/> <group gid="sdcard_rw"/> <group gid="media_rw"/> </permission> 

    and on the other part of the coding make changes as: 并在编码的另一部分进行更改:

     <permission name="android.permission.WRITE_MEDIA_STORAGE"> <group gid="sdcard_rw"/> <group gid="media_rw"/> </permission> 

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM