I’m writing an application where I’d like to offer the user the option to remap the hardware camera button to do some other function. However if the device does not have a hardware camera button I’d like to hide this option.
Is there any way to detect the presence of the camera button on a device?
Unfortunately I don’t think it’s possible. The PackageManager class can you give you information about different things, but whether there’s a hard camera button is not one of them. You can do things like:
But unfortunately, there’s nothing like PackageManager.FEATURE_CAMERA_BUTTON
What you could do however is hard code in a bunch of checks for specific devices that you know to have hardware camera buttons, eg.
where droid1 should be the actual id.. i dunno what it is