Has anybody ever got the emulator working with a webcam? - android

a bit of a reverse question.... We're looking to develop apps using vs 2017 and Xamarin. However, we simply can't get the Android emulator to work with a usb webcam on a windows 10 PC.
We've just running the emulator, no visual studio code and using the camera app on the emulator. We've tried all the different version of the OS, all have the same result... If we set the front or back camera to emulate, we see the black and white checkerboard but if we set it to webcam(0), we get a could not connect to camera error msg.
We have also tried all the suggestions in similar questions, i.e. clear the memory, increasing sdcard.size etc.
Android studio's emulator has an error "can't connect to camera"
Android Emulator unable to open/connect with real webcam
Nothing seems to work...and none of the above answers have a positive answer (other than use a different emulator, which we are about to try)
So my question is "has anybody ever got this to work" or we hunting for a unicorn and it just doesn't work?

Well to be honest, the unicorn was there the first time I connected my cheap Genius USB camera from 2007 into my Windows 8.1 PC and configured the Back Camera as Webcam(0) in the Android emulator, to test a barcode scanning app made with Cordova 7.1.0 CLI.
I would suggest you to try with Android system images from different API levels (I think I used Android 5.1 or 6.0 for my tests) and also, why not, update the Android SDK tools. (I used the old SDK tools 24 at the time). If using the standalone SDK manager instead of Android Studio (like I do) follow these steps to update your SDK tools to version 27.
I hope this helps, anyway, you now know that the unicorn may be elusive but it can be found if you have the proper settings.

Related

android emulators for xamarin forms

I'm having trouble getting any android emulator other than "Xamarin Android Player" to work (only with older versions of android).
What kind of virtual device/settings/properties should I use so that I can test newer versions of android and not have to wait 15 minutes for the emulator to startup?
is there a "Go-to" virtual device/emulator setup that doesn't take 15+ minutes to load?
(using windows 10/Visual Studio 17/2015)
The Xamarin android player has been discontinued for a while. As a visual studio user you should probably be moving onto the Visual Studio Android Emulator. There is a guide here on setup
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/
it is also available with visual studio 2017, and if i remember correctly is an option available in the Vs2017 installer.
I highly suggest Genymotion for most uses. You can download the free version which works well for most basic things (there are also a few small things you can do using the adb command prompt without having to buy the full version, such as taking screenshots).
Link to free version
They have a good list of different devices. I have also recently even got it successfully connecting to my Parallels Windows machine while the emulator is running on my Mac. Let me know if you need help with this specific scenario.
The other option for you is the Visual Studio Android Emulator. When it first cam out I tried using it but was not able to because I would need to run it on a Parallels VM which does not allow nested virtualization.

how to get Android_Accelerated_x86 emulator?

Emulator in the image below is one of the fastest emulator in xamarin. I have 2 computers and 1 of them has this emulator somehow installed. whatever I tried and I searched all over, I cant find out how to install this emulator on my other computer. Does anybody know how do I get this emulator. something similar described here but it is not the same at all.
I have already api level 23 and intel atom(x86) for this api level installed
I have installed extras in android sdk manager as below
There are two ways of getting an x86 enabled emulator.
First is by installing the Intel HAXM emulator. To do so open Xamarin Studio click on tools and open SDK Manager. In the Extras folder you will see an entry Intel x86 Emulator Accelerator.
An even simple solution is to install Android Studio and during the installation set the SDK path to the one configured inside Xamarin Studio. The benefit is, that you can use Android Studio for stuff like memory monitoring, CPU usage and such as well as getting a better designer for your layouts.
I described it for Xamarin Studio but the steps basically applies to Visual Studio as well.
I found the answer for my question. Just for anyone who will have same interest here is the answer. I dislike xamarin android emulators in general. I used to test my app using real device rather. Advantages were,
I didnt need any virtualization whatever hassle to be installed like hyper v
They occupy a lot of space on my ssd drive
but this emulator is beautiful, fast and light. It occupies only around 700mb. I highly recommend this emulator to anyone.
It comes with VS 2017 RC installation but you dont need to install VS 2017. It is also working with VS 2015. Just download the VS 2017 installer and choose the emulator only from the list.
PS, I guess most of the xamarin presentations made by microsoft and xamarin is with this emulator :)

Xamarin Android Player Freezing

