tags:

views:

76

answers:

2

How can I detect programmatically if a phone has a camera ?

+6  A: 

PackageManager#hasSystemFeature(String) - pass PackageManager.FEATURE_CAMERA as the argument.

adamp
I have to use the 1.5 SDK, this method is not available...
Arutha
A: 

All Android compliant phones have to have a camera installed if they claim to run Android version 1.6 or higher. See http://static.googleusercontent.com/external_content/untrusted_dlcp/source.android.com/de//compatibility/android-1.6-cdd.pdf for the device compatiblity program.

Sadly there's no 1.5 ccd to be found anywhere. I'm however pretty sure that all currently available 1.5 devices do indeed have a camera. For tablets running 1.5 i'd not be that sure.

badlogic