Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

wake up ppc to start Alarm

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 11-24-2008, 10:11 PM
Junior Member
 
Join Date: Feb 2008
Posts: 47
Default Anything on this yet?

I have just run some tests. My device is one of those that does not support Hardware.ScreenOn. I tried to wake up device with BackLightOn and KeepAlive. These actually seem to work once the device is "awake."

However, in another related thread, Erel said:
Quote:
You can't run any code while the device is suspended (OS design).
Herein lies my problem from this thread, and probably the same problem with the alarm clock app in this thread. Once the device is suspended no code will run. That is, you can trigger your app through RunAppAtEvent and RunAppAtTime events but the app will not actually run. It is waiting to run.

Placing any of the "wake up" functions even at the very beginning of your app will not help since the app will not even load until after the device wakes up. This also means CableGuy's suggestion of simulating a keypress wouldn't work either.

If applications cannot load and no code will run while the device is suspended, then how does my device wake up for:
alarms?
appointments?
phone calls?

And even Sprite Backup faithfully starts on schedule while the device is asleep.

Last edited by sahoopes : 11-24-2008 at 10:13 PM.
Reply With Quote
  #12 (permalink)  
Old 11-24-2008, 10:31 PM
Junior Member
 
Join Date: Feb 2008
Posts: 47
Default

Will this work SetSystemPowerState?
Reply With Quote
  #13 (permalink)  
Old 11-25-2008, 04:45 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

No.
As written in msdn:
Quote:
System power states define maximum device power levels for all power-manageable devices in the system. If a device is already at or below the maximum power level mandated by the new system power state, the device power state will not be updated.
Reply With Quote
  #14 (permalink)  
Old 11-25-2008, 04:56 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by sahoopes View Post
then how does my device wake up for
I believe it is done by the Real Time Clock hardware on the device that runs to keep the correct(!) time even when the device is "off". It has a register within it that is set to the required wakeup time and when the time matches the register contents the hardware switches the device on.
Reply With Quote
  #15 (permalink)  
Old 11-26-2008, 12:16 AM
Junior Member
 
Join Date: Feb 2008
Posts: 47
Default

Quote:
Originally Posted by agraham View Post
I believe it is done by the Real Time Clock hardware on the device that runs to keep the correct(!) time even when the device is "off". It has a register within it that is set to the required wakeup time and when the time matches the register contents the hardware switches the device on.
How would an application, that cannot run while device is suspended, tell the RTC to wake up the device?

I'm betting the answer is it can't.
Reply With Quote
  #16 (permalink)  
Old 11-26-2008, 09:19 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by sahoopes View Post
How would an application, that cannot run while device is suspended, tell the RTC to wake up the device?
By setting the register in the RTC that holds the wakeup time before turning the device off. This is how your alarms, appointments and backups start on time. A phone call also wakes the device by hardware. In this case the phone hardware turns the device on when a phone call comes in.

I have looked but haven't so far been able to find the low-level API that the apps use to set a wake-up time. Something must be available as alarms etc. appear to work on your device while you say RunAppAtTime doesn't.
Reply With Quote
  #17 (permalink)  
Old 11-26-2008, 09:53 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

When using g-alarm the application on first use states that my PPC has some bug,
because of this the alarm might not work correctly.
next you have the option of fixing it.

I think this has to do with the issue described above, but apparently there is a workaround/fix.

I'll send him a PM, maybe he's willing to help

-= edit=-
he replied with this:
AGEye.de: Home of G-Alarm, G-Watch, G-Light, G-Invaders and Caver
But I'm not sure if this would/could solve the issue...

Last edited by Mr_Gee : 11-26-2008 at 03:53 PM.
Reply With Quote
  #18 (permalink)  
Old 03-26-2010, 09:32 AM
Junior Member
 
Join Date: Sep 2009
Posts: 47
Default

I came across this article, at System Power States section, it mention that when system state is "Resuming", the following happen:

When a device wakes up from sleeping, it is in this mode. The backlight and the screen are still off (this is where we can call the Hardware1.BackLightOn to turn on the screen), and programs have a 15 second window to switch the device to another power state before the device automatically goes back to the suspended state.

During testing, after my device wake up from CeRunApAtTime, it goes back to suspended state exactly after 15 second, to overcome this issue, I call the .net "PowerPolicyNotify" to "unattended power mode" & it work! (togather with Hardware1.BackLightOn & hardware1.KeepAlive)

I hope this will help the rest
Reply With Quote
  #19 (permalink)  
Old 11-07-2010, 01:14 AM
Junior Member
 
Join Date: Mar 2010
Posts: 28
Default RunAppAtTime Issue

chanppc,

can you please post a code example, to show how your code overcome this issue.

Thank you
Reply With Quote
  #20 (permalink)  
Old 12-09-2010, 03:18 PM
Knows the basics
 
Join Date: Aug 2010
Location: Russia
Posts: 64
Default

How to do display backlight on, if HardWare.ScreenON not supported on my device? With PowerNotify library (PowerNotify.BacklightOn) too does not work...
Other ways of solution exist?

My device - Samsung i8000 (Omnia II)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a App Frederik Questions (Windows Mobile) 2 07-15-2008 11:15 AM
Soccer Alarm? frigide Questions (Windows Mobile) 2 05-31-2008 11:51 AM
IDE hangs and does not start again DieterR Bug Reports 1 01-06-2008 07:32 PM
Start Form Designer without pda connected Cor Basic4ppc Wishlist 1 08-30-2007 08:22 AM
Automatique simple GPS start Put Claude Code Samples & Tips 0 05-15-2007 01:49 PM


All times are GMT. The time now is 07:31 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0