2

I am developing an application for a Wear OS system that creates a txt file and saves it in a certain folder.

My problem is that I have changed my watch and now the one I'm using has Android 13 API 33 and the permissions I had to save and edit the generated files are not working.

I have found this on internet "Based on the Android documentation READ_EXTERNAL_STORAGE permission has no effect starting from API level 33. For API level 33 and above you can use READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO permissions depending on your use case"

None of them are something like READ_MEDIA_FILES o similar

Until now, i used

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

I have this error

`Process: com.XXXX, PID: 27273     java.lang.RuntimeException: Unable to start service com.XXXX.controller.SensorsService@eabe365 with Intent { cmp=com.XXXX/.controller.SensorsService (has extras) }: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/20f91a8a85b2cd47_28-09-23_14-34-09.txt: open failed: EPERM (Operation not permitted)`

do you know what the new permissions are or what I have to do for it?

4
  • The use of MANAGE_EXTERNAL_STORAGE has not changed so what is it you are asking? Commented Sep 28, 2023 at 11:44
  • 1
    On the watch (wear os 4) manage_external_storage isn't working anymore... I have, pretty mutch, the same problem Commented Sep 28, 2023 at 15:46
  • so what have you donte? @DouglasSilva Commented Sep 29, 2023 at 6:40
  • I'm still searching for a solution... Commented Sep 29, 2023 at 12:58

2 Answers 2

3

Storage permissions are broken in Wears OS 4. There is an official bug logged about this. https://issuetracker.google.com/issues/299174252

Sign up to request clarification or add additional context in comments.

Comments

-1

You do not need any permission on an Android 13 device to create files in all public directories on external storage.

And certainly also you do not need any READ permission to WRITE a file.

Once you created your file -without needing any permission- you are automatically allowed to read your file.

6 Comments

so, why i have this error? Process: com.XXXX, PID: 27273 java.lang.RuntimeException: Unable to start service com.XXXX.controller.SensorsService@eabe365 with Intent { cmp=com.XXXX/.controller.SensorsService (has extras) }: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/20f91a8a85b2cd47_28-09-23_14-34-09.txt: open failed: EPERM (Operation not permitted)
Well read my answer again. You are not using a public directory.(One that is already there like Documents, DCIM, Pictures, ...).
In the smartwatch in which the app run without problems, i had this permissions drwxrwx--x, but in the new one, in which the app don´t run, i had this drwxrws--- (drwxrws---" completely denies access to other users). the app I have developed creates a TXT file and continuously writes the accelerometer data, until it finishes and creates a ZIP from the TXT.
????? Why are you teling this,? Looks irrelevant to me. Better use a public directory. Now did you try already?
Do you say to save the file in /storage/emulated/0/Directory? Maybe I am too young developing apps, sorry
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.