Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FileDescriptor from MediaStore for random file access #130

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

ShortDevelopment
Copy link
Member

Issue

As file-transfer packages might be received out of order, a seekable stream (random file access) is needed.
But: Android APIs don't provide random file access with MediaStore.
Manually creating a file in the downloads folder might result in an UnauthorizedAccessException.

Solution

Insert entry intro MediaStore (visible in files app) and use the FileDescriptor from OpenFileDescriptor to create a seekabe FileStream (dotnet).


Fixes #125
Fixes #124

@ShortDevelopment ShortDevelopment added type::feature-request New feature or request area::Receive Receive labels Feb 2, 2024
@ShortDevelopment ShortDevelopment self-assigned this Feb 2, 2024
@ShortDevelopment ShortDevelopment linked an issue Feb 2, 2024 that may be closed by this pull request
@ShortDevelopment ShortDevelopment marked this pull request as ready for review February 8, 2024 14:29
@ShortDevelopment ShortDevelopment merged commit 887382e into master Feb 9, 2024
4 checks passed
@ShortDevelopment ShortDevelopment deleted the feature/receive/media-store branch February 9, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::Receive Receive type::feature-request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refresh mediastore after receiving the file Unauthorized Access Exception
1 participant