- Jun 6, 2020
- 11,559
- 4,422
I'm trying to add FileProvider as described in this post:
After investigating several issues with the current FileProvider code that you can find in the forum, I decided to make some improvements and implement it in a class. Starting from Android 7 (API 24) you cannot directly share file uris with other applications. You need to use FileProvider. The...
To an existing app that I'm trying to bring up to date for newer phones. At a few places in the code, I allow the user to e-mail a file to anyone they wish. And of course if they are SDK 24 or higher, the old way of sharing a file doesn't work.
The phone this is being tested on is Android 8
Current version of b4a is 9.5
The demo, as provided in the post, works on this phone.
I have copied the FileProvider.bas file into my project and added as a module. I added the code into the manifest, added the code to the Starter module, and adjusted my app code based on the btnSendEmail_Click SUB in the sample app. The file being attached is a simple text file.
B4X:
برای دیدن لینک ها باید ثبت نام کنید
After investigating several issues with the current FileProvider code that you can find in the forum, I decided to make some improvements and implement it in a class. Starting from Android 7 (API 24) you cannot directly share file uris with other applications. You need to use FileProvider. The...
برای دیدن تصاویر باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
To an existing app that I'm trying to bring up to date for newer phones. At a few places in the code, I allow the user to e-mail a file to anyone they wish. And of course if they are SDK 24 or higher, the old way of sharing a file doesn't work.
The phone this is being tested on is Android 8
Current version of b4a is 9.5
The demo, as provided in the post, works on this phone.
I have copied the FileProvider.bas file into my project and added as a module. I added the code into the manifest, added the code to the Starter module, and adjusted my app code based on the btnSendEmail_Click SUB in the sample app. The file being attached is a simple text file.
B4X:
کد:
محتوای بلوک کدها در دسترس شما نیست. برای مشاهده بلوک کدها، وارد انجمن شوید یاثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید