CastingDevicePicker doesn't find the emulator - c#

I want to stream video to the remote device in UWP C#. I use a MediaElement and CastDevicePicker. I did everything following the article - https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/media-casting. CastDevicePciker doesn't find the emulator (screenshot - https://ibb.co/5sgLyq3). Ping to the device with the application is successful, and ping to the emulator is successful as well. So, I think that the Device with the application and the emulator is on the same local network.
What I am doing wrong?
I try to get a connection with the emulator, but nothing happened
I use a Microsoft Emulator - https://apps.microsoft.com/store/detail/microsoft-emulator/9N0TN65P5BF6?hl=en-us&gl=us

This is expected behavior. Based on the document- CastingDevice object represents a physical device that is capable of supporting casting connections and rendering media content sent to it. When you are trying to use CastingDevicePicker to pick an emulator, it is not considered as a CastingDevice object. So the emulator is not listed. Please try to use a physical device to test.

Related

WINUSB and UWP App: Can´t connect to my Device

I'm facing two different problems with my USB device that uses WINUSB ( Class 0xFF, Subclass 0x00 )
I have three different small apps, the UWP CustomUsbDeviceAccess from Microsoft samples modified to connect to my Custom USB Device, My UWP App i'm tryng to write, and a WPF sample program I wrote too. The three apps were working without problems, in my two computes, connecting to my WINUSB Custom Device, but in the middle of some windows/vs2017 upgrade, the two UWP Apps stopped working on both computers. The problems are different in both computers.
The first computer, with W10 Pro Fall Creators Update. The problem is, after calling this function:
this.device = await UsbDevice.FromIdAsync(devId);
it always returns null. And if I try to run this:
var deviceAccessStatus = DeviceAccessInformation.CreateFromId(devId).CurrentStatus;
it raises the excpetion
the system cannot find the file specified 0x80070002
The second computer, with W10 Home Insider Preview Build 17025.rs_prerelease.171020-1625, the problem here is that boths UWP App, CustomUsbDeviceAccess from Microsoft and my own UWP App, freeze entering this line:
var DeviceWatcher = DeviceInformation.CreateWatcher(DeviceSelector);
These codes were working, i don´t undertand what´s wrong now. My USB device works in both computer with the small WPF Desktop App I wrote. I tested the same three apps with other similar USB commercial device I have in hand ( same class/subclass, winusb too), and I have the same results, so I discarded the problem is in my device or something wrong in the driver installation process.
I saw another user had a similar problem in this post, but sadly, didn't find the solution.
I solved the problem in the second computer: I re-installed the Windows 10 stable version ( Fall Creators ). In this second computer, my UWP App works and connect to my USB Device as expected.
In the first computer, my main wokstation, I think the problem is due to an error in the installation of the driver or in some permission. I would like to know where my error is; I imagine that this could be a problem in the installation in the clients that I would like to avoid

Power cycling a USB device?

I'm working on troubleshooting a device that only works once it has been unplugged and plugged back into its USB port on the PC.
The application that talks to the device is written in C#. So I need a programmatic way in C# or perhaps batch files, etc. to reset a USB device.
Thus far I've tried using the devcon.exe tool, but that doesn't seem to do the same job that physically removing and adding it back does.
Is it possible to use Win32_USBController to control a USB device's power through the port somehow? MSDN Link
Perhaps in a similar fashion, I found the CIM_Controller class, which has Reset() function. MSDN Link
The tools for resetting a USB port in the Windows Driver Framework/Kit don't appear to be readily accessible via a library or otherwise without first creating an actual driver unless I'm mistaken.
Thanks
I would recommend that you navigate to the directory and find the device. Right click on it and in the short cut menu click on eject. The application and the OS should handle the device. It is a bad idea to "unplug" a USB device, especially flash drives without ejecting them. You could end up with open file errors.
If the problem is not ejecting the device then the issue is probably with the application. If the application is opening a file on the device and the device has to be unplugged in order to function properly then the application may not be closing the open file properly...
Just saying
You might look at the SO link: How to programmatically unplug & replug an arbitrary USB device?
and read through that...
it sounds to me like your scanner is completing a task then shutting it's post down. it remains plugged into the PC but the PC does not 'see' it. go to the directory and see if it is still in the directory...
unplugging once the device shuts down the port does nothing. replugging reconnects the electronics and the PC becomes aware of the device which completes one more task. then shuts down its port again.
Dr t

Windows Phone 8 Emulator not connecting to internet

