Status Update
Comments
an...@gmail.com <an...@gmail.com> #2
still here in r14
I believe there is an error in the bug description.
the Expected results would be a return value of false.
but what one gets is a true value instead.
it seems to affect all android versions.
interesting fact:
the "Camera Support" property (hw.camera) defaults to 'no'.
but yet every AVD I tried so far has a camera app and it is even working quite well.
just so as one would expect if the AVD would have hw.camera=yes.
I tried AVDs with explicitly turning off an on the camera support but they behaved exactly the same way.
this is quit frustrating if you want to write an app, that could optionally use a camera but also works on devices without a camera.
ok, there are few devices without camera but it would be nice to test what happens if the app is used on such a device.
I believe there is an error in the bug description.
the Expected results would be a return value of false.
but what one gets is a true value instead.
it seems to affect all android versions.
interesting fact:
the "Camera Support" property (hw.camera) defaults to 'no'.
but yet every AVD I tried so far has a camera app and it is even working quite well.
just so as one would expect if the AVD would have hw.camera=yes.
I tried AVDs with explicitly turning off an on the camera support but they behaved exactly the same way.
this is quit frustrating if you want to write an app, that could optionally use a camera but also works on devices without a camera.
ok, there are few devices without camera but it would be nice to test what happens if the app is used on such a device.
vl...@android.com <vl...@android.com> #3
To completely turn off camera emulation start the emulator with '-webcam off', and '-fake-camera off' options. In this case there will be no camera devices reported.
an...@gmail.com <an...@gmail.com> #4
thanks, but could you be a little more verbose?
I usually start the emulators from the eclipse gui.
I tried:
android-sdk-linux_x86/tools/emulator-arm -avd nocam -qemu -webcam off -fake-camera off
and
android-sdk-linux_x86/tools/emulator-arm -avd nocam -webcam off -fake-camera off
but the options seem to be unknown either way.
thes are not listed in the -help
(got the command lines from the process list ;-) )
also there, there is no sign of the options:
http://developer.android.com/guide/developing/tools/emulator.html
I usually start the emulators from the eclipse gui.
I tried:
android-sdk-linux_x86/tools/emulator-arm -avd nocam -qemu -webcam off -fake-camera off
and
android-sdk-linux_x86/tools/emulator-arm -avd nocam -webcam off -fake-camera off
but the options seem to be unknown either way.
thes are not listed in the -help
(got the command lines from the process list ;-) )
also there, there is no sign of the options:
vl...@android.com <vl...@android.com> #5
The correct line is the second one. If emulator -help doesn't list -webcam option, it's not the r14 emulator.
an...@gmail.com <an...@gmail.com> #6
you were right. maybe something went wrong while updating. I deleted and reinstalled everything. now, the options work.
however.. it does not change the behavior of the code mentioned above. (avd with android 2.3.3) even the camera works.
on the 4.0 avd, the camera crashes if used with the '-webcam off', and '-fake-camera off' options. so, the options have some effect but just not as expected.
there might be a bug in my cam detection code, but its pretty much the same as the example above. maybe I'll just hard code a 'false' there to have a look at the behavior of the app on a device with no camera.
however.. it does not change the behavior of the code mentioned above. (avd with android 2.3.3) even the camera works.
on the 4.0 avd, the camera crashes if used with the '-webcam off', and '-fake-camera off' options. so, the options have some effect but just not as expected.
there might be a bug in my cam detection code, but its pretty much the same as the example above. maybe I'll just hard code a 'false' there to have a look at the behavior of the app on a device with no camera.
ez...@gmail.com <ez...@gmail.com> #7
Seems there is already a solution in comment #3 by means of different use, but this is what the symptoms were for me:
run "adb -e shell pm list features", and get:
feature:reqGlEsVersion=0x0
feature:android.hardware.camera
feature:android.hardware.camera.autofocus
I wouldn't expect those last two lines.
run "adb -e shell pm list features", and get:
feature:reqGlEsVersion=0x0
feature:android.hardware.camera
feature:android.hardware.camera.autofocus
I wouldn't expect those last two lines.
mo...@gmail.com <mo...@gmail.com> #8
Can this please be fixed? Testing for the Amazon Kindle is made a lot harder by this not really working and having to use the command line launch of the emulator for testing this.
mo...@gmail.com <mo...@gmail.com> #9
I am using r16 btw...
vl...@android.com <vl...@android.com>
ki...@gmail.com <ki...@gmail.com> #10
Vladimir's suggestions did NOT work ("emulator-arm -avd 2.2-no-camera -webcam off -fake-camera off")
mo...@gmail.com <mo...@gmail.com> #11
Not sure how you can flag this as released. I just tested it with r17 of the sdk and a brand new avd off 4.0.3. In the avd manager I set CameraSuport to No and number of emulated web cameras to 0 (which should turn off the camera according to the inline documentation).
Lo and behold.. it still does not work. While the command line invocation might work this is not a acceptable solution imho..
Lo and behold.. it still does not work. While the command line invocation might work this is not a acceptable solution imho..
bo...@gmail.com <bo...@gmail.com> #12
I'm seeing this in r20
[Deleted User] <[Deleted User]> #13
[Comment deleted]
[Deleted User] <[Deleted User]> #14
I'm having this exact issue in Android Studio 1.3.2 Using the following emulator
Name: Nexus_5_No_Features_API_23
CPU/ABI: Intel Atom (x86_64)
Path: C:\Users\IT\.android\avd\Nexus_5_No_Features_API_23.avd
Target: Android 6.0 (API level 23)
Skin: nexus_5
SD Card: C:\Users\IT\.android\avd\Nexus_5_No_Features_API_23.avd\sdcard.img
Snapshot: no
hw.dPad: no
runtime.network.speed: full
hw.accelerometer: no
hw.device.name : Nexus 5 (No Features)
vm.heapSize: 64
skin.dynamic: yes
hw.device.manufacturer: User
hw.gps: no
hw.audioInput: yes
tag.id : default
hw.camera.back: none
hw.mainKeys: no
AvdId: Nexus_5_No_Features_API_23
hw.camera.front: none
hw.lcd.density: 420
runtime.scalefactor: auto
avd.ini.displayname: Nexus 5 (No Features) API 23
snapshot.present: no
hw.device.hash2: MD5:88b349acad40b1340089dc66e95cc6d7
hw.ramSize: 1536
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Default
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: no
disk.dataPartition.size: 200M
hw.sensors.orientation: no
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
Camera detection code:
boolean hasCamera = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
Log.i("myTag", String.valueOf(hasCamera));
return hasCamera();
When logged, the value of hasCamera is true. With this emulator that code is expected to return false.
Name: Nexus_5_No_Features_API_23
CPU/ABI: Intel Atom (x86_64)
Path: C:\Users\IT\.android\avd\Nexus_5_No_Features_API_23.avd
Target: Android 6.0 (API level 23)
Skin: nexus_5
SD Card: C:\Users\IT\.android\avd\Nexus_5_No_Features_API_23.avd\sdcard.img
Snapshot: no
hw.dPad: no
runtime.network.speed: full
hw.accelerometer: no
vm.heapSize: 64
skin.dynamic: yes
hw.device.manufacturer: User
hw.gps: no
hw.audioInput: yes
hw.camera.back: none
hw.mainKeys: no
AvdId: Nexus_5_No_Features_API_23
hw.camera.front: none
hw.lcd.density: 420
runtime.scalefactor: auto
avd.ini.displayname: Nexus 5 (No Features) API 23
snapshot.present: no
hw.device.hash2: MD5:88b349acad40b1340089dc66e95cc6d7
hw.ramSize: 1536
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Default
runtime.network.latency: none
hw.keyboard: yes
hw.sensors.proximity: no
disk.dataPartition.size: 200M
hw.sensors.orientation: no
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes
Camera detection code:
boolean hasCamera = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
Log.i("myTag", String.valueOf(hasCamera));
return hasCamera();
When logged, the value of hasCamera is true. With this emulator that code is expected to return false.
to...@gmail.com <to...@gmail.com> #15
I was able to get around this limitation by disabling the camera app in the Emulator's Settings:
Settings -> Apps -> All -> Camera -> Disable
Settings -> Apps -> All -> Camera -> Disable
ko...@appcube.info <ko...@appcube.info> #16
It still does not work!
th...@gmail.com <th...@gmail.com> #17
It is still broken, the emulator does not respect the "no camera" setting. If I create an emulated device and set all cameras to none, PackageManager.hasSystemFeature( FEATURE_CAMERA_ANY ) returns true and android.hardware.Camera.getNumberOfCameras() returns > 0. This really should not be a bug that takes 7 years to fix.
ol...@gmail.com <ol...@gmail.com> #18
Now we are at 10 years, actually.
bo...@gmail.com <bo...@gmail.com> #19
Shout-out to the OG Android devs who have been watching this ticket for a decade. Hope you are all doing well!
bo...@google.com <bo...@google.com>
pa...@gmail.com <pa...@gmail.com> #20
Still broken in Android 10. The tutorial below tells us that this is the correct method, if it doesn't work why hasn't the tutorial been updated?
https://developer.android.com/training/camera/photobasics#TaskManifest
Description
SDK tools version (available in the "About" section of the 'android' tool
UI): r9
Eclipse version: na
ADT plug-in version: na
Platform targeted by your project: na
Version of the platform running in the emulator: 2.3.1
STEPS TO REPRODUCE:
Create an avd with the settings Camera Support = no with the android tool.
Execute a code like this
public boolean hasCamera() {
PackageManager packageManager = application.getPackageManager();
return packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA);
}
EXPECTED RESULTS:
calling this function will return true
OBSERVED RESULTS:
even though it should return false imho