1

Based on google docs beginning with Android 4.4 (API level 19) Android apps doesn't need WRITE_EXTERNAL_STORAGE Permission to write to its own application-specific directories. uses-permission

So I removed this permission for API 19:

<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="18" />

But after publishing app, we find out some android devices(not all of them) with API > 18 have problem and app can't write to it's own application-specific directories. I remove android:maxSdkVersion and published app again and problem solved.

How is that possible? And what I should do to remove this permission and my app work in all devices?

Hojjat
  • 815
  • 1
  • 10
  • 25
  • 3
    it's no longer necessary for your app to request the WRITE_EXTERNAL_STORAGE permission when your app wants to write to its own application-specific directories on external storage (the directories provided by getExternalFilesDir()). refer http://stackoverflow.com/questions/23073416/why-my-map-app-crashes-if-i-set-maxsdkversion-in-the-write-external-storage-perm – sasikumar Feb 01 '16 at 11:25
  • check following link http://stackoverflow.com/questions/20328082/require-permission-only-for-older-android-versions-maxsdkversion-does-not-work – krishna Feb 01 '16 at 11:32
  • Thanks for reply. As I mentioned not all devices have problem and I'm sure that I never accessed other directory that requires permission; just my application-specific directory – Hojjat Feb 01 '16 at 11:37
  • Please provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) demonstrating your problem. In this case, it would include the Java stack trace, your code that is triggering that stack trace, and the specifics of the device models that are crashing. – CommonsWare Feb 01 '16 at 12:43

1 Answers1

-1

check following link hope you will find your ans

Require permission only for older android versions: maxSdkVersion does not work?

Community
  • 1
  • 1
krishna
  • 301
  • 1
  • 8
  • Thanks for reply. As I mentioned not all devices have problem and I'm sure that I never accessed other directory that requires permission; just my application-specific directory – Hojjat Feb 01 '16 at 11:38