InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What Is The Size Limit For An Applet? |
|
Answer» The size of a BREW applet is limited by the amount of free file system space that is available, and by the amount of available RAM. BREW applets, when executed, are loaded into RAM; any RAM left over can be used for memory ALLOCATION, loading resources, creating controls, etc. How much RAM is available depends on the type of phone, and its configuration. On a QCP-3035, for instance, the available RAM is 90K, 30K of which belongs to BREW and other phone related tasks, leaving 60K available for use by an applet. The memory available on each of the phones running BREW is available here. Another limiting factor for applet size is heap fragmentation. If the largest available memory block is smaller than the size of the applet, then the applet will not be loaded. Use IHEAP_CheckAvail() to determine whether a memory block of sufficient size can be allocated. IHEAP_GetMemStats() can be used to determine the amount of RAM already used. If you have an applet that is too large for a particular device, a work-around is to split the APPLICATION into multiple applets. Memory Allocation provides more information on how to avoid heap fragmentation. NOTE: In order test a low memory condition on the BREW Emulator reduce the heap size in the Device Configuration file by the appropriate amount. BREW's System Info screen REPORTS the amount of available flash memory, not the amount of available RAM. The size of a BREW applet is limited by the amount of free file system space that is available, and by the amount of available RAM. BREW applets, when executed, are loaded into RAM; any RAM left over can be used for memory allocation, loading resources, creating controls, etc. How much RAM is available depends on the type of phone, and its configuration. On a QCP-3035, for instance, the available RAM is 90K, 30K of which belongs to BREW and other phone related tasks, leaving 60K available for use by an applet. The memory available on each of the phones running BREW is available here. Another limiting factor for applet size is heap fragmentation. If the largest available memory block is smaller than the size of the applet, then the applet will not be loaded. Use IHEAP_CheckAvail() to determine whether a memory block of sufficient size can be allocated. IHEAP_GetMemStats() can be used to determine the amount of RAM already used. If you have an applet that is too large for a particular device, a work-around is to split the application into multiple applets. Memory Allocation provides more information on how to avoid heap fragmentation. Note: In order test a low memory condition on the BREW Emulator reduce the heap size in the Device Configuration file by the appropriate amount. BREW's System Info screen reports the amount of available flash memory, not the amount of available RAM. |
|
| 52. |
How Does The Memory Architecture In Brew Work? |
|
Answer» BREW device has Flash RAM and Heap RAM. You can TREAT Flash RAM as a HARD drive. Programs are stored there, but not run from it. You can treat Heap RAM as you would always treat a memory heap. Say you have an application that is 35k in size. This will take 35k from the Flash RAM to store on the device. When the application is run, the 35k will be loaded into Heap RAM in its ENTIRETY plus however much Heap RAM it needs to ALLOCATE. When the applet is released, this Heap RAM is freed. It will still occupy SPACE on the Flash RAM until it is removed from the device. BREW device has Flash RAM and Heap RAM. You can treat Flash RAM as a hard drive. Programs are stored there, but not run from it. You can treat Heap RAM as you would always treat a memory heap. Say you have an application that is 35k in size. This will take 35k from the Flash RAM to store on the device. When the application is run, the 35k will be loaded into Heap RAM in its entirety plus however much Heap RAM it needs to allocate. When the applet is released, this Heap RAM is freed. It will still occupy space on the Flash RAM until it is removed from the device. |
|
| 53. |
Why Does The Emulator Display A Blank Screen With My Application's Name When My Application Exits? |
|
Answer» Problem: When an application exits while running on the EMULATOR, instead of returning to the main menu SCREEN, a blank screen is DISPLAYED with the application NAME in the upper left corner. This behavior is caused by not freeing all allocated memory before exiting the application. Any buffer you allocate using MALLOC or IHEAP_Malloc() must be freed using FREE or IHEAP_Free(). For any instance of a BREW class that you create, you must call the corresponding release function to free that instance. Problem: When an application exits while running on the emulator, instead of returning to the main menu screen, a blank screen is displayed with the application name in the upper left corner. This behavior is caused by not freeing all allocated memory before exiting the application. Any buffer you allocate using MALLOC or IHEAP_Malloc() must be freed using FREE or IHEAP_Free(). For any instance of a BREW class that you create, you must call the corresponding release function to free that instance. |
|
| 54. |
What Is An "swi Exception?" |
|
Answer» An "SWI EXCEPTION" is usually related to heap memory mismanagement. The most common CAUSES of heap memory corruption are: OVERWRITING the bounds of your allocated ARRAYS, freeing objects more than once, and writing to wild or NULL pointers. In addition to the more common causes, stack overrun can also lead to SWI Exceptions. Note: It is recommended that large buffers be allocated on the heap rather than on the stack as automatic variables. An "SWI Exception" is usually related to heap memory mismanagement. The most common causes of heap memory corruption are: overwriting the bounds of your allocated arrays, freeing objects more than once, and writing to wild or NULL pointers. In addition to the more common causes, stack overrun can also lead to SWI Exceptions. Note: It is recommended that large buffers be allocated on the heap rather than on the stack as automatic variables. |
|
| 55. |
What Is A "pref Abort Exception? |
|
Answer» "A "Pref Abort EXCEPTION" usually indicates that memory important to the phone operating system has been trashed. The two most common causes of this exception are DATA CORRUPTION (i.e. RUNNING off the end of an array), and STACK overruns. "A "Pref Abort Exception" usually indicates that memory important to the phone operating system has been trashed. The two most common causes of this exception are data corruption (i.e. running off the end of an array), and stack overruns. |
|
| 56. |
What Is A "re-entrant Data Abort? |
|
Answer» "The "Re-entrant Data Abort" EXCEPTION is often caused by stack overrun. When an applet is running on the phone the stack size is small, and you are more likely to see stack overrun problems than when running on the emulator. Solutions to this PROBLEM are reducing the size or NUMBER of objects on the stack, and using objects allocated on the heap instead of automatic variables. NOTE: Version-related incompatibilities between applet code and the BREW image on the phone can also lead to this type of exception. "The "Re-entrant Data Abort" exception is often caused by stack overrun. When an applet is running on the phone the stack size is small, and you are more likely to see stack overrun problems than when running on the emulator. Solutions to this problem are reducing the size or number of objects on the stack, and using objects allocated on the heap instead of automatic variables. Note: Version-related incompatibilities between applet code and the BREW image on the phone can also lead to this type of exception. |
|
| 57. |
How To Recover The Phone From An "undefined Exception"? |
|
Answer» "Undef Inst Exception" stands for "undefined instruction exception," and means that the program POINTER has JUMPED to a code segment that contains an undefined instruction. This can be the RESULT of memory corruption, a stack overrun, or version-related incompatibilities between applet code and the BREW image on the phone. Memory is tighter on the phone than when running on the emulator. Therefore, memory and stack overrun problems will be more likely to show up on the phone. You should double check memory related areas of your code, especially auto variable ARRAYS and the maximum total size of allocated memory. To clear the phone, pull the battery out for a few seconds. "Undef Inst Exception" stands for "undefined instruction exception," and means that the program pointer has jumped to a code segment that contains an undefined instruction. This can be the result of memory corruption, a stack overrun, or version-related incompatibilities between applet code and the BREW image on the phone. Memory is tighter on the phone than when running on the emulator. Therefore, memory and stack overrun problems will be more likely to show up on the phone. You should double check memory related areas of your code, especially auto variable arrays and the maximum total size of allocated memory. To clear the phone, pull the battery out for a few seconds. |
|
| 58. |
How To Test Application For Proper Handling Of Suspend/resume Events On A Non- Provisioned Phone? |
|
Answer» On the Kyocera 3035, you can test your app's handling of SUSPEND/Resume events by enabling automatic Keyguard (Main Menu->SETTINGS->Keyguard) before RUNNING your app. When the Keyguard kicks in, the running app will receive a Suspend Event. The app will receive Resume event when the screen is unlocked. On the SHARP Z-800, you can test your app's handling of Suspend/Resume events by setting the alarm to go off a few minutes in the future (Main Menu->Setup/Tools->Alarm->Daily Alarm) and then running the BREW app. Please NOTE that in order for the app to be suspended when the alarm goes off, BREW Priority Setting must be off (Main Menu->Setup/Tools->BREW Priority Setting). On the Kyocera 3035, you can test your app's handling of Suspend/Resume events by enabling automatic Keyguard (Main Menu->Settings->Keyguard) before running your app. When the Keyguard kicks in, the running app will receive a Suspend Event. The app will receive Resume event when the screen is unlocked. On the Sharp Z-800, you can test your app's handling of Suspend/Resume events by setting the alarm to go off a few minutes in the future (Main Menu->Setup/Tools->Alarm->Daily Alarm) and then running the BREW app. Please note that in order for the app to be suspended when the alarm goes off, BREW Priority Setting must be off (Main Menu->Setup/Tools->BREW Priority Setting). |
|
| 59. |
What Notification Events Can An App Register For? |
|
Answer» notifications:
notifications: |
|
| 60. |
What Is The Difference Between Ishell_sendevent() And Ishell_ Postevent()? |
|
Answer» XML is no way clashes with HTML, SINCE they are for two different purposes. ISHELL_SendEvent() :
ISHELL_PostEvent() :
XML is no way clashes with HTML, since they are for two different purposes. ISHELL_SendEvent() : ISHELL_PostEvent() : |
|
| 61. |
How Do I Deal With A Low Battery Warning? |
|
Answer» 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. 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. |
|
| 62. |
What Difference Is There Between Using The Phone's "end" Key To Close An Applet, And Using The "clear" Key To Close An Applet? |
|
Answer» A key, that when pressed, will CLOSE the current application. Most OEMs designate this to be the AVK_CLR key.
case AVK_CLR: if (pMe->OnMainMenu == TRUE) { A key, that when pressed, will close the current application. Most OEMs designate this to be the AVK_CLR key. case AVK_CLR: if (pMe->OnMainMenu == TRUE) { |
|
| 63. |
What Events Must An Applet Handle? |
|
Answer» In addition to the obvious EVT_APP_START and EVT_APP_STOP, your APPLET MUST support EVT_APP_SUSPEND and EVT_APP_RESUME in order to PASS True BREW TESTING. In addition to the obvious EVT_APP_START and EVT_APP_STOP, your applet must support EVT_APP_SUSPEND and EVT_APP_RESUME in order to pass True BREW Testing. |
|
| 64. |
On What Devices Is Brew Supported? |
|
Answer» 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. 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. |
|
| 65. |
Can We Link To Windows Dlls From The Sdk? |
|
Answer» 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. 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. |
|
| 66. |
Does Brew Support Multi-threading? |
|
Answer» BREW does not SUPPORT multi-threading. BREW does have support for COOPERATIVE multi-tasking. BREW does not support multi-threading. BREW does have support for cooperative multi-tasking. |
|
| 67. |
What Are The Operating System Requirements Of The Brew Sdk? |
|
Answer» DUE to the requirement for Unicode support, the SDK runs only on the MICROSOFT WINDOWS NT™ 4.0, Windows 2000™ and Windows XP™ PLATFORMS. Windows 98 is not supported by the BREW SDK. Due to the requirement for Unicode support, the SDK runs only on the Microsoft Windows NT™ 4.0, Windows 2000™ and Windows XP™ platforms. Windows 98 is not supported by the BREW SDK. |
|
| 68. |
What To Do If We Installed Arm Brew Builder Or Arm Development Suite Into A Path With Spaces? |
|
Answer» The solution is to modify your makefile in the following FASHION:
The solution is to modify your makefile in the following fashion: |
|
| 69. |
What Guidelines Should Be Followed When Compiling An Application In Thumb Mode? |
|
Answer» 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. 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. |
|
| 70. |
What Compilers Can Be Used To Compile Brew Applications? |
|
Answer» The ARM BREW Builder can be USED to COMPILE BREW APPLICATIONS. The ARM BREW Builder can be used to compile BREW applications. |
|
| 71. |
How To Debug Output On Emulator And Phone? |
|
Answer» 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. 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. |
|
| 72. |
How To Upload A Device Configurator File (.qsc) To A Phonethe ? |
|
Answer» The device configurator FILE (.qsc) is used by the BREW Emulator APPLICATION, and is not required to run applications on the PHONE. The device configurator file (.qsc) is used by the BREW Emulator application, and is not required to run applications on the phone. |
|
| 73. |
How To Compile An Application To Run On A Handset? |
|
Answer» To build applications for the PHONE requires the ARM Developer Suite of tools, which are used to compile and link a project that has been developed using the PC-based BREW SDK, and related tools. RUNNING an application built using the ARM tools requires a BREW-enabled phone, a data cable for establishing a SERIAL connection to the phone, and file copying SOFTWARE such as QUALCOMM's BREW AppLoader application. See How to Build a Downloadable BREW Application for more details. To build applications for the phone requires the ARM Developer Suite of tools, which are used to compile and link a project that has been developed using the PC-based BREW SDK, and related tools. Running an application built using the ARM tools requires a BREW-enabled phone, a data cable for establishing a serial connection to the phone, and file copying software such as QUALCOMM's BREW AppLoader application. See How to Build a Downloadable BREW Application for more details. |
|
| 74. |
How To Transfer Compiled Applications To A Phone? |
|
Answer» Use BREW AppLoader to upload applications to the phone. The following EXAMPLE shows files and locations for an application with the name " brewApp." /brew/ brewApp.mif
/brew/ brewApp/ brewApp.bar
/brew/ brewApp/ brewApp.mod
/brew/ brewApp/ brewApp.sig
All directory and file NAMES on the phone must be in lower case. Any additional files specific to your application may also be copied to the application directory, or subdirectories of the application directory. The Digital Signature file is generated using the BREW TestSig Generator, then renamed with the name of the application. The first part of the .sig filename must be the same as the first part of the .mod filename. After uploading files, reset the phone. Use BREW AppLoader to upload applications to the phone. The following example shows files and locations for an application with the name " brewApp." /brew/ brewApp.mif /brew/ brewApp/ brewApp.bar /brew/ brewApp/ brewApp.mod /brew/ brewApp/ brewApp.sig All directory and file names on the phone must be in lower case. Any additional files specific to your application may also be copied to the application directory, or subdirectories of the application directory. The Digital Signature file is generated using the BREW TestSig Generator, then renamed with the name of the application. The first part of the .sig filename must be the same as the first part of the .mod filename. After uploading files, reset the phone. |
|