61.What is the transparent color on color and monochrome phones?Magenta is the transparent color for color devices. White is the transparent color on monochrome and 4-level gray-scale devices. 62.How can we move the cursor to the end of the text input?The cursor can be moved to the end of the string by continuously invoking ITEXTCTL_HandleEvent() method n times on the string, where n is the length of the string. while(len) {
Note: This does not currently work on the Kyocera 3035, unless dwParam is set to 10 (corresponds to AVK_RIGHT). Kyocera is working on fixing this issue such that dwParam will not need to be explicitly set. Setting dwParam = 10 will not have any adverse affect on the Sharp Z-800 handset.ITEXTCTL_HandleEvent(pMe->m_pIText, EVT_KEY, AVK_RIGHT, dwParam); len--; } A new API - ITEXTCTL_SetCursorPos(), will be added in BREW SDK version 1.2 to set the Text Control's cursor position. 63.How can we create a text control with horizontal and vertical scrollbars?If the text is larger than the Text Control size, then a vertical or horizontal scrollbar will appear and you can navigate through the text using the directional keys. 64.Why do we get memory errors such as "memheap.c 0696" when using IDISPLAY_BitBlt() to draw a bitmap image?Ensure that you are freeing the memory allocated by CONVERTBMP. Check the last Boolean parameter of CONVERTBMP. If True, a reallocation was done and the memory must be freed using SYSFREE. pBmp = CONVERTBMP (pDataBytes, &imageInfo, &bVal);
IDISPLAY_BitBlt (pIDisplay, xDest, yDest, cxDest, cyDest, pBmp, xSrc, ySrc, dwRopCode); IDISPLAY_Update (pIDisplay); if(bVal) //free only if realloc was done SYSFREE (pBmp); 65.How can we suppress the title area from showing on my IStatic?The title area cannot currently be suppressed in SDK version 1.0. This has been added in BREW version 1.1. 66.How can we determine the character limit for the display of application names on the phone?Different phones have different display characteristics, so there is no unique answer to this question. You can determine whether your application name will fit on the phone's display by comparing the width of the application name to the width of the display. 67.Does BREW support animation?BREW SDK version 1.0 includes support for animated BMP. This is done by placing the frames side-by-side and specifying the width of each frame with IIMAGE_SetParm with the IPARM-CXFRAME flag. Please see the IIMAGE example in the Examples directory 68.How can we control animation by time?One way to do this is to use the IImage interface and set the rate of animation (IImage_SetParm). An example in which the animation rate is set to 750ms is shown below: IIMAGE_SetParm(pMe->m_pIImage, IPARM_RATE, 750, 0);
You can also use a timer to trigger the image display function. Use ISHELL_SetTimer() to set a timer: ISHELL_SetTimer(pMe->a.m_pIShell, TIMER_RATE,
(PFNNOTIFY)(ManipulateBitmap), pMe);
After TIMER_RATE ms expires, ManipulateBitmap function will be triggered, within which you can manipulate your image.
69.What is the difference between Multi-tap and T9 text entry modes for text input?In Multi-tap mode, a key must be tapped several times in order to specify a letter. For example, to specify the letter 'r', tap the number '7' three times. In T9 mode, a key is tapped only once per letter. T9 Text Input determines the most commonly used word matching the input numeric sequence. If more than once word matches the sequence, the most common word is selected, with the ability to scroll to the next most commonly used word. 70.How can we draw a line in a specific color?IDISPLAY_DrawHLine() and IDISPLAY_DrawVLine() always draw lines in black. Therefore setting CLR_USER_LINE to the desired color and then invoking IDISPLAY_DrawHLine() or IDISPLAY_DrawVLine() will not work. #define IDISPLAY_DrawHLine(p,x,y,len) \
{AEERect rc;SETAEERECT(&rc,(x),(y),(len),1); IDISPLAY_FillRect((p),&rc, RGB_BLACK);} #define IDISPLAY_DrawVLine(p,x,y,len) \ {AEERect rc;SETAEERECT(&rc,(x),(y),1,(len)); IDISPLAY_FillRect((p),&rc, RGB_BLACK);} 71.How can we create a dialog?Use the BREW Resource Editor to create a dialog. You can also construct the dialog manually by creating data structures in your application to define the contents of the dialog. Once the dialog has been created, it will have a resource ID and a resource file (.bar file). Use ISHELL_CreateDialog() to create the dialog:
ISHELL_CreateDialog(pMe->a.pIShell, SAMPLEAPP_RES_FILE, RESOURCE_ID, NULL); // SAMPLEAPP_RES_FILE is the resource file (.bar file) and // RESOURCE_ID is the resource ID specified in the resource // editor Process the following events (return TRUE at the very least) in the app handler function:
case EVT_DIALOG_START: return TRUE; case EVT_DIALOG_INIT: return TRUE; case EVT_DIALOG_END: return TRUE; Call ISHELL_EndDialog when the dialog object is no longer needed.
ISHELL_EndDialog(pMe->a.pIShell);
72.How can we create a scroll bar if menu is larger than the screen size?The screen rectangle in which the menu is to be drawn (specified by IMENUCTL_SetRect) must exceed the screen height by at least the height of a single menu item. Otherwise the menu item will be clipped and no scroll bar will appear. 73.How cancwe add images to the items in an IMENUCTL?We can use the IMENUCTL_AddItemEx method with CtlAddItem structure. 74.Can we remove the multitap item from the softkey menu associated with my text control?Yes, We can remove it by following the steps outlined below:
75..Is it possible to get/manipulate the palette information of the device?No. The palettes are hard-coded by the vendor and will vary from device to device. 76.Can we modify the display buffers directly?No. There is no way for BREW to access these and the display data is stored as the vendor's proprietary format. 77.How do we allow the input of symbols in my text control?Certain limited symbol entry is available by pressing a certain key (usually 1) multiple times. This set of symbols is OEM dependent. On the Kyocera 3035, the following symbols are available by pressing the '1' key multiple times: .&@,-':;?/"(). On the Sharp Z- 800, the following symbols are available by pressing the 1 key multiple times: .,@:!?/. // Create text control
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_TEXTCTL, (void **)&pMe->m_pIText); if (pMe->m_pIText) { // Create soft key menu ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_SOFTKEYCTL, (void **)&pMe->m_pISoftKey); if (!pMe->m_pISoftKey) { ITEXTCTL_Release (pMe->m_pIText); pMe->m_pIText = NULL; return FALSE;
} } else { return FALSE; } // Set the soft key menu rectangle IMENUCTL_SetRect(pMe->m_pISoftKey, &softKeyRect); // Set text control title, size, properties, rectangle ITEXTCTL_SetTitle(pMe->m_pIText, NULL, NULL, titleString); ITEXTCTL_SetMaxSize(pMe->m_pIText, 100); ITEXTCTL_SetProperties(pMe->m_pIText, TP_FRAME | TP_MULTILINE ); ITEXTCTL_SetRect(pMe->m_pIText, &rect); // Initialize the softkey menu of the text control. ITEXTCTL_SetSoftKeyMenu (pMe->m_pIText, pMe->m_pISoftKey); // Set both the soft key and text control active. IMENUCTL_SetActive(pMe->m_pISoftKey,TRUE); ITEXTCTL_SetActive (pMe->m_pIText, TRUE); In the app's HandleEvent function, you must handle the EVT_KEY and EVT_COMMAND events as follows: case EVT_COMMAND: // Process EVT_COMMAND event - change of input mode if((pMe->m_pIText != NULL) && ITEXTCTL_HandleEvent(pMe->m_pIText, eCode, wParam, dwParam)) { return TRUE; } return FALSE;
case EVT_KEY: if ((pMe->m_pIText != NULL) && ITEXTCTL_HandleEvent(pMe->m_pIText, EVT_KEY, wParam, dwParam)) { //Event handled by text control return TRUE; } if(pMe->m_pISoftKey != NULL && IMENUCTL_HandleEvent( pMe->m_pISoftKey, EVT_KEY, wParam, dwParam)) { //Event handled by menu control return TRUE; } return FALSE; 78.What difference is there between using the phone's "End" key to close an applet, and using the "Clear" key to close an applet?An OEM of a particular device (phone) designates key(s) for the following two activities:
case AVK_CLR:
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.
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; } 79.How do I deal with a Low Battery Warning?BREW sends the running application an EVT_APP_SUSPEND event in the case of a Low Battery Warning. In order to handle low battery condition, you must correctly handle EVT_APP_SUSPEND and EVT_APP_RESUME events. 80.What notification events can an app register for?An app can register for the following System notifications: |