device

Java: List Cameras that are Plugged In

风格不统一 提交于 2019-12-04 05:34:06
My program currently gets a list of drives plugged into the computer with File.listRoots() . But, when I plug a camera or an MP3 player into the computer directly (instead of inserting the memory card), it's not listed, nor does it have a drive letter in Windows Explorer. For example, here's the location of my camera: Computer\Canon PowerShot SD750\Removable storage How can I also list cameras/other devices that do not have a drive letter? I assume this will require a JNI library of some sort, but I don't know for sure obviously. Thanks! P.S. Out of desperation, I did try to list the contents

Flash memory as mass storage device using STM32 USB Device Library

梦想与她 提交于 2019-12-04 05:16:04
There is this flash memory IC on my board, which is connected to my STM32F04 ARM processor. USB port of the processor is available for the user. I want my flash memory to be detected as storage device when connected to PC via USB. As the first step I defined my USB class as MSC in my program which works fine. Since when I connect my board to PC, it detects a mass storage device connected, giving an error that "You should format the disc before using it". Now the question is that, how I can define my flash as 'the storage' to my processor. The following would probably be a part of your answer:

Calculate PPI of Android Device

久未见 提交于 2019-12-04 02:58:53
How do I calculate PPI of Android device. Most specifically Android Tablets. Take a Note that I want to calculate PPI of the device and not DPI. It's easy like one-two-three =) Let's caculate PPI to Nexus 5 , for example. float LCD_Diagonal = 4.95f; int screenHeightPx = 1920; int screenWidthPx = 1080; float PPI = (float)Math.sqrt((double)(screenWidthPx*screenWidthPx + screenHeightPx*screenHeightPx))/LCD_Diagonal; Log.e(TAG, "display_page_screen_ppi: " + String.format(Locale.getDefault(),"%d %s", Math.round(PPI), "ppi")); In result we have 445 ppi that's true according with specs . PPI The

How can I write to the NUL device under Windows from node.js?

蓝咒 提交于 2019-12-04 01:51:56
This is bugging me for several days now. I know about the standard stream redirection to the NUL device, but this isn't the case. node.js uses CreateFileW under its fs native/libuv bindings. Unfortunately using something like: require('fs').writeFileSync('NUL', 'foo') creates a NUL file into the cwd that has 3 bytes. I tried writing to the \Device\Null, but since I'm pretty much a *nix head where everything is a file, I failed to actually find a working path for \Device\Null. Such as \\.\Device\Null that throws ENOENT. Any ideas about how to make this work under Windows? This seems to be

Find out which process has an exclusive lock on a USB device handle

瘦欲@ 提交于 2019-12-04 01:07:26
问题 I have a library that reads/writes to a USB-device using CreateFile() API. The device happens to implement the HID-device profile, such that it's compatible with Microsoft's HID class driver. Some other application installed on the system is opening the device in read/write mode with no share mode. Which prevents my library (and anything that consumes it) from working with the device. I suppose that's the rub with being an HID-compatible device -- other driver software (mice, controllers,

“Android device is not listed while running adb devices (ubuntu 10.10)” [duplicate]

旧街凉风 提交于 2019-12-03 22:20:07
问题 This question already has an answer here : usb debugging with micromax unit a092 in ubuntu 12.04 (1 answer) Closed 12 days ago . My Android device Ly-706 is not listed while running adb devices. I can run emulator using eclipse and install application on emulator using adb except on Real device I added: SUBSYSTEM=="usb", SYSFS{idVendor}=="040d", MODE="0666" in /etc/udev/rules.d/90-android.rules ,still no luck Same result for samsung galaxy 3(vendor id ="04e8") I installed GNU/Linux (ubuntu 10

How to let user select a video recording device (web-cam) with OpenCV?

吃可爱长大的小学妹 提交于 2019-12-03 20:07:20
问题 So what I need is something like capture devices list. And some function to get from user on which device he wants to stream. How to do such thing with openCV in win32 C++ console application? 回答1: Try using some OS functions to enumerate webcams. It might take some work, but this approach will guarantee that you get a list every time (unlike the OpenCV hack, which sometimes doesn't work, for some reason). 回答2: As Martin said it's not supported in OpenCV but you could use a little trick. If

Best practices for targetting a wide range of devices and screen sizes

自古美人都是妖i 提交于 2019-12-03 17:54:12
As you know android today is many versions many constructors, many screen sizes,... it's quite difficult for developers today to write programs that targets a big part of devices. What would be THE developer must-know practices for this ? tips for fluid layouts. "standards" for developing on any android version. ... Any other ideas ? For Layouts First, you should start off by reading the official Supporting Multiple Screens Best Practices . There are a lot of good tips there, as well as a general idea on what you need to be looking for in terms of compatibility. One thing I've found to be very

Proprietary USB device access via browser… possible? Silverlight maybe? (Java is excluded for now)

隐身守侯 提交于 2019-12-03 16:51:57
Probably there are a lot of similar questions around, but since I know only few solutions to this which I am not sure will work for us, I am looking for something else, maybe new technologies... What we have is this USB device which is not so fancy (of course, it requires a driver to be loaded), and it has couple of C++ dlls to help getting certain output from it. On top, we made a C# desktop application which makes use of the device in a more attractive way (plenty of interop inside). So far so good, but to have the application lifted up to the web in order to gain more flexibility... What

android execution in emulator or device?

老子叫甜甜 提交于 2019-12-03 15:41:51
Is there any way to know if my application is running on the emulator or on the device ? I am using this code snippet which works on both Intel and ARM emulators: if (Build.MODEL.contains("google_sdk") || Build.MODEL.contains("Emulator") || Build.MODEL.contains("Android SDK")) { RunsInEmulator = true; } Secure.getString(getContentResolver(), Secure.ANDROID_ID); (where Secure is android.provider.Settings.Secure ) That value will be null on the emulator, non-null on devices. 来源: https://stackoverflow.com/questions/2245654/android-execution-in-emulator-or-device