wake up ppc to start Alarm

RacingDog

Active Member
Licensed User
Bugger! I had just decided that my next app was going to be When To Take Your Pills. That obviously needs to have a timer running non stop just like Pocket Outlook, or the built in clocks. And basically you are all saying that until the forum acquires an underlying platform expert, I'm stuffed before I even begin. Yes?

I'd use the alarm clocks, but there aren't enough of them. I'd use Outlook but a) these are not appointments, they are clumsily inappropriate; b) they are not to dos, equally clumsily inappropriate; c) I really don't want this ActiveSync'd, I just want it on the phone.

Please don't let this issue die. When somebody finds out how this is done and can provide sample code, please wake us all up!

Oh yes, and then tell us how to use the same notification system.
 

RacingDog

Active Member
Licensed User
Ah, that is a rather more positive view than I was getting from the rest of the thread which seemed mainly nothing really works that well.

OK, well as I'm bored I'll knock up a dummy app and see what happens.

Thank you.
 

Discorez

Member
Licensed User
Longtime User
Did you try Hardware.RunAppAtTime? It does work on many devices.
Erel, I try this library. Method RunAppAtTime works on my device, but -
On some devices the screen doesn't turn on.
I have this problem - screen is off, my program is started and I can only "showing" MsgBox and listen system sound, but I don't see it.
How it's done by other programs, which I use on my device?... :BangHead:
 

RacingDog

Active Member
Licensed User
OK what I have learnt so far.

1. For some strange reason, I have to include the Hardware Desktop dll just so I can create an object, even though I am not targetting the desktop.

2. It is far far simpler to create two programs, one to set things up, and one that is scheduled.

3. There is an inherent problem the first time your main program tries to run the slave program. You get an error saying the system can't start the notification handler. You can get round this by just once manually running the slave, this takes care of the troublesome, program from unknown source dialogue which is itself the reason why the master can't start the slave first time through.

4. Add Dell Axim X51 to the list of programs this works for. I have yet to test the XDA Stellar.

I have to confess that saying who I am in software is something I've quietly ignored for all these years, so to prevent the problem repeating, can someone indicate how you tell the mobile who you are and that the software is yours and known? I figure it may have something to do with certification, but I've no idea how to get someone to do that or the costs involved, or indeed who does it. Thanks to whoever.
 

agraham

Expert
Licensed User
Longtime User
1. For some strange reason, I have to include the Hardware Desktop dll just so I can create an object, even though I am not targetting the desktop.
The device and desktop libraries are assumed to have the same structure and the IDE and the compiler use the desktop version to identify the available objects and methods. That is why there are non-functional dummies of some libraries, like Hardware, which is virtually useless on the desktop but necessary to define the structure of the device library.
 

RacingDog

Active Member
Licensed User
I think I may have had a spot of finger trouble when I said the Axim worked, it doesn't, well not at the moment. One problem previously hidden was that it doesn't support powering on the screen. Took that out. Still have a start up problem which I can avoid by running my alert prog once. Hmmm. Have to wait for 23:00 for my next pills as that's the job it's doing. Maybe it'll work then. Dunno.

That powering on the screen thing is a nuisance. You can't presume a user of a medical app would even understand the question if you put out a query "Does your device support display power on?", but if you leave it out totally that limits the number of target devices it runs on.

Not sure I want to release this, even if I can get it working on my devices, might be asking for trouble. There must be an easier way.
 

mjcoon

Well-Known Member
Licensed User
... it doesn't support powering on the screen.

Does that really mean turning on the back-light? I don't know whether all screens are similar but I can read mine in a strong light even with the back-light off. But I know that I can turn the back-light on and off via program because I do that to save battery when playing a long mp3 file.

For a trivial big-numbers clock program I wrote (so that I can read the time without glasses) I also wanted to be able to adjust the back-light intensity. I couldn't find out how to do that through an interface so I just included the line
B4X:
 Shell("\windows\fexplore.exe","\windows\Backlight.cpl")
This just shows the settings screen for the back-light intensity. Rather clunky, but might be worth seeing if it works on your device.

Mike.
 

RacingDog

Active Member
Licensed User
I thought it meant turn the screen on, not the backlight, as there is a comment in a previous post about mobiles waking up but not switching the screen on! I was only using it because of that. Well anyway, some don't support the function so I'm not going to use it any more.

I found out why my alerrt prog couldn't be started initially. Nothing to do with anything I mentioned before, but in some circumstances I was generating a start time that had already passed. Sigh. Yeah, I know, prat of the first water, let me say it for you all.

Still checking for alerts whilst standing-by. I could force the issue, but I'm using real alerting times as there are other things I need to be doing today.
 

Cableguy

Expert
Licensed User
Longtime User
Havent tryed this, since my winMo device died on me a few months ago, but showing the sip, doesnt make the screen to light up?
It is supposed to be used as user input, so I since every screen lights up upon finger tap, is screen is on, that is, then raising the sip would turn the screen light on(?)
 

RacingDog

Active Member
Licensed User
Makes sense. Not sure it applies though as I'm not showing the form, just sitting there and hourly checking if a msgbox is required.

I'd rather not use a msgbox, but it doesn't seem obvious how to tap into the notifications subsystem. It might work better if I could!!!

As I saved this, it finally worked on my Axim! Woo hoo! But it didn't on the Stellar, had to switch that on manually, but the notification came when I did.

I might try reinstating the Screen on for the Stellar, but then I'd need a way of predicting whether a particular device supports it or not, and I don't mean an interminable list of device types.

Watch this space, next meds are due at 11, so won't be immediate!


Edit: Nya hah, just spotted the .cs file that comes with the hardware dll. So, it's not an error dialog, it's an unhandled exception! Thank goodness somethings get done properly. OK, I can safely use ScreenOn then, just have to ignore the error! (Then trap subsequent ones of course!)
 
Last edited:

RacingDog

Active Member
Licensed User
It makes you want to scream.

My Alert program comes alive every hour, checks a table in an unshown form to see if there is anything to do. If there is, it puts up a message box and reschedules itself after the box is closed, then exits; otherwise it just reschedules and exits.

Works a treat, except.....

In Standby :

1) The Dell Axim, wakes up, screen and all every hour regardless of whether the display is needed, not what I intended; and it needs ScreenOn (only used with the message box) to have an error handler as it doesn't implement it
2) The XDA Stellar, doesn't wake up ever, but if you switch on manually, you do get the message box, not what I intended​

And these are just the two machines I have access to. What other manic variations exist?

The only solution I can see is hacking into the notification facility. I don't know how to do that, been away from low level stuff for too many decades :(

:sign0085:
 

RacingDog

Active Member
Licensed User
OK, I've done the obvious things that I know about. The Alert program no longer does the trivial every hour schedule, but the marginally less trivial actually required times. So the Dell won't keep waking up when there is nothing to do.

That has the knock effect that it is no longer necessary for the Alert app to run invisibly, so I've added a form show. That might encourage the XDA to spring to life. If it doesn't I'll try that SIP idea mentioned above as the form is now visible.

I'll let it all quietly run in real time and see what happens. I'll let you know. My med times are 8/13/18/23 so it will be a while before I know.

Update: Ahuh, well the Dell is nicely inactive until it has to be. So this is a runner for a Dell. But the XDA still doesn't come on :( I'd better try the SIP dodge.
 
Last edited:

RacingDog

Active Member
Licensed User
OK, So I finally discovered ContolExDevice.dll. Thanks for not saying chaps, that cancels a few of those beers I owe you!

So I tried using the Notification object, which also meant using the IconList object. Using the latter crashed! In code I cribbed from the help file too!

Here is a snip of the code and error and the ico file in a zip. This doesn't make a lot of sense without more information.....
 

Attachments

  • Bottles.zip
    4.1 KB · Views: 172

agraham

Expert
Licensed User
Longtime User
OK, So I finally discovered ContolExDevice.dll. Thanks for not saying chaps
It's been in the additional library list all the time. :confused:

In code I cribbed from the help file too!
You didn't crib well enough. :( I can see in the background of the thumbnail that you have a typo!
B4X:
FileOpen(stream, AppPath & "[COLOR="Red"][B]\[/B][/COLOR]Bottles.ico", cRandom)
 

RacingDog

Active Member
Licensed User
Oh bugger. I should have gone for a nap. I keep labouring under the illusion I'm getting better faster thanI really am. Thanks, put the beers back on.

Yeah I kniw it's been there all along, but in the plethora I missed it. Dang.
 

RacingDog

Active Member
Licensed User
I'm getting depressed with this. I set the Notification Caption, Icon, InitialDuration, Text, Visible. On the Dell it woke, temporarily showed Notification on the bottom bar, just one second, then sat there showing the equivalent of the hour glass icon and beeping for the duration, but no icon display, no text display. The XDA still didn't wake up but when switched on manually behaved as per the Dell but showed busy and beeped indefinitely. What else needs setting?

I'm getting fed up because I can't release any version of the most important, yet one of the smallest programs I've ever written. Reliably taking a whole raft of medicines is just so important. But nothing works the same on different machines, so it is unreleasable. Thousands could make use of it, but they can't have it. Damn, damn, damn.

There must be something else I can try.

I've had enough for tonight, gn all.
 

RacingDog

Active Member
Licensed User
I'm still stuck, sigh.

I've modified my tiny alert proggy to produce both a message box and a notification, just to prove messages are being set up ok. Run manually on a device it produces the message box and goes through the motions of doing a notify without actually producing one (or an icon). Having run manually, any number of times, it will autoschedule on the next hour (08:00 to 23:00) because of the dummy data file, but that is problematic in standby.

It needs something else I think, but I don't know what. It'll probably result in my beers owed count going up again due my stupidity, but that can't be helped!
 
Top