hardware

Android Studio: Is it possible to trigger hardware menu button

≡放荡痞女 提交于 2020-01-02 09:05:10
问题 I have an android application which kind of like a home screen of the build-in screen on android phone. I can list all the available applications and run them. One thing I don't know how to do is when user run an application from my apps, my application can trigger the hardware menu button to show the current application menus. Is this possible ? If not, what about doing it if the device was rooted. 回答1: In activity use override onKeyDown like this : @Override public boolean onKeyDown(int

detecting the memory page size

不打扰是莪最后的温柔 提交于 2020-01-02 02:48:07
问题 Is there a portable way to detect (programmatically) the memory page size using C or C++ code ? 回答1: Since Boost is a pretty portable library you could use mapped_region::get_page_size() function to retrieve the memory page size. As for C++ Standard it gives no such a possibility. 回答2: C doesn't know anything about memory pages. On posix systems you can use long pagesize = sysconf(_SC_PAGE_SIZE); 回答3: Yes, this is platform-specific. On Linux there's sysconf(_SC_PAGESIZE) , which also seems to

Android Hardware Battery temperature, where is the sensor?

爷,独闯天下 提交于 2020-01-01 19:44:10
问题 I have a stupid idea. With android is simple to get battery state (volt, charge, temperature, ecc). BatteryManager.EXTRA_TEMPERATURE I think that the sensor is located inside lithium battery pack, in fact there are 3 pins over it connecting to the phone. Maybe that one of them is the battery sensor temperature. How it works? It's possible, but i know that damage may be relevant , isolate that pin and connect the phone pin to an external sensor? So we can catch outside temperature using

Detect if phone's keyboard is slid out

只愿长相守 提交于 2020-01-01 19:23:07
问题 I'd like to set focus to an EditText and automatically bring up the virtual keyboard in certain situations. However, if a phone's hardware keyboard is slid out, I wouldn't want to. Is there any way to detect whether or not a phone's hardware keyboard (if one exists) is slid out? Or is there some functionality of the EditText that will handle all this for me? 回答1: if (getResources().getConfiguration().hardKeyboardHidden==Configuration.HARDKEYBOARDHIDDEN_NO) { //do stuff } To dive deeper,

How can I write a Delphi program to control the CPU fan speed and monitor the temperature?

 ̄綄美尐妖づ 提交于 2020-01-01 06:38:55
问题 I want to use Delphi to create a program that controls the fan speed of my computer and monitors the temperature. What API calls are involved in doing that? Are there any good code samples that you can share? 回答1: You can use the WMI classes Win32_TemperatureProbe and Win32_Fan, from delphi you must import the Microsoft WMIScripting V1.x Library using Component->Import Component->Import type library->Next->"Select the library"->Next->Add unit to project->Finish. See this code. is just a

Portable way to determining of printer is physical or virtual

☆樱花仙子☆ 提交于 2020-01-01 05:29:04
问题 I need direct-to-printer functionality for my website, with the ability to distinguish a physical printer from a virtual printer (file). Coupons.com has this functionality via a native binary which must be installed by the user. I'd prefer to avoid that. SmartSource.com does it via Java applet: Does anybody know how this is done? I dug through that Java APIs a bit, and don't see anything that would let you determine physical vs virtual, except looking at the name (that seems prone to

Sources to learn more hardware centered programming [closed]

ぃ、小莉子 提交于 2020-01-01 05:02:26
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking to learn how to build/program simple hardware and later move on to simple robotics. Where should I begin? What are the

Changing brightness of the Macbook(Pro) keyboard backlight

眉间皱痕 提交于 2019-12-30 07:15:15
问题 Programaticly, how can I modify the brightness of the backlit keyboard on a Macbook or Macbook Pro using Python? 回答1: Amit Singh discusses these undocumented APIs in this online bonus chapter, but does so using C -- I'm not sure if a Python extension exists to do the same work from Python, perhaps as part of PyObjC (otherwise, such an extension would have to be written -- or ctypes used to access the shared C libraries directly from Python [shudder;-)]). 来源: https://stackoverflow.com

What is actually a Queue family in Vulkan?

大城市里の小女人 提交于 2019-12-30 03:13:08
问题 I am currently learning vulkan, right now I am just taking apart each command and inspecting the structures to try to understand what they mean. Right now I am analyzing QueueFamilies, for which I have the following code: vector<vk::QueueFamilyProperties> queue_families = device.getQueueFamilyProperties(); for(auto &q_family : queue_families) { cout << "Queue number: " + to_string(q_family.queueCount) << endl; cout << "Queue flags: " + to_string(q_family.queueFlags) << endl; } This produces

CUDA or FPGA for special purpose 3D graphics computations? [closed]

人盡茶涼 提交于 2019-12-29 10:08:53
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 months ago . I am developing a product with heavy 3D graphics computations, to a large extent closest point and range searches . Some hardware optimization would be useful. While I know little about this, my boss (who has no software experience) advocates FPGA (because it can be tailored