power-management

WM_POWERBROADCAST message not caught in MFC Dlg

若如初见. 提交于 2019-12-10 00:19:48
问题 I try to catch WM_POWERBROADCAST message when the system goes into sleep mode. I'm doing like : BOOL CPowManApp::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_POWERBROADCAST || pMsg->message == WM_POWER) { CString strMessage; strMessage.Format(_T("%d WM_POWERB%s wParam %x lParam %x"), pMsg->time, pMsg->message == WM_POWER?_T(""):_T("BRAODCAST"), pMsg->wParam, pMsg->lParam); OutputDebugString(strMessage); } return CWinApp::PreTranslateMessage(pMsg); } It simply doesn't work.

Increasing Battery Life on Windows Mobile using GPS and Web updates

一笑奈何 提交于 2019-12-08 07:02:45
问题 I have an app that runs on Windows Mobile and uses the GPS to update its location at various intervals. As expected, enabling the GPS chip uses more battery power. (no duh..) So currently my technique has been to cycle the the GPS on/off at approx. every 4 minutes to acquire the location, do something if things changed, and update its location to the web only if necessary. Otherwise, shut it off again and wait. On my one year old HTC Touch Diamond phone, with a fresh charge, leaving the

Energy efficiency in unity3d - halting app waiting for user interaction

北战南征 提交于 2019-12-08 04:28:25
问题 I am looking for a way to make my unity3d app sleep while waiting for user interaction (touch, mouse or keyboard event) or timer (minute-scale). The app is closer to an e-book reader than a game. The user interaction is best described as reading a non-animated wall of text 99% of the time. Sometimes there is a background sound (max 5% of time), it is enabled by interaction. Target platforms are android, ios, and webplayer. Rendering even a single texture with normal FPS can drain quite some

how can i set the value of Minimum (Maximum) Processor state

房东的猫 提交于 2019-12-08 02:34:09
问题 Under Win7, open Control Panel -> Power Options -> Advanced Settings->Processor power management. you can see Minimum Processor state, Maximum Processor state. I have get the value by powercfg command using C#. Now,I want to set the value of Processor state by C#. For example the old value is 5%,execute the programe,update the value to 10%. I have search the powercfg help document,there are no such command to do this. How can I achieve this? 回答1: I could only recommend calling

how to register broadcast receiver for low battery in android?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 22:51:46
问题 I want to register broadcast for low battery. If battery status reached at some level I want to get alert... Please if you have any idea please help me.. 回答1: You will need to register a BroadcastReceiver for ACTION_BATTERY_LOW. You can do this in the manifest with a <receiver> element or via registerReceiver() from some already-running component of your application. 回答2: For Battery_Status_Low, You could try registering it through a Service for example, like: BatteryReceiver receiver = new

iphone - What consumes less battery? StartmonitoringLocationsChanges or startmonitoringforregion?

会有一股神秘感。 提交于 2019-12-07 14:37:19
问题 I would like you to give me your feedback on which method consumes less battery. My app will run in the background and will wake up with location changes, so I would like to use the method that consumes less battery. Any ideas on which one it is? Thanks 回答1: Neither of these choices is responsible for more or less battery consumption. In order for your app to be notified of any location update, regardless of whether it is for a region change or a significant location change, you must specify

Energy efficiency in unity3d - halting app waiting for user interaction

巧了我就是萌 提交于 2019-12-07 07:16:28
I am looking for a way to make my unity3d app sleep while waiting for user interaction (touch, mouse or keyboard event) or timer (minute-scale). The app is closer to an e-book reader than a game. The user interaction is best described as reading a non-animated wall of text 99% of the time. Sometimes there is a background sound (max 5% of time), it is enabled by interaction. Target platforms are android, ios, and webplayer. Rendering even a single texture with normal FPS can drain quite some energy (measured by hand, literally - the device is warm). My main problem is I don't want to render the

Off screen rendering when laptop shuts screen down?

人盡茶涼 提交于 2019-12-06 19:43:40
问题 I have a lengthy number-crunching process which takes advantage of quite abit of OpenGL off-screen rendering. It all works well but when I leave it to work on its own while I go make a sandwich I would usually find that it crashed while I was away. I was able to determine that the crash occurs very close to the moment The laptop I'm using decides to turn off the screen to conserve energy. The crash itself is well inside the NVIDIA dlls so there is no hope to know what's going on. The obvious

How to enable proximity sensor in android

☆樱花仙子☆ 提交于 2019-12-06 15:41:11
I have configured proximeter successfully in my code. Now I want to turn off & on screen programmatically. Code of sensor is working just fine and following method is also getting called. @Override public void onSensorChanged(SensorEvent event) { // TODO Auto-generated method stub PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); WakeLock screenWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"screenWakeLock"); if (event.values[0] == 0) { screenWakeLock.acquire(); Log.e("onSensorChanged","NEAR"); } else { if (screenWakeLock != null) { if(screenWakeLock.isHeld())

Android App programming and energy-efficiency [closed]

 ̄綄美尐妖づ 提交于 2019-12-06 15:21:29
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 6 years ago . ATM, I'm searching through open source/close source android applications to identify particular concerns (code blocks, code patterns) that rise energy issue as my interests and part of studies. For example, code that turning on GPS for