tags:

views:

347

answers:

2

Hi,

I wrote an Android application. These are the permissions I requested:

  • INTERNET
  • ACCESS-COARSE-LOCATION
  • ACCESS-FINE-LOCATION
  • ACCESS-NETWORK-STATE
  • CHANGE-NETWORK-STATE

On 1.5 devices, it looks fine. I tried on a 2.0 device, and it also shows an additional permission when installing the app:

  • SD CARD READ / WRITE

is that just coming up by default now on any 2.0 device we install on? I do use Context.openFileOutput() to write a file to disk, but only to the app sandbox location, never to SD card.

Thanks

A: 

I think reading from the SDcard is always allowed, but for writing you need WRITE_EXTERNAL_STORAGE permission, maybe "SD CARD READ / WRITE" is just another translation for that on the device, since it more human readable.

PHP_Jedi
+3  A: 

From the API docs, applications targeting DONUT or higher:

...must explicitly request the WRITE_EXTERNAL_STORAGE permission to be able to modify the contents of the SD card. (Apps targeting earlier versions will always request the permission.)

Hence, if you are building a 1.5 app, you automatically get WRITE_EXTERNAL_STORAGE.

CommonsWare
Ok, so I do need to write to disk, but only a very small file, and for that I only write to the app's sandbox (not SD card). It is a 1.5 app. So if I want to get rid of that permission request coming up, I should create another build specifically for 2.0? Then it should not appear anymore, right?Thanks
Mark
As far as I understand, yes.
CommonsWare