How to open a cashdrawer in android, using USB connected printer? - usb

We have a Point of Sale Application in that, iam using bluetooth, USB printer for receipt printing, through bluetooth option when i eject cashdrawer its working fine and iam using printer.printFormattedTextAndOpenCashBox(text, 40),
When coming to USB printing, got the printing, but unable to open the cashdrawer, i didnt found any methods like above for USB.

Related

Android Emulator connect external storage Device while running

I have an App that needs to detect, if a USB Storage device is getting mounted. Can i simulate the mounting of an USB Storage Device while the Emulator is already running? This way i can debug the behavior of my app.
As i know, for registering the mounting and unmounting of the USB Storage Device i can use the StorageVolumeCallback(). What do i have to do to write a simple .txt File to that attached USB Storage Device?
Im having trubble to create a StorageManager inside my ViewModel because i do not have access to the Context.
Im thankful for any Tipp related to USB Storage Management at all.
Info:
API Version: 31
IDE: Android Studio
Language: Kotlin
Edit:
So i do not necessarily need to have a external usb drive mounted at startup. If its possible with adb it would be great if i could just forward a usb Pendrive to the running emulator when i need it. Something like adb connectUsbDevice -deviceid=****,vendorid=***
There isn't a .NET library I'm aware of which can do this. However, please refer to this post where the brilliant answer shows how to do this interfacing with the Win 32 API.
How do I disable a system device programmatically?
You'll need a combination of this, and a WMI query to find an attached PnP device of type storage. As a clue:
using (var searcher = new ManagementObjectSearcher(#"SELECT * FROM Win32_USBHub"))
{
collection = searcher.Get();
}
Change Win32_USBHub to the correct class if this isn't giving you what you're looking for.
EDIT: Be warned. If you're disabling storage devices, make sure they're not in use. That's what the "Safely remove USB" option is for in Windows.
Another option, if you don't need to emulate this in code, use a real USB storage device inserted in the system and use PowerShell to get, disable, and enable the device.
The Cmdlets you'll need are:
Get-PnpDevice
Disable-PnpDevice
Enable-PnpDevice

How to open USB drive in read-only/write protected mode in OSX, programmatically using objective C?

I'm trying to write a mac app to access USB. The USB can be written through app only and not in other means. I want to make sure,app is having exclusive write access to it. I tried to find some apis in disarbitration but all efforts are gone in vain.
Adding Further details ::
I'm not trying to make all USB ports as read-only. When I plugin USB drive to the system, it should ask for password. If authentication fails, then user can view the files but can't write to it.

getUserMedia: access system output stream

I know how to access audio input devices via getUserMedia() and route them to the WebAudio API. This works fine for microphones and such. But in my use-case, I would rather like to hook into the audio stream of an output device. The use case is that I want to create a spectrum analyser for audio coming from a digital audio workstation (DAW) running on the same PC.
I tried to enumerate the devices and call getUserMedia() with the device id of an audio device, but the stream returned only showed silence data. The only solution I found so far is to install an audio loopback device (like Soundflower on Macs) to route the DAW's output to and then use this as an input device for getUserMedia(). But this will require the user to install 3rd party software.
Is there any way to hook directly into the audio stream of an output device instead, before it is actually sent to the physical device (speaker or external soundcard)?
This can be achieved using the desktop capture APIs (chrome.desktopCapture.chooseDesktopMedia). An example for chrome is included here

Epson MoverioBT-200 not showing local stream for webrtc getUserMedia API

I am testing SimpleWebRTC on Crosswalk and it works fine on an Android phone.
When I try it on Epson Moverio BT-200 the local stream doesn't show anything.
Moverio glasses do show the video stream when getUserMedia is accessed through a Firefox webpage though.
There is an open bug on the Jira of the Crosswalk project but still no clues on how to resolve it.
Any help would be very much appreciated

Printing in ios: if the printer is connected to the mac, could it print from the simulator?

I'm reading this to add the printing functionality.
The Printer-options sheet is displayed, but when I try to select my printer, the message "printer not found" appears.
The printer is connected via usb to the imac.
Can the print functionality be tested from the simulator?
EDIT
I tried with a wireless printer (installing also the airprint activator on the mac). Now I can see the printer from the simulator.
I don't know if I should be able to really print from the simulator and/or see some printer msg in the printer simulator.
EDIT
I resolved using the Printer Simulator
First of all this is a AirPrint feature. iDevice will only detect printers which are has AirPrint. There are about 12-14 hp printers currently supported. If you are looking for any printer, this is not possible. While developing we can use printer simulator or buy the supported AirPrint printer.
It seems that it's not possible to print from the simulator on both real and simulated printer. However, I succeeded to print from the device by using the Printer Simulator and by activating airprint on the mac with AirPrint Activator.