Camera won’t focus / stay focused in Appcelerator app
Asked Answered
O

1

9

After using the app for a while and taking dozens and dozens of photos successfully, users report the Camera will not autofocus and the photos are blurry using our Appcelerator app.

What is causing the camera app not to auto-focus?

This has been reported by a number of users on different model (iPad) devices.

We are taking a lot of photo's and it is difficult to determine why/what makes the camera auto-focus stop working. The code to capture the photo/image is very basic and shown below:

            Ti.Media.showCamera(
                {   showControls:true,
                      mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO],
                         success:function(e){
                                     try{
                                            imgPhoto.image = e.media;                                              
                                     }
                                     catch(e){                                                          
                                        require('lib/Error').Capture(e);                                        
                                     }      
                                },
                       error:function(e){
                                require('lib/Error').Capture(e);
                             }
             }); 

Obviously we tried resetting the device, killing the app, etc. and these solutions fix the problem temporarily. Any solid advice is appreciated.

Ockham answered 11/9, 2017 at 18:44 Comment(0)
F
1

Have you tried the below in tiapp.xml

<key>UIRequiredDeviceCapabilities</key>

<array>
  <string>auto-focus-camera</string>

Let me know if this helps you.

Farrica answered 15/9, 2017 at 9:3 Comment(2)
What is the SDK that you are using.Farrica
all current 5.x,6.xOckham

© 2022 - 2024 — McMap. All rights reserved.