Thank you for the answer. But then there were other problems and I solved them.
1-) It is necessary to add provider_paths.xml, this is in your other examples.
2-) Runtime permission was required to use the FileOutputStream object.
There are a few more things, but I can't write them all.
I solved all the problems works fine.
NOTE: As a result, perhaps it may not be your responsibility to provide this information, but I think it would be more efficient if you put at least one of the current working examples.
Sorry for my bad english (google translate 😊)