I've setup the latest Xamarin Android Player (XAP) on my AMD64 server running Windows Server 2012
Hyper V has been uninstalled.
Before doing so I uninstalled Virtual Box and let XAP install its version.
When I start XAP with device Nexus 7 Lollipop it boots to the Android logo and goes no further.
What is wrong?
You need to post errors and logs.
VirtualBox should be installed I believe for the Android Xamarin emulator to work.
However, you could try reinstalling the Android player. Make sure virtualization is enabled in bios.
If worse comes to worse, you can install the Android AVD manager and use the normal Android emulator which also works on Xamarin.
The Xamarin Android Player is still in preview, any issues with can be addressed with bug report at https://bugzilla.xamarin.com/newbug
Please include the logs when you file a bug, you can generate logs by Right-click bottom bar > Generate Bug Report
In the meantime, I would recommend you to use Visual Studio Android emulators
In addition to what Prashant suggests, you can also try a different simulator image. Some of the XAP device images seem to be unable to boot properly on some machines. I've not seen any issues under OSX version of XAP, but the Windows version seems to be affected on some systems.

Xamarin Android Player is unable to run API 21 or higher emulators

I'm using Xamarin Studio and Xamarin Android Player on my windows 10 PC.
I'm having trouble starting Lollipop/Marshmallow (API 21/23) devices using the XAP, but on the other hand, launching Kitkat (API 19) works prefectly.
I've downloaded the required android SDK, tried reinstalling everything again and again but nothing works.
It seems wired, because it is not a problem with Virtual Box, nor with my PC or my XAP installation (if it was, than why Kitkat works?).
I've tried every solution I could possibly find, but nothing works.
Any ideas on what could cause this problem?( If further information is required, I will be happy to add :)
EDIT
It does not matter whether I start the devices through VS/XS/XAP. It all comes down to the same problem, but for the sake of simplicity, let's say I'm running them directly through XAP. Here is a screen shot of what happens when I launch Lollipop (which is API 22, and not 21, for a strange reason) :
For like 5 minutes, the following occur:
Than, forever:
And after a few hours it says booting or something like that, and than restarts to the first position.
With Kitkat, it just starts :).
you probably missed the intel HAXM update.. may be a possible duplicate: Android 5.0 (API Level 21) AVD not launching Intel Atom x86_64
First off, it's difficult to determine the problem without more information. Please list or screenshot the build error(s) you receive when you try to debug your app on a XAP emulator.
But on a hunch... within the past week, I had a problem with similar symptoms. In my case, I had to update project packages in order for my Xamarin Forms project to run on the higher Android APIs.
Reference on how to update packages: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/nuget_walkthrough/#Package_Updates
It might be that hyper-v is causing the problem: "VirtualBox and Hyper-V cannot co-exist on the same machine".
Try to disable it using bcedit as explained in the link.
For further reference, see this discussion
After launching xamarin android player, manually launch virtual box.
You should see the device listed on the left. There is a good chance it will say "stalled." If it says anything other than "Running," try reseting it or starting it.
I also had problems with XAP and my solution was to use Genymotion instead.
Did you try Genemotion
I think it is best Android emulator.
I would post a comment but my reputation is too low.
I don't know if this emulator works with Xamarin studio but if you use Visual Studio it may be an option for you.
Here is the solution:
I had the similar issue and fix the issue as follows.
delete the existing device simulator
reinstalled the simulator again
deploy the solution again.

Is there an alternative Android emulator for Visual Studio on Windows 10 Home

When using Visual Studio 2015 to develop c++ for Android the emulator only works if you are running a Pro version of Windows, for those using Visual Studio Community who are probably also running on a Home version of windows (like me) the Emulator will not work.
Is there an alternative available that can integrate with the VS debugger?
*** Edit
I have been looking at this list Android emulators although this seems to be aimed at android gaming on PC rather than App development. So was wondering if anyone had managed to integrate one of these with Visual Studio?
Both the below options come with the caveat that I have not used either.
Xamarin Android Player
Apparently Xamarin had issues with the default Android Emulator. Primarily that it was slow, and clunky, and they were getting a lot of complaints about it from Xamarin users (despite it not being their product/fault).
They decided to create their own emulator to get around this, and it can be found here.
It should be noted that (at time of writing) this is still in Preview by the looks of things. So bugs may be present.
From what I can see on the download page, it doesn't appear like you need Xamarin to actually use it. In any case, it's worth a shot.
GenyMotion
Another option is GenyMotion. There is a free version for personal use only (with limited functionality), or a paid option that provides more capability.
Android player link has changed to here: https://developer.xamarin.com/releases/android/android-player/
I had problems starting the android VMs, even after restarting the host. There seems to be some incompatibilities between Windows 10 Home and Virtualbox 5.0.4 that Android player installs. Installing Virtuallbox 5.1.2 after installing Android player seems to have resolved this.
EDIT: I haven't had a chance to test integration with Visual Studio yet.
Everything seems to be working as expected within Visual Studio. Both of the VM devices I created in Android Player are visible in the drop down of the run menu. Visual Studio will start the selected VM when I debug the default blank android app.
The only hiccup is that Visual Studio doesn't wait long enough for the emulator to start before attempting to deploy the app. So I have to start the run again or remember to start the VM from Android Player before debugging.

Categories

Resources