When my app runs on a Google Nexus 7 tablet, it returns false for this standard Android test to see if the device is equipped with a camera.
PackageManager pm = this.getPackageManager(); if(!pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
Now I understand that Nexus 7 does not come with a built-in camera application, but when I try to start working with the camera, I use the following (to give the user the opportunity to choose alternative applications).
File fTempCameraFullDirPath = new File(msTempCameraFullDirPath); Uri outputFileUri = Uri.fromFile( fTempCameraFullDirPath ); Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri ); startActivityForResult(Intent.createChooser(cameraIntent, getString(R.string.select_camera_app)), REQUEST_CODE_CAMERA);
Now itโs clear that I donโt get to this code because the camera test fails and I disabled the button, but it seems that while I have the camera application installed on my Nexus 7 table, I should be able to take pictures.
Does anyone know an alternative test that I can use to enable this feature on this tablet (or similar devices)?
source share