Brew

  Home  Smartphone OS  Brew


“Brew job preparation guide for freshers and experienced candidates. Number of Brew frequently asked questions(FAQs) asked in many interviews”



78 Brew Questions And Answers

21⟩ How to debug output on emulator and phone?

When an application is running on the BREW Emulator, DBGPRINTF outputs messages to the Visual C++ Debug Window. Currently, DBGPRINTF messages are not available while running on a phone. Support for outputting debug messages to a host PC via serial connection is under development.

 182 views

23⟩ What guidelines should be followed when compiling an application in Thumb mode?

The function AEEMod_Load() must be moved to a different source file and this file must be compiled in ARM mode. AEEMod_Load() must always be compiled in ARM mode.

All files that are compiled in thumb mode MUST have the INTERWORK compiler option turned on. If this option is NOT turned on in the make file, the app will very likely crash.

 198 views

27⟩ Can we link to Windows DLLs from the SDK?

No. You should treat the SDK as a fully integrated stand-alone platform, which includes avoiding the C Standard Libraries. BREW has provided a port of the most common functions.

 193 views

28⟩ On what devices is BREW supported?

Currently, support for BREW is only available for devices based on the following QUALCOMM chipsets: MSM3100, MSM3300, MSM5000, MSM5100, and MSM5105. In addition, for a particular phone or other device to support BREW, it must be "BREW enabled" with a version of the BREW runtime provided by the device's manufacturer.

 165 views

29⟩ What difference is there between using the phones "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.

 212 views

31⟩ How to 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.

 176 views

34⟩ When making a voice call using ITAPI_MakeVoiceCall, responding No to the Privacy Alert hangs the application. What is the workaround?

This is a bug in BREW SDK version 1.0.1, and will be fixed in an upcoming release.

The recommended workaround for BREW SDK Version 1.0.1 is for the user to press 'No' twice (i.e. press Select Key twice). When the Privacy Alert Yes/No dialog is displayed, all key events up until the first Select key press go to the Dialog. After the first Select key (for the dialog), subsequent key events go to the application.

Steps are outlined below:

Added a boolean 'madeVoiceCall' in the Applet structure

If ITAPI_MakeVoiceCall() returns Success, set madeVoiceCall to TRUE

retValue = ITAPI_MakeVoiceCall(pMe->p_tapi, PHONE_NUM,

AEECLSID_SAMPLEAPP);

ITAPI_Release(pMe->p_tapi);

if(retValue == SUCCESS) {

pMe->madeTapiCall = TRUE;

}

Handle EVT_KEY in the app handler function. If the Select key was pressed and madeVoiceCall is TRUE, the user has selected No in response to the Privacy Alert. Set madeVoiceCall = FALSE and redraw screen.

case EVT_KEY:

if (wParam == AVK_SELECT && pMe->madeTapiCall ==

TRUE) {

// Redraw screen

pMe->madeTapiCall = FALSE;

}

return TRUE;

If the user selected 'Yes' to the Privacy Alert, the application would have been suspended. When resumed, the madeVoiceCall flag must be cleared.

case EVT_APP_RESUME:

if(pMe->madeTapiCall == TRUE) {

pMe->madeTapiCall = FALSE;

}

… … …

… … …

return TRUE;

 179 views

35⟩ After making a voice call using ITAPI_MakeVoiceCall, why does my application seem to be restarted when I respond No to the "Return to Application" prompt?

Make sure that the parameter clsReturn (application to start when the call ends) in the call to ITAPI_MakeVoiceCall is 0 (zero). If you specify clsReturn as your app's Class ID, then BREW tries to create another instance of your app, rather than resume your app.

 237 views

36⟩ What guidelines should follow when making a voice call immediately after a data call?

After the last socket is released, BREW waits for the network linger time (default linger time is 30s) to expire before terminating the PPP connection. The actual tearing down of the PPP connection takes about 3s. Therefore, (linger time + 3 seconds) must elapse between releasing the last socket and invoking ITAPI_MakeVoiceCall(). You should introduce a (linger time + 3 seconds) timer between releasing the last socket and making the voice call.

For example:

ReleaseNetAndSocket(pMe);

//LINGER_TIME below is in seconds

ISHELL_SetTimer(pMe->a.m_pIShell, (LINGER_TIME +3) * 1000,

Timer_CB, (void *)pMe);

In the timer callback code, you can make the voice call using ITAPI_MakeVoiceCall().

 205 views

38⟩ How to obtain the phone number of the device on which my application is running?

An application can obtain the phone number of the device on which it is running by calling ITAPI_GetStatus(). The phone number is in TAPIStatus.szMobileID.

For example:

TAPIStatus tapiStat;

if (ITAPI_GetStatus(pMe->p_tapi, &tapiStat) == EBADPARM) {

DisplayOutput((IApplet*)pMe, 6, "TAPI Status fetch failed");

}

DisplayOutput((IApplet*)pMe, 4, "Mobile ID:");

DisplayOutput((IApplet*)pMe, 5, tapiStat.szMobileID);

 219 views

39⟩ When will BREW offer HTTP Support?

HTTP Support is available through the AEEWeb interface in version 1.1 of the BREW SDK and above. With earlier versions of the SDK, use the ISocket interface to connect to a server's HTTP port, and send HTTP "get" and "post" requests.

 184 views

40⟩ Why does GetHostByName() not work on my phone?

For INETMGR_GetHostByName() to function correctly, the phone's Domain Name Server (DNS) settings must be properly configured. This is generally taken care of by the Service Provider, in which case the phone should be returned to the place of purchase, or an authorized service center so that its DNS settings can be properly configured.

 182 views