The largest Interview Solution Library on the web


Interview Questions
« Previous | 0 | 1 | 2 | 3 | 4 | Next »

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.
For example:

while(len) {
ITEXTCTL_HandleEvent(pMe->m_pIText, EVT_KEY,
AVK_RIGHT, dwParam);
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.
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.
For example:

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.
Use IDISPLAY_MeasureText() to determine the pixel width of your application name string. Use ISHELL_GetDeviceInfo() to determine the pixel width of the screen

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

BREW SDK Version 1.1 has added support for BREW Compressed Image (BCI) animation. A BCI file contains one or more compressed small graphic image(s), each with a specified duration in milliseconds. The duration represents how long you want each image to be shown before it is replaced by the next image in the series. You can use the BCI Authoring Tool included in BREW SDK Version 1.1 to create your BCI file. Please refer to 'Using the BREW Compressed Image Authoring Tool' document included in the SDK for more information.

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.
The default text entry mode is Multi-tap. T9 text entry mode is not supported on the emulator.

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.
The definitions of these two IDISPLAY macros are below. To draw a line in a color other than black, use the code contained in the macro definition and change to the desired fill color.

#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.
Note: If a bmp file is being used, make sure that the bmp format is supported and that the bmp file is a valid full path, all in lowercase.

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:

  • Associate the soft key menu with your text control using ITEXTCTL_SetSoftKey().
  • Call IMENUCTL_DeleteAll() to delete the Multitap item.
  • Add items using IMENUCTL_AddItem().

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: .,@:!?/.
To allow a greater breadth of symbol entry in your text control, you must associate your text control to a soft key menu using ITEXTCTL_SetSoftKeyMenu(). The set of symbols available using this method are:
-.&'()_!?*#%":+<>=¿¡""/\@,~{}$[]^;.
ITEXTCTL_SetSoftKeyMenu() adds an item to the Soft Key menu that allows the user to change the text entry mode (the text string for this item is the currently selected mode - for example, MultiTap). When it receives this command, the text control displays a menu allowing the user to select the new text entry mode. After the user selects the new mode, the text control is reactivated and the user may continue to enter text. When entering text, the user may press the Select Key to leave text-edit mode and activate the SoftKey Menu. While the Soft Key menu is active, the user may press the UP key to return to edit mode without making a menu selection.
The following is an example of how to allow multiple input modes in your text control:

// 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:

  • 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.

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:
TAPI (Class ID: 0x01001007)
NMASK_TAPI_STATUS
0x0001
TAPI Status change event
NMASK_TAPI_SMS_TEXT
0x0002
Incoming SMS
NMASK_TAPI_SMS_TS
0x0004
SMS message on specific Teleservice ID
INETMGR
NMASK_OPENED
0x0001
Network layer is available
NMASK_CLOSED
0x0002
Network layer is closed
NMASK_IDLE
0x0004
Network layer available and idle
Note: INETMGR NMASK_UDP_LISTEN has been deprecated and does not work.
An app can also register to receive notifications from other dynamic apps and modules.

« Previous | 0 | 1 | 2 | 3 | 4 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com