Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Why does my Android app need autofocus?

The Android app needs the following permissions:

Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
    android.hardware.camera
    android.hardware.location.network
    android.hardware.wifi
    android.hardware.location
    android.hardware.location.gps
    android.hardware.camera.autofocus
    android.hardware.touchscreen

I am using the camera, but why does it need autofocus too? How can I disable it? The Android SDK doucmentation says that

<uses-feature android:name="android.hardware.camera.autofocus" />

lines are in the AndroidManifest.xml which declare this requried features, but there is nothing like this in mine.

— asked September 9th 2011 by Kristof Gruber
  • android
  • autofocus
  • camera
  • feature
  • permission
2 Comments
  • If the camera didn't autofocus, how could it produce a focused image?

    — commented September 9th 2011 by Shawn Lipscomb
  • There are fix foucus cameras :) Samsung Galaxy Mini has no auto focus for example.

    — commented September 9th 2011 by Kristof Gruber

1 Answer

  • Accepted Answer

    The android.permission.CAMERA implies android.hardware.camera and android.hardware.camera.autofocus. See Android docs

    Try adding

    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
    

    to your tiapp.xml or custom AndroidManifest.xml. Adding this may also require you to use SDK tooling higher than API 7.

    — answered September 9th 2011 by Don Thorp
    permalink
    4 Comments
    • Thanks!

      — commented September 10th 2011 by Kristof Gruber
    • How should I do adding this line to tiapp.xml?

      — commented September 13th 2011 by Kristof Gruber
    • It doesn't work to me :(

      — commented August 7th 2012 by Miguel Ángel Castaño Fajardo
    • You can put the uses-feature statements in TiApp.xml under the Android | Manifest section:

          <android xmlns:android="http://schemas.android.com/apk/res/android">
              <manifest android:versionCode="14" android:versionName="2.03">
                  <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
              </manifest>
          </android>
      

      I had the same problem as the OP, and this solved it.

      — commented August 30th 2012 by Shawn Lipscomb
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.