Camera has stopped - android

I have a big problem!
When I want to start camera in Eclipse AVD android emulator it shows Unfortunately, Camera has stopped. When I start App Camera - light near my laptop camera turns on, but just for a few seconds. It turns off when I click at error communicate "OK". I have Lenovo B590 laptop. I've updated my drivers. My camera works in Skype. I tried running my AVD with another target and another CPU(atom etc), but still same error.
I tried all solutions for my problem from this site (and another), but none worked. I need to write the program, but I can't test it when the camera doesn't work.
Screenshot with my AVD settings:

I had the same problem on an Lenovo X220. I solved it by installing a "fake-cam" driver.

According to me, first of all check your system drivers and calculate how many drivers are not present in system or not updated or which are outdated via driver max or update my driver software then install/update web camera,usb bus related, memory related, chip-set related and port and processor related drivers install(you can install the driver by CD when ever you purchase your computer at that time some shoppers are given that)
Then edit your AVD back camera value set=webcame0 and give the size of your SD card and memory then click edit and then ok and run you camera application. I'm sure that camera will start.

Related

Android emulator keeps on crashing

Whenever I open the AVD Manager and launch any one of the virtual devices I created, the emulator starts and closes immediately. When I run the virtual device in AVD Manager for the first time I get an error message that QEMU has stopped working.
I have given the right path to the JDK. More over, I have tried to install Android Studio again and again, but still its not working. I am using Windows 7(32 bit, 2GB RAM, without graphic card).
Is there need of graphic card to run emulator? If not, what should I do the run the emulator?
In AVD manager open settings for your virtual device.
In the Emulated Performance section open the dropdown for Graphics.
Change it from Automatic to Software.
Hit the Finish button to save new setting and try starting the emulator again.
I finally found the solution here: https://www.bram.us/2017/05/12/fix-for-the-android-emulator-crashing-during-launch/
It seems to be an incompatibility with other software, such as Docker, Oracle Virtual Box and other products that use VCPU. In my case, it seems that VBox and/or DraftSight caused the issue. I don't get the error when I terminate those applications first.
After trying Vahid's answer, it stopped crashing. Unfortunately it was lagging badly. After installing the NVIDIA drivers for my card (I have a 1060), I was able to change the setting to Hardware again, and now it is much smoother.
In most cases the solution provided above by #Vahid would work but if for some reason you still want to use hardware for graphics. You can try upgrading graphics drivers and make sure to set your graphic profile aka GPU workload to Graphics instead of compute. This settings can be found in Nvidia control panel or AMD Radeon software settings, not sure if this would work for integrated graphics.

Eclipse on Mac android bug

I am having a strange issue ever since I installed eclipse on my mac mini (switched from windows machine). I am developing an opengl app on android and if I launch the app from eclipse, the android-opengl method OnSurfaceCreated() will be called randomly trashing the game (not supposed to happen). If I launch the game from the phone without eclipse this never happens. Also I have to unplug and replug the phone every time I want to build and launch from eclipse or else the phone doesn't appear as a choice. So I am suspecting there is something wrong with ADB. Any ideas? I have a samsung galaxy SIII. Is there a driver I need to install?
This happens to me too on Eclipse installed on my mac. I had to replug the device every now and then. The problem is only of the UI. If you drag a border on the device chooser UI, it will show up. See https://stackoverflow.com/a/26425489/1306419 answer on Just upgraded my OS X to Yosemite, Android Device Chooser not showing device - what to do? .
Also regarding OnSurfaceCreated() issue, please share the error that appears in LogCat.

I cannot use camera in genymotion emulator

I am using genymotion emulator http://www.genymotion.com/ but when I opened the camera , I got message "cannot connect to the camera " , what is the problem ?
UPDATE Made it a community wiki in case someone else has something to add, I can't keep this updated right now :)
It could just be that you didn't activate the camera for the emulator. Opposed to the stock emulators that once you set up the webcam they just work, on genymotion emulators you need to turn the cameras on. The process is very simple.
On the emulator window, press ctrl+3 or ⌘+3 to bring the camera configuration panel that looks like the left, and turn it on like on the right:
You can select a dummy camera which will show a genymotion logo moving around the screen or use the system camera if it's available and preview it. Note that on the above screenshot I'm using the phone front camera instead of the back camera.
If all the other solutions do not seem to work you can
keep the virtual device working and restart eclipse,
and the adb process and it should work. It worked for me. My guess is that the connection to adb is already taken by some other camera and that's blocking your current camera from connecting to the IDE development with the virtual device.
If you are using Intellij Idea no need to restart Genymotion or IDE.
Genymotion: Switch off camera
Intellij IDEA: From menu select Tools/Android/"Enable ADB Integration"
Genymotion: Switch on camera
It should works for you as well.
Just expanding the #sivi's answer:
In my case, i just re-established the connection to emulator using these :
adb kill-server ---> adb start-server
and it started working perfectly.
If you are using eclipse, I found out going to DDMS and then Devices you can reset the adb. You can find the option by clicking on the drop down arrow that says "View Menu".
Example to find Rest adb.
just end your ADB.exe process or similar in MacOS kill adb and it will automatically re start hence genymotion needs it and you will be able to use your camera, ADB is probably keeping the cam busy.
I tryied all the suggestions above including restart adb but None worked
Then I see a suggestion on an English-language website
My English is not good so I can not totally understand it and I forget the URL of the page..
However the final suggestion is delete your virtual device in genymotion and just re-create a same one, maybe you will work.
I followed that advice and I succeeded.
So I come here to share.
Here is another solution.
I've tried all of the above and frustruately none of them worked.
Eventually I found out that if I rotate the device to landscape the camera is working. otherwise I get the green screen.
Hope that helps someone..

Android Device Chooser shows my device but my app will not start on my phone! :(

My Device shows up on the Android Device Chooser as:
Serial Number -- Ige-vm670-A0000028F1773B
AVD NAME -- N/A
Target -- 2.2.1 (with a green check mark next to it!)
State -- Online
Everything seems fine..So, I press the "OK" button on the bottom right hand corner of the Device Chooser screen. When I do this the Device Chooser closes and the Launching bar in eclipse eventually finishes, but then the application never starts on my phone!! :(. Am I missing something? I tried using different USB cables, switching from USB 3.0, and checking if there is enough memory on my phone but nothing seems to work :(. PLease help this newbie!! I'd much appriciate it!! ALso, i'm running eclipse in windows 8.
following steps may help you
1)Restart your Device
2)Go to application settings and enable the USB debugging.
3)also enable other application to run on your device.
4)make sure that device status is online on android device chooser.
5)make sure that your device appear in device list in android Eclipse.
If above steps wont help you then try to run your project on emualator.And if emulator fails to launch your project then you need to see the android console
Enabling SD-Card access may result failure of connecting to the device.
Please try to switch MTP on instead of either PTP or SD-Card

Use Desktop webcam on Android AVD

i'm developing an android app that needs to capture a camera picture,
is there any way to configure my AVD to use my conputer webcam on the emulator?
when i open the default camera app it shows me an squareanymation, can i use/configure the emulator/avd to use my computer webcam?
I really can't think of a way to do this.
I would do the following:
During development, when debugging on an actual Device under adb, use the camera as normal. While debugging on an AVD, comment out your camera code and us a pre-taken a png to your app that resembles/emulates the photo the camera would have taken. This would let you work on the picture analysis regardless of the camera, and finish your app without an actual ADB device, just AVDs. One you get ahold of a real device you can finish up.
On another note, if you are ready to go poking around in VMs, Android Kernels, and HALS, you could follow this article (http://bytecruft.blogspot.com/2011/05/alternative-to-android-emulator-and.html) which tells you how to setup Android X86 under VMWare or Virtualbox as an ADB Device. I'm sure setting up the host machine's webcam as a camera would be much easier that bay (VMWare device bridging comes pretty close).
Hope I helped.

Categories

Resources