EJNIException Message

Can anyone tell me what
Exception class EJNIException message
java.land Illegal Argument Exception. Couldn’t find meta-data for provider with authority
com.embarcadero.CameraTest.fileprovider
means?

CameraTest is the name of the programme. Permissions have been gained happily.
This crash comes on the TakePhotoFromCameraAction1.Execute line.
I have gone through the sample programmes and pinched their ideas, looked for other things hidden in the depths of the object inspector, and put in what I have found.

The files may be found on http://c443799.r99.cf2.rackcdn.com/Test.zip

The project needs to have the Secure File Sharing checkbox checked in the Entitlements List section of the Project Options

Many thanks - worked fine, and I have included an obvious comment in the source file so I can find it when I need it next!
The pictures produced are 30 - 80kb jpegs (even with the highest setting). What I want is decent resolution, with files of a couple of megabytes in size. How can I get these please?

When you say “highest setting”, do you mean you’re setting the RequiredResolution property?

The “Highest Setting” is on running the camera, and selecting the highest setting there, not in the programme.

The bit of the programme I have been playing with is

ImageLoc := Image;

TakePhotoFromCameraAction1.OnDidFinishTaking := FinishTaking;
TakePhotoFromCameraAction1.OnDidCancelTaking := CancelTaking;

TakePhotoFromCameraAction1.NeedSaveToAlbum := false;
TakePhotoFromCameraAction1.MaxHeight := 3000;
TakePhotoFromCameraAction1.MaxWidth := 3000;

TakePhotoFromCameraAction1.Execute;

If I do not set the MaxHeight and MaxWidth, I get about a 60kb file of screen resolution.
If I set them to 3000, I get a 600kb file with improved resolution.
If I set them to 5000 or 6000, saving to a .jpg file produces an unuseable file of zero bites in length, and if I set it to produce a .bmp file it produces an error on saving. When I try to put breakpoints in and follow where the error occurs, it looks like one of those funny errors where something has scribbled over memory where it shouldn’t have, causing an error in the routine to extract the extension from a filename!

(The latest version, with the ability to change the extension and the MaxHeight/MaxWidth programmatically, has been put up on
http://c443799.r99.cf2.rackcdn.com/Test.zip
)

Getting there at last!
(1) Android Bitmap.SaveToFile does not support .bmp format
(2) Despite the documentation, Android Bitmap.SaveToFile does not support .gif format either.
(3) However, the .png format is supported, and produces high-resolution files.
(4) The comments about the .jpg option producing zero-length files still stands. I think this is a bug not a feature.
Finally, after fourteen months of swearing, trial and many errors, I can take a picture on an android phone!
I hope the code may be some use to others with the same problem.

1 Like