On Wed, Aug 1, 2012 at 9:09 AM, AnDev Quer <[email protected]> wrote: > My question is, is there a way to somehow allow the user to download the app > and maybe we could programmatically disable the function that needs the > camera? > > We're using the basic camera permission in our Android manifest: > android.permission.CAMERA. And we're running Android 2.2 (we won't be able > to upgrade this any time soon).
Step #1: Add <uses-feature android:name="android.hardware.camera" android:required="false" /> to your manifest. Step #2: In your code, iterate over the available cameras (via getNumberOfCameras() and getCameraInfo()) and see if any are rear-facing. If the answer is "no", disable whatever features of yours depend upon such a camera. However, in theory, <uses-feature android:name="android.hardware.camera" android:required="true" /> will give you a rear-facing camera, though, at least according to this blog post: http://android-developers.blogspot.com/2012/07/getting-your-app-ready-for-jelly-bean.html IOW, in theory, your current app should be just fine and will not be installed on devices with only a front-facing camera (e.g., Nexus 7). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in DC: http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