I am trying to connect Windows Phone 8 emulator to the internet. I have tried all the tricks and steps given in Stack overflow or any other site but I am unable to get it.
I tried this:
Step 1 - using Hyper-V start the server, once started u can see the two new network adapters added in the (network sharing) page.
Step 2 - go to your visual studio IDE where your application runs, using Emulator run your application, once started try to open IE, it will not connect to internet.
Step 3 - now again come back to network sharing page right click on external adapter which was created newly select properties, hit on sharing tab, now check the two options to have tick mark if not tick that two options and click on OK.
Step 4 - internal adapter which was created newly will be changing the domain name from Unidentified network to your shared Domain name, once changed try to access the IE again in emulator which runs already. now i hope the internet connection works.
But once it's done it is showing:
The Windows Phone Emulator wasn't able to connect to the Windows Phone operating system:
The phone didn't respond to the connect request.
Some functionality may be disabled.
The resolution to which I found on internet was:
All you have to do is going to "Network and Internet --> Network Connections", right click on "vEthernet (Internal Ethernet Port) Windows Phone Emulator" and Enable it.
But it was already enabled .
So I don't know how to make internet work.
Some connection tools on the host can have negative effects when used with the emulator; I found having cisco VPN client installed on the host prevented the emulator from finding the internet. Other VPN clients may have similar side-effects. I simply uninstalled cisco (the inbuilt windows VPN is fine for what I need) and it worked perfectly.
I've also seen problems where it won't find the internet after the host has been suspended / resumed. In that scenario, it turned out to be bad network drivers. I installed a dedicated Intel NIC (rather than the on-board NIC on the motherboard) - problem solved.
Basically, Hyper-V is a bit fussy.
1.Check whether you are using latest internet explorer 10 or not. if not update and check it.
2.Still if it's not working, it could be the problem with your display drivers. You should have WDDM 2.0 drivers. Graphic card also goes well.
If you are using any proxy servers which require credentials for connecting to the internet, it may not probably get connected from the emulator.
This is because it doesnt support proxy authentication. The class for authentication are missing in the phone version of .Net
Please see the below post .
Not able to connect to webservice from a WP7 emulator

How to connect and test a Windows CE project on a real device?

Note : I'm using VS2008 and I'm working on windows 7.
I'm developping a Windows CE application which will run on a Motorola MC3000 device with a WinCE 5.0 like OS .
I tried to use ActiveSync in order to make the test with the selected device possible but it doesn't work on win7, so I tried to find another tool and I found Windows Mobile Device Center based on this discussion .
So Now I can browse with the device but unfortunately I can not test with it : The device have a "santech" application installed and can not kill the app. (even when I reboot the machine, the autorun lunch the app. automatically). Also when I try to deploy my application on the device it return error reports ; sometimes "no disc space" sometimes "the .exe can not be found".
I'm really stucked.
Can some one help me with this, I will be really gratefull.
Sounds like the debugger is attaching just fine, it's just unable to either fully copy the app and dependencies, or there's not enough memory to execute it.
If you can browse the device, you can stop the "santech" app from running. You just have to determine what is launching it. It might be a shortcut in the \Windows\Startup folder. It might be through a registry entry at \[HKLM\Init\]. IIRC, Symbol devices also support a *.run file in the \Application\Startup folder, so check that as well.
One of those is launching the app, so you can eliminate that if you desire.
Next, check the available memory on the device by looking in the Control Panel under System->Memory and adjusting the slider to provide more storage space. If there's not enough Storage Memory to store your app, you might try changing the deployment directory (under Project Properties->Device) to push the app binaries to non-volatile storage of some sort (on-board Flash, SD card, etc), if the device has it.
If you don't have enough Program Memory to run your app, you might be out of luck. Try killing processes to free up some space and playing with the memory allocation slider.
You can debug from inside VS2008 as well. You'll need to tell it to connect to a device as it automatically sends it to a emulator. To do that you need to select Windows CE Device from the dropdown list found in the "Devices" toolbar (To enable go to View, Toolbars and select Devices). Then hit F5 and it should start up on your device. You might get a couple of pop-up boxes that contain a list of devices; make sure these are set to Windows CE Device as well.
This handy page on MSDN should provide the information you need also.

Reading logcat on android from c#

I am looking into making a c# program that will read in the logcat output from an android device and read it in to the c# program.
Initially it should do this while the phone is connected and it shouldn't require a specific app on the phone to be installed for the c# program to be able to retrieve the logcat output. Also the phone shouldn't require root access.
Is this something that is possible, I can't find anything on Google that says its possible but thought I'd ask on here in case someone has some useful information.
Thanks for any help you can provide
The most practical answer is to execute the shell command 'adb logcat' from your C# program and capture its output.
The only requirement for the device is that USB debugging be enabled in the settings menu.
The host PC will require that the android developer tools and appropriate USB driver for the device be installed. This can, unfortunately involve a substantial amount of hassle, especially finding the right drivers for windows hosts.
More complicated approaches would be to duplicate the functionality of the adb program (it is open source) and/or USB driver in your program, or to install an app on the device with the read logs permission which sends them to you - or even run an ssh server under the app userid so you can connect in and obtain them.

Categories

Resources