Opens a file descriptor to access data under a Universal Resource Identifier (URI). This function
accepts content:// and file:// URI schemes. You are responsible for closing the returned file
descriptor.
The file mode can be "r", "w", "rw", "wt", "wa" or "rwt". The exact implementation of these modes differ
depending on the underlying content provider. For example, "w" may or may not truncate.
Returns a file descriptor on success or a negative value on an error. On an error, the Allegro errno is
set.
Note: Remember to add to your manifest file the relevant permissions to your app.
Example:
const char *content_uri = "content://...";
int fd = al_android_open_fd(content_uri, "r");
if (fd >= 0) {
ALLEGRO_FILE *f = al_fopen_fd(fd, "r");
if (f != NULL) {
do_something_with(f);
al_fclose(f);
}
else {
handle_error(al_get_errno());
close(fd);
}
}
else {
handle_error(al_get_errno());
}