XDA II and OnClosing Event

A

Alex Chan

Hi All,

I have developed an application which run quite well on Toshiba e740 and
IPaq series. But recently i run that application on O2, it got some weird
behaviour associated with the onClosing Event.

I found that XDA II will post onClosing Event to my Application when
ActiveSync or other applications (such as Camera) are on. It seems that this
behavious is non-deterministics too, i.e. Not everytime ActiveSync is on
will throw onClosing to my application. Anyone face the similar problem?

Regards,
Alex
 
G

Ginny Caughey [MVP]

Alex,

Whenever any CE machine needs to run more than 16 processes, it will try to
close one down so it can open the new one. I suspect that's what you're
seeing on the XDA II since some of them run a lot of processes already. Run
your app and you're perhaps near the maximum of 16. Then run the camera ...
You get the idea. It appears non-deterministic because it really depends on
whatever happens to also be running at the same time.
 
A

Alex Chan

Dear Ginny,

Thx for your response. I did check during the posting of OnClosing
event, the active programs were not too many, just 3 to 4.

If that onclosing event was post to all active program , then other
program such as those Notes, Task will be closed also, but they did not. I
really have no idea why only my app will be affected.

Maybe my app is always catching the focus of the screen, when other app
want to get the focus, my task will be "closed". is that the case?

Regards,

Alex
 
G

Ginny Caughey [MVP]

Alex,

How did you check the active processes? Usually phones in particular may
have processes running that don't also have forms that you can see. In any
case, the OS doesn't need to close all active processes in order to open a
new one.
 
A

Alex Chan

Dear Ginny,

I just checked the list of active application from the Settings >
Systems > Activated Program.. Maybe you got the point, it does not show all
the current processes.

Actually i captured the onClosing Event in order to prompt users whether
they are "intentionally" stopping the program, as my application is the
"root" application of the device, when device is on, it must be on and users
should not leave the application. So back to the XDA situation, it
"incidentally" prompt dialog when ActiveSync or Camera happens. I guess if i
dun trap the OnClosing, my application will be killed already.

is there any way for me to check in my onClosing method, whether it is
triggered by OS purging excess process rather than user's explicit action?

Thx

Alex
 
G

Ginny Caughey [MVP]

Alex,

I don't know of a generic way to tell how OnClosing got called (unless when
you invoke it yourself programmatically you put something in EventArgs). I
assume your app would close anyway if the OS is doing it, but you could test
this and see if that is the case.
 
A

Alex

Hi All and Ginny,

After searching in other sites, i found that XDA or more precisely
Windows Mobile Edition got memory handling problem (if not bugs)

Quoted from other developers facing similar problem
(http://forum.xda-developers.com/viewtopic.php?t=3477)

"Situtation: if you load programms and get over 16mb of used memory
for programms at the shared memory pool of your device, the device
(here especially MDA/XDA II) starts closing programms until it gets
under 16 mb again, it doesn't matter, if your device has 128 Mb free,
or you moved the slider at memory configuration to the left, so the
programm memory is > 80 MB)"

Anyone faced similar problem? Any solution?

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top