1

How to write memory-card data in Lollipop? I want copy image from memory-card but there is an issue about permissions, so help me how I can write memory-card data in Lollipop version?

fasteque
  • 4,309
  • 8
  • 38
  • 50
ashish mulani
  • 197
  • 1
  • 14

1 Answers1

1

you need to add these permission to your manifest:

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

Attention:

From Android 6 you need to get runtime permission.Android defines some permissions as “dangerous”(like read and write to memory) and some permissions as “normal.” Both are required in your application’s manifest but only dangerous permissions require a runtime request.

Read more about it here!

Some trick: maybe if you change your targetSdkVersion in the gradle to 22, the problem will be solved.

Community
  • 1
  • 1
Hamed Ghadirian
  • 6,159
  • 7
  • 48
  • 67
  • yes i tried that but still i cant write sd-card data in only android 5.0 and higher version and in other version its works fine – ashish mulani Dec 10 '15 at 06:28