Jump to content
grantful

Android 8.0.0 Crashes when useing camara.

Recommended Posts

I been testing my app on newer android phones. 

I have a galaxy s7 android 8.0.0  .

When I try to use the camara the app crashes.

procedure TForm1.Image1Click(Sender: TObject);
var
  Service: IFMXCameraService;
  Params: TParamsPhotoQuery;

begin
       ClearUIInputs;
  if TPlatformServices.Current.SupportsPlatformService(IFMXCameraService,
    Service) then
  begin
    Params.Editable := True;
    Params.NeedSaveToAlbum := False;  // Specifies whether to save a picture to device Photo Library
    Params.RequiredResolution := TSize.Create(320, 320);
    Params.OnDidFinishTaking := DoDidFinish;
    Service.TakePhoto(Image1, Params);
  end
  else
    ShowMessage('This device does not support the camera service');

end;
MobilePermissions1.Dangerous.ReadExternalStorage := True;
  MobilePermissions1.Dangerous.WriteExternalStorage := True;
  MobilePermissions1.Dangerous.CAMERA := True;
  MobilePermissions1.Standard.AccessNetworkState := True;

  MobilePermissions1.Apply;

This works fine on the newer android versions.  Anyone have any thoughts. 

Thanks for any comments and help.

Share this post


Link to post
6 hours ago, grantful said:

When I try to use the camara the app crashes.

Works OK here. Either there's an issue with your device, or you need to provide more information, e.g. 

  • Are there any error messages when it crashes?
  • Where in your code does it crash?
  • Have you used a log viewer to check for error messages and if so, are there any?
  • Is there any other relevant code you've left out in your post?

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×