hardware

How to find out the aperture angle of an android camera

橙三吉。 提交于 2019-12-10 22:43:37
问题 Is it possible to find out the aperture angle of the camera devices during runtime. I had tried to use the getParameters().getHorizontalViewAngle() function but it returned 360.0 degrees. A realistic value would be 45 degrees or something like this. Does anyone have experiences with this? Thx 回答1: What I can tell you is that you cannot trust the getHorizontalViewingAngle(). Theoretically, this function should get the correct value, but many phones (from my experience) have just a random value

Is drawing through the Canvas class hardware accelerated on Android?

你说的曾经没有我的故事 提交于 2019-12-10 20:56:39
问题 Are calls to Canvas.drawPath()/drawArc()/etc hardware accelerated, passed to a device native implementation or implemented in Java? Or is OpenGL the only way to achieve hardware accelerated drawing? I am trying to determine if it is feasible to use the Canvas API for realtime animation. 回答1: currently Canvas is not hardware accelerated. there are hints in the source code which point to the plans of implementing wrapping canvas calls around so HW accelerator, but it's not functional as of now.

Listen for iOS device power button presses

扶醉桌前 提交于 2019-12-10 17:56:33
问题 I am creating an app, which needs to do something when the user presses the power button 5 times. I figured out that it's difficult to implement in iOS, but I think it's not impossible. How do I listen for power key events, even when the app is running in the background? Can anyone help me to find solution? 回答1: you can tap a power key once and also you cannot detect the event from your application, this is not possible in iOS as far now, better try a different way to send alert with in your

Need a very fast one-to-one algorithm, possibly encryption

随声附和 提交于 2019-12-10 16:39:39
问题 I need a very, very fast one-to-one algorithm. The algorithm doesn't need to be unbreakable. Reasonably strong is enough but it must be lightning fast. I will be implementing it in hardware. Area is a concern, too, so it shouldn't use too much logic. It should be a function f_N(x) whose input is an N-bit number and whose output is an N-bit number. N is a constant, probably between 20-70. The function must be one-to-one. (ie invertible, meaning that decryption is possible. Decryption speed is

RS 232 Break Signal

微笑、不失礼 提交于 2019-12-10 15:06:37
问题 I got a RS232 signal capture device. and it working great. I need some help making sense of the data. Basically we bought it because we are dealing a late 80's machine controller that uses serial communication. We had little luck despite knowing the port parameters. From the data I dumped machine control is using the break signal as part of it's protocol. I am having trouble duplicating it using VB and the MSComm. I know to toggle the break signal and on and off. But I am not sure what I am

How does a fingerprint scanner protect its store of fingerprint data?

末鹿安然 提交于 2019-12-10 14:51:09
问题 On my fingerprint scanner, the fingerprints are stored in the device itself. I'm sure that this is the same as most of them. How do the scanners protect/encrypt the fingerprint data, so that someone can't extract this information directly from the scanner and use it to authenticate? I know that this would require serious skill, but I'm sure that I'm not the only one who has thought of the possibility. 回答1: Fingerprint devices typically do not encrypt or store your fingerprint data. What

Changing the keystrokes of a USB keyboard

徘徊边缘 提交于 2019-12-10 10:58:18
问题 Every time a key is pressed on a regular keyboard, a numeric 'key code' is sent to the computer, eg. 32 or 51 which represent specific keys. Unrelated to my default keyboard which I am using to type this post, I want to be able to plug in a keyboard via USB and have its key codes all shifted up by some constant C. Thus, when pressing the 'a' key on this side keyboard, the computer would not receive the keycode for 'a', but rather some higher number which the computer does not have a planned

How to determine if a machine physically has a serial port?

我的未来我决定 提交于 2019-12-10 10:42:44
问题 I could try to open it, but if it is use by another program I will get an error and I need to be able to distinguish that case from the case where the machine physically has no serial port. Any idea? 回答1: You can use WMI. Have a look at my old post 回答2: Just for complement the Serg answer, the Win32_SerialPort class used in this article reports the physical com ports, if you wanna enumerate all the serial ports including the USB-Serial/COM ports, you must use the MSSerial_PortName class

How to deny shutdown when pressing the power button for a while?

删除回忆录丶 提交于 2019-12-10 03:54:43
问题 On most newer computers you can shutdown the hard way by pressing the power button for a couple of seconds. But I want to prevent this completely. You're able to prevent some soft events like the sleep, suspend, hibernate and "Press power button" events in Windows control panel; you can also use some Win32 and WDI programming to catch and handle/deny those events but it doesn't seem to stop the mechanical power off when you hold the button for a longer time. I guess the power button is hard

How I can receive hardware key events in sleep mode?

谁说我不能喝 提交于 2019-12-09 19:08:21
问题 I'm writing an application that allows people in danger to call 911. This is how it should work: He (or she) feels danger. He pushes the volume-down key three times. My app calls 911. But I'm facing the following problem: how can I receive a hardward key event in sleep mode ? I've searched Google and other search engines, but can't find anything related. 回答1: public class YourBoardcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if