Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16981] Android: Recent change to take picture only on valid focus is causing usability issues

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-06-28T02:19:58.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.3.0, Release 3.4.0
ComponentsAndroid
Labelsn/a
ReporterDan Peleg
AssigneePing Wang
Created2014-05-02T17:16:57.000+0000
Updated2014-07-01T17:06:40.000+0000

Description

Since [Workaround for issue # 61394](https://github.com/appcelerator/titanium_mobile/commit/0fd8a0e78bd0aac8f1fcb78a9d1a7e08622fb977#commitcomment-6195276) _(I couldn't find issue 61394)_ Picture looks 100% focused and my call to Ti.Media.takePicture(); failed silently. Took me more than 30 minutes to understand the some how I received the "Unable to focus" message. I think there are 2 options of solving this. 1. Always take picture even if focus didn't succeed and just log on focus failure 2. Add a property that sais "Throw on focus failure" so it will throw an error that we can catch on the JavaScript and show the user.

Comments

  1. Ritu Agrawal 2014-05-19

    There was a recent change in Titanium SDK 3.3.0 to work around Google bug 61394 (http://code.google.com/p/android/issues/detail?id=61394). It changes the current SDK behavior as a picture is only taken when auto focus is successful. No picture is taken when auto focus is not successful but there is no notification to the user. We need a better way to communicate this behavior to developers so that they can update their applications accordingly. https://github.com/appcelerator/titanium_mobile/commit/0fd8a0e78bd0aac8f1fcb78a9d1a7e08622fb977#commitcomment-6195276
  2. Hieu Pham 2014-06-20

    I can't reproduce this on Nexus 5 (4.4) using the test case in TIMOB-1510. I'm able to take pictures without any problems.
  3. Dan Peleg 2014-06-21

    Hey Hieu, That only happens when auto focus fails. Try different lighting conditions or distance. Let me know if you are able to reproduce. Dan
  4. Lokesh Choudhary 2014-06-23

    The issue is reproducible. If the camera does not focus & we take a picture then we get the following logs in the studio console
    [DEBUG] :  TiCameraActivity: (main) [4560,19923] Unable to focus. Ignoring call to take picture.
    . with no visual indication/error of the problem. There is no way to find out without looking at the debug logs why the picture was not taken. Environment: Appc Studio : 3.3.0.201406171619 Ti SDK : 3.3.0.v20140620194913 Mac OSX : 10.8.5 Alloy : 1.4.0-rc2 CLI - 3.3.0-rc2 Code Processor: 1.1.1 Nexus 5 - android 4.4.4
  5. Vishal Duggal 2014-06-27

    Probably be useful to add a simple toast message.
  6. Hieu Pham 2014-06-27

    Toast added: https://github.com/appcelerator/titanium_mobile/pull/5865
  7. Ping Wang 2014-06-27

  8. Ping Wang 2014-06-27

    3_3_X PR: https://github.com/appcelerator/titanium_mobile/pull/5871
  9. Lokesh Choudhary 2014-07-01

    Verified the fix. The pic is taken even if the camera is unable to focus successfully & we get in the logs "Unable to focus". Closing. Environment: Appc Studio : 3.3.0.201406271159 Ti SDK : 3.3.0.v20140627202512 Mac OSX : 10.8.5 Alloy : 1.4.0-rc2 CLI - 3.3.0-rc4 Code Processor: 1.1.1 Nexus 5 - android 4.4.4

JSON Source