What difference is there between using the phones "End" key to close an applet, and using the "Clear" key to close an applet?
Submitted by: AdministratorAn OEM of a particular device (phone) designates key(s) for the following two activities:
A key, that when pressed, will close the current application. Most OEMs designate this to be the AVK_CLR key.
A key, that when pressed, will close all applications. Most OEMs designate this to be the AVK_END key.
When AVK_END is pressed, BREW will immediately send EVT_APP_STOP to the active applet without first sending the AVK_END key. In addition, the FreeAppData() callback routine provided to AEEApplet_New() will be called prior to unloading the applet; no other events or callbacks will occur.
When AVK_CLR is pressed, BREW will first send this event to the applet. If the applet does not handle the event (i.e. returns FALSE in HandleEvent), only then BREW will close the application. In the implementation of your AVK_CLR handler, remember to also call FreeAppData as follows:
case AVK_CLR:
if (pMe->OnMainMenu == TRUE) {
// App is on main menu. Therefore pressing CLR key should cause app to exit
HelloWorld_FreeAppData(pi); //clean up
return FALSE; //return FALSE so that BREW will now close application
}
else { // Not on main menu.
// Therefore pressing CLR key should cause app to undo one level of menu
// nesting. Show previous menu in menu hierarchy
return TRUE;
}
Make sure that your FreeAppletData() properly cleans up all allocated memory and resources. All objects and interfaces created by CreateInstance, CreateDialog, MALLOC, etc., must have an associated call to Release or FREE.
Submitted by: Administrator
A key, that when pressed, will close the current application. Most OEMs designate this to be the AVK_CLR key.
A key, that when pressed, will close all applications. Most OEMs designate this to be the AVK_END key.
When AVK_END is pressed, BREW will immediately send EVT_APP_STOP to the active applet without first sending the AVK_END key. In addition, the FreeAppData() callback routine provided to AEEApplet_New() will be called prior to unloading the applet; no other events or callbacks will occur.
When AVK_CLR is pressed, BREW will first send this event to the applet. If the applet does not handle the event (i.e. returns FALSE in HandleEvent), only then BREW will close the application. In the implementation of your AVK_CLR handler, remember to also call FreeAppData as follows:
case AVK_CLR:
if (pMe->OnMainMenu == TRUE) {
// App is on main menu. Therefore pressing CLR key should cause app to exit
HelloWorld_FreeAppData(pi); //clean up
return FALSE; //return FALSE so that BREW will now close application
}
else { // Not on main menu.
// Therefore pressing CLR key should cause app to undo one level of menu
// nesting. Show previous menu in menu hierarchy
return TRUE;
}
Make sure that your FreeAppletData() properly cleans up all allocated memory and resources. All objects and interfaces created by CreateInstance, CreateDialog, MALLOC, etc., must have an associated call to Release or FREE.
Submitted by: Administrator
Read Online Brew Job Interview Questions And Answers
Top Brew Questions
☺ | How to handle the case when we lose cellular coverage? |
☺ | What precautions should we take when I invoke INETMGR_GetHostByName() to perform DNS lookup? |
☺ | When reading from a socket the phone reads whatever it can in one go, while the emulator reads large packets in chunks. Why? |
☺ | Does BREW support blocking sockets? |
☺ | Why does ISHELL_CreateInstance return ECLASSNOTSUPPORT when I try and create an instance of the net manager (AEECLSID_Net)? |
Top Mobile OS Categories
☺ | iOS Interview Questions. |
☺ | Asha OS Interview Questions. |
☺ | Windows Phone (WP) Interview Questions. |
☺ | iOS Developer Interview Questions. |
☺ | BlackBerry Tablet OS Interview Questions. |