3

I'm working on an Android application in Delphi 10.1 Berlin Update 2, which uses the standard TTakePhotoFromCameraAction. If I set the Target SDK to 24 or higher, this action stops working and shows an error message:

android.os.FileUriExposedException: file.jpg exposed beyond app through ClipData.Item.getUri()

I searched through the Internet and found some info on this:

Delphi Android file open failure with API 26

android.os.FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()

What is android.os.FileUriExposedException and what you can do about it

But none of them were about the Camera action, and not directly about Delphi.

I am still new to Delphi, I found a FileProvider API library on GitHub, but to be honest, I don't know how to use it.

So my question is, how can I make TTakePhotoFromCameraAction work correctly with a higher SDK?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Drius
  • 27
  • 4
  • [File a bug report](http://quality.embarcadero.com) with Embarcadero, as they would need to re-write `TTakeFromCameraAction` to support API 24+ properly. – Remy Lebeau Jun 26 '18 at 19:39
  • I'm working on a solution for this. Hopefully in the next day or so. – Dave Nottage Jun 26 '18 at 20:33
  • 1
    Just FYI, the issue/requirement is [described by Google here](https://developer.android.com/about/versions/nougat/android-7.0-changes#sharing-files). EMBT are aware of this issue. It's part of the API support update plan, so far as I know. – blong Jun 26 '18 at 21:46
  • I've detailed a workaround that is included in this article: http://delphiworlds.com/2018/06/targeting-android-8-and-higher-continued/ – Dave Nottage Jun 30 '18 at 10:02

0 Answers0