# Writing permissions at runtime (Android Mode 4.0.1)

**URL:** https://discourse.processing.org/t/writing-permissions-at-runtime-android-mode-4-0-1/549
**Category:** Processing for Android
**Created:** [May 31, 2018, 4:00am UTC](https://discourse.processing.org/t/writing-permissions-at-runtime-android-mode-4-0-1/549 "2018-05-31T04:00:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rorsch](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@rorsch](https://discourse.processing.org/u/rorsch)
#### Post date: [May 31, 2018, 4:00am UTC](https://discourse.processing.org/t/writing-permissions-at-runtime-android-mode-4-0-1/549/1 "2018-05-31T04:00:15Z")

</div>

I’m using the code below to ask for writing permissions on my Processing/Android sketch:

> <https://stackoverflow.com/questions/16360763/permission-denied-when-creating-new-file-on-external-storage/41220767#41220767>

The problem is that `ActivityCompat` is not recognised (nor `import android.support.v4.app.ActivityCompat`).

I found a _support-v4-26.0.0-alpha1-sources.jar_ file in the SDK files downloaded automatically by Processing, but I’m not able to correctly import it to the sketch.

I’m using **Android Mode 4.0.1** , and the **Android SDK Platform 26**.

---

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [May 31, 2018, 8:50am UTC](https://discourse.processing.org/t/writing-permissions-at-runtime-android-mode-4-0-1/549/2 "2018-05-31T08:50:55Z")

</div>

@AugustoEst===

As you can easyly verify looking to the code of the launcher activity (or to the build.gradle), processing extends AppCompatActivity and declares v7 as a dependency: so you have not to try to import it and the problem you get is not this one; it’ s that you are in a (kind-of) Fragment (PFragment, which extends Fragment) and the code you are using is not for a fragment but for an activity…Adapt your code (if you need i can put code for that, though i think i have already done that in the old forum)
