0

I'm developing an App that is distributed by manual install on industrial Android devices with a barcode reader, Zebra TC21 and TC52. Devices are Android 10 and 11, app targets Android 10, with requestLegacyExternalStorage=true.

It has in the files folder of the private external storage some log files, and its SQLite db. The App works on all the devices, and in almost all of them I can connect the devices via USB and access the folder:

enter image description here

Here's when I open the data folder:

enter image description here

My problem is that on some devices, same brand and OS version, brand new taken out of the box and app installed, when I open the data folder, the list is much shorter, and my app is not listed. But the app is installed and works, the DB is there and probably the log files. But I'm unable to access them via USB from Windows.

I've temporarily modified my App to save DB and logs in a public folder, and I can see it in all the devices. But still wondering why on some I can't access my app in the private folders.

Another question related to storage: soon all the devices I work with will have Android 11, if I target it, I understood I won't be able anymore to save data in the external storage. If I still want to give the possibility to easily access to log files via USB, where should I store them? This is not a PlayStore distributed app, is for clients that install it manually.

UPDATE

From the comments I understands there's a misunderstanding: the App itself works and has no problems writing to the private external storage, with both Android 10 and 11. My problem is that on some devices, when I connect from Windows 10 via USB and browse the sdcard/Android/Data folder, I can actually access my App folder and view my logs. On some other devices, I can't find my app folder in the sdcard/Android/Data folder. I'm trying to understand why is that.

Thanks

Mattia Durli
  • 757
  • 7
  • 19
  • On Android 11+ devices your app can still write files to all public directories on external storage. – blackapps Mar 06 '23 at 17:13
  • Does this answer your question? [requestLegacyExternalStorage is not working in Android 11 - API 30](https://stackoverflow.com/questions/63364476/requestlegacyexternalstorage-is-not-working-in-android-11-api-30). Details: Are you also requesting `preserveLegacyExternalStorage=true`? If so, then those devices apparently don't have a compliant implementation of that for Android 11. In that case, might have to use an external `public` folder instead. If you do not have that attribute, then add it. Hmm not sure you can add, since you target Android 10. – ToolmakerSteve Mar 06 '23 at 19:10
  • Can you find the file with android system file manager in the device which can't see the file in the windows? – Liyun Zhang - MSFT Mar 07 '23 at 09:45

0 Answers0