I am developing an application for a Wear OS system that creates a TXT file and continuously writes the accelerometer data, until it finishes and creates a ZIP from the TXT.
My problem is that I have changed my watch and now the one I’m using, Samsung Watch 5, 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 have been using this:
<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.myapp, PID: 27273
java.lang.RuntimeException: Unable to start service com.myapp.controller.SensorsService@eabe365 with Intent { cmp=com.myapp/.controller.SensorsService (has extras) }: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/myfolder/file.txt: open failed: EPERM (Operation not permitted)`