standby

Adjust volume and prevent computer from standby in Java… (Mac and Windows XP, Vista)

隐身守侯 提交于 2019-12-25 04:38:36
问题 I am writing a Java program that wants to do 3 things, and I don't know how to do them or if it's even possible with Java. 1 - I want to ensure that the computer whether running mac OS or windows xp/vista, doesn't go to sleep whilst running my app. 2 - I want my app to be able to turn the volume to full on all of the above OS's before playing a sound. 3 - Finally, when a sound is played I want to make sure that the screen, if turned off for 'power saving', is switched on. Is any of this

Android going to sleep (standby)

不想你离开。 提交于 2019-12-24 14:10:34
问题 I want my android device to go to sleep (screen off), has someone an idea how to do it? In the past I was using the PowerManager function goToSleep(time) , but apparently this function does not exist anymore, I don't understand why. Other topics talk about those lines: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "My wakelook"); wakeLock.acquire(); But it only allows the device to enter sleep mode, without

SMS gateway how to program android app [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-23 05:44:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I want to make a SMS gateway app, that polls my website and checks if there are messages to send in the queue, and if there is, the app will send it to the destination number. There should also be a callback function, where I will post information about the message, what android did exactly with it. I thought

Connected standby notification for a W8 Service

孤街浪徒 提交于 2019-12-18 13:14:45
问题 I have a service, developed in C++ running on Windows 8 (and 8.1). How can I get to know that the system has entered Connected Standby? Since this is a service, it does not have a window, I should be using PowerRegisterSuspendResumeNotification, but it does not seem to be working. Does anyone know how I can get such a notification? 回答1: I have contacted Microsoft's technical support. This is their answer: There are no direct notifications for ConnectedStandby enter/exit, but you can just use

ImageView causes crash but only when resuming from standby mode

自古美人都是妖i 提交于 2019-12-13 04:25:45
问题 I got an Activity class that uses two other classes; one of them extending ImageView and one that extends BaseAdapter like so: My ImageView class does some progresses when it is called and when I am starting it for the first time it does what I want it to. This is also the case if I press home button and then resumes. But for some reason it does not work if I resume from standby mode. (pressing the button on the phone that makes the screen dark) When I unlock the phone it crashes. It crashes

Win32 API prevent standby

别来无恙 提交于 2019-12-13 02:45:30
问题 What is the Win32 api function that prevents the system from going into standby? Some programs use it, which is pretty annoying in my opinion. I know there's a couple of WM_SYSCOMMAND messages you can trap to prevent the screensaver from coming on.. 回答1: SetThreadExecutionState. There's no Get and it doesn't take a thread handle. Done. 来源: https://stackoverflow.com/questions/2687867/win32-api-prevent-standby

Put computer in standby after running a scheduled task but only if it had to wake up to run it

泪湿孤枕 提交于 2019-12-12 05:14:33
问题 I have a scheduled task which I want to run every few hours. If the computer is currently in standby, I want it to wake up, run the task, then go back to sleep. If the computer is currently on, I want it to run the task but not go back to sleep, because that would be annoying. Is there any way of knowing whether a scheduled task had to wake the computer to run? 回答1: I've just realised one way of doing it which is to run powercfg -lastwake This is the output when waking to run a task: C:\Users

hadoop namenode port in use

早过忘川 提交于 2019-12-10 12:57:25
问题 This is actually a standby HA namenode. It was configured with the same settings as the primary and hdfs namenode -bootstrapStandby was successfully run. It begins coming up on the standard HTTP port 50070 as defined in the config file: <property> <name>dfs.namenode.http-address.ha-hadoop.namenode2</name> <value>namenode2:50070</value> </property> The start up begins OK then hits: 15/02/02 08:06:17 INFO hdfs.DFSUtil: Starting Web-server for hdfs at: http://hadoop1:50070 15/02/02 08:06:17 INFO

What's the best between AlarmManager and Handler+WakeLock?

久未见 提交于 2019-12-10 09:45:24
问题 I'm using for my Android Service an Handler that reapeat some operation each 60 minutes (1 hour), with a PartialWakeLock to keep the phone not sleeping. But this cause a lot of battery usage. So a decided to study about AlarmManager (i'm noob) that someone wrote here to be perfect for this kind of things.. But now reading along the web i find that who uses AlarmManager, still need a WakeLock. Is it true? What is the best way to run a cycle each 60 minutes (1 hour), without kill the battery?

Stop system entering 'standby'

徘徊边缘 提交于 2019-12-10 09:30:04
问题 How can i stop the host machine entering standby mode while my application is running? Is there any win32 api call to do this? 回答1: There are two APIs, depending on what version of Windows. XP,2000, 2003: http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx Respond to PBT_APMQUERYSUSPEND. Vista, 2008: http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx There could be many valid reasons to prevent the computer from going to sleep. For example, watching a video, playing music,