ykasidit / bluetooth_gnss

Bluetooth GNSS app on Google Play Store
https://play.google.com/store/apps/details?id=com.clearevo.bluetooth_gnss&hl=en&gl=US
GNU General Public License v2.0
63 stars 19 forks source link

Log directory is not created on Android 11 #13

Closed gmatefi2 closed 2 years ago

gmatefi2 commented 2 years ago

When running Bluetooth GNSS on Android 11, the "bluetooth_gnss_logs' directory is not created and log files are not accessible. It is ok on Android 9.

I suspect that the problem is related to "scoped storage" restrictions in Android 11. As in the Android SDK doc, from Android 11, apps are no longer permitted to create their own app-specific directories in the external storage but the system provides app-specific directories which are accessible with the getExternalFilesDirs() calls.

ykasidit commented 2 years ago

Thanks! will try to look into it.

On Fri, Sep 3, 2021, 03:42 gmatefi2 @.***> wrote:

When running Bluetooth GNSS on Android 11, the "bluetooth_gnss_logs' directory is not created and log files are not accessible. It is ok on Android 9.

I suspect that the problem is related to "scoped storage" restrictions in Android 11. As in the Android SDK doc, from Android 11, apps are no longer permitted to create their own app-specific directories in the external storage but the system provides app-specific directories which are accessible with the getExternalFilesDirs() calls.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ykasidit/bluetooth_gnss/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2P3QTESXC6OW7IDBZ5CTT77OS5ANCNFSM5DJ5MX2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ykasidit commented 2 years ago

Just coded this android 11 support - it should pop-up to ask you the target folder now on connection (android documentfile handling) - please help test and see if it works on your side: https://github.com/ykasidit/bluetooth_gnss/releases/tag/1.0.25

gmatefi2 commented 2 years ago

Tested on an Android 11 device (Samsung A52). Upon selection of the target folder, a system window is popped up which asks for access permissions to that folder. When it is confirmed, the logs are written normally. Thanks for the quick fix!

ykasidit commented 2 years ago

Great! Thanks for the testing!