Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

hey,

is there a way not to close the application when clicking the END button?

let's say i want certain events to occur after clicking the END button (e.g. socket communication, wait for server response) can't i close the application only after receiving a callback?

i tried returning FALSE in the EVT_APP_STOP, but it still closes the application...

any suggestions?

Did you look into ISHELL_OnAppClose or ISHELL_OnExit function?
ruben

Did you look into ISHELL_OnAppClose or ISHELL_OnExit function?
ruben

I can't find it in the 2.0.1 Docs, where is it?

I can't find it in the 2.0.1 Docs, where is it?

It will be under IShell interface.
ruben

It will be under IShell interface.
ruben

are you sure that on v2.0.1 in the IShell interface there should be ISHELL_OnAppClose or ISHELL_OnExit? I can't find either, maybe you're looking in a different version of BREW API reference?
Besides, these functions can make the application not end with a certain implementation? because if they are called and then the application closes they won't help me anyway...

are you sure that on v2.0.1 in the IShell interface there should be ISHELL_OnAppClose or ISHELL_OnExit? I can't find either, maybe you're looking in a different version of BREW API reference?
Besides, these functions can make the application not end with a certain implementation? because if they are called and then the application closes they won't help me anyway...

These are there in v2.0.1 API ref guide only.
May be you just overlooked it. :D
- RR

These are there in v2.0.1 API ref guide only.
May be you just overlooked it. :D
- RR

found it eventually... why is it in the SDK docs only and not in the API Help? (looked for it there...)
how do i use it? just implementing the ISHELL_OnAppClose function doesn't compile... do i have to register it first or something?
anyway, how does that help me? I want the application not to close after you click END, because i need to finish communication with my server...
my question again: how do i prevent the application from closing after someone clicks END? let's say i want to tell the server that I'm closing the application. how do i do it?
Thanks.

found it eventually... why is it in the SDK docs only and not in the API Help? (looked for it there...)
how do i use it? just implementing the ISHELL_OnAppClose function doesn't compile... do i have to register it first or something?
anyway, how does that help me? I want the application not to close after you click END, because i need to finish communication with my server...
my question again: how do i prevent the application from closing after someone clicks END? let's say i want to tell the server that I'm closing the application. how do i do it?
Thanks.

ok, i understood how to use it... silly me...
but lamentably, it doesn't help...
i need the END button not to quit until a response from the server is received. is it possible?

ok, i understood how to use it... silly me...
but lamentably, it doesn't help...
i need the END button not to quit until a response from the server is received. is it possible?

Quote:Originally posted by kalisky
i tried returning FALSE in the EVT_APP_STOP, but it still closes the application...
You need to cast the dwParam to a boolean pointer, dereference it, and toggle the value. Your HandleEvent function should return TRUE, since you are handling the event. This will cause your app to go into the background.

Quote:Originally posted by kalisky
i tried returning FALSE in the EVT_APP_STOP, but it still closes the application...
You need to cast the dwParam to a boolean pointer, dereference it, and toggle the value. Your HandleEvent function should return TRUE, since you are handling the event. This will cause your app to go into the background.

wow! that sounds like something that might work, great, thanks!
how do i dereference the Bool pointer?
let's say i do this:
case EVT_APP_STOP:
{
BOOL *b = (BOOL*) dwParam;
... (What comes here?)
*b = !(*b);
return TRUE;

and again - thanks.

wow! that sounds like something that might work, great, thanks!
how do i dereference the Bool pointer?
let's say i do this:
case EVT_APP_STOP:
{
BOOL *b = (BOOL*) dwParam;
... (What comes here?)
*b = !(*b);
return TRUE;

and again - thanks.

me again...
i guess what you meant by dereferencing was the "*" itself... i thought you meant reduce the reference count or something...
another question, what exactly does that boolean mean?
what do i do when I _do_ want the application to close, after I'm really done (to stop running in the background)?
thanks.

me again...
i guess what you meant by dereferencing was the "*" itself... i thought you meant reduce the reference count or something...
another question, what exactly does that boolean mean?
what do i do when I _do_ want the application to close, after I'm really done (to stop running in the background)?
thanks.

and another question: how did you hear about this bool? where could i have read about it?
thanks.

and another question: how did you hear about this bool? where could i have read about it?
thanks.

Quote:Originally posted by kalisky
i guess what you meant by dereferencing was the "*" itself...
Yes, that's what I meant.
Quote:another question, what exactly does that boolean mean?
It's just a means for the app to tell BREW that it does not want to close.
Quote:what do i do when I _do_ want the application to close, after I'm really done (to stop running in the background)?
ISHELL_CloseApplet().
Quote:and another question: how did you hear about this bool? where could i have read about it?
It's in the BREW API Reference. Data Types->AEE Events->EVT_APP_STOP. (This is a 2.0 feature, so you won't find it if you are looking at an older API Reference.)

Quote:Originally posted by kalisky
i guess what you meant by dereferencing was the "*" itself...
Yes, that's what I meant.
Quote:another question, what exactly does that boolean mean?
It's just a means for the app to tell BREW that it does not want to close.
Quote:what do i do when I _do_ want the application to close, after I'm really done (to stop running in the background)?
ISHELL_CloseApplet().
Quote:and another question: how did you hear about this bool? where could i have read about it?
It's in the BREW API Reference. Data Types->AEE Events->EVT_APP_STOP. (This is a 2.0 feature, so you won't find it if you are looking at an older API Reference.)

are you sure NSTL is going to let you do this? Probably better to ensure that your app and server are robust enough to handle the other side disappearing suddenly....there are so many ways that can happen with a mobile phone (battery runs out, phone is dropped, phone does in a deadzone, phone is flipped closed, etc).
-Aaron

are you sure NSTL is going to let you do this? Probably better to ensure that your app and server are robust enough to handle the other side disappearing suddenly....there are so many ways that can happen with a mobile phone (battery runs out, phone is dropped, phone does in a deadzone, phone is flipped closed, etc).
-Aaron