Closed autinerd closed 3 years ago
It has now following behavior:
.opensudoku
or .sdm
file from File explorer seems to work nowThis is a great PR and I think that we can drop support to versions prior to kikat, but the import seems not work well if you try to open a file directly from web browser. Steps to reproduce:
Can you try to fix this crash?
I have now removed the http intent filters, because for download a extra background task would be needed. So now the browser downloads the file. The file opening in the File Explorer just stooped working again for me, so I added now OpenSudoku in the Share panel, so that you can share the file you want to import and it will be imported.
The file opening is very horrible, you never know if it will work or not.
The problem in File Explorer is caused because it don't send full filename so in some android devices (and versions) works and in others not.
With latest change the import don't work anymore because String action = intent.getAction();
can be null
:hankey:
With latest change the import don't work anymore because
String action = intent.getAction();
can benull
Is fixed :)
Worked perfectly on my Pixel 5/Android 11. Thanks!
Fixes #103 partly.
Because Android 11 changes a lot in terms of accessing files in external storage, there have to be some changes in handling import and export.
Export: Uses the Android system file picker to let to user select a path and writes the data into that file. Import: Uses the Android system file picker to let the user select a file to import. Because the file name is not reliable, decides the format based on the first 512 bytes of the file content.
One downside is that the minimum Android version will be KitKat.