YouTube Icon

Interview Questions.

Top 100+ Brew (binary Runtime Environment For Wireless) Interview Questions And Answers - May 27, 2020

fluid

Top 100+ Brew (binary Runtime Environment For Wireless) Interview Questions And Answers

Question 1. How To Transfer Compiled Applications To A Phone?

Answer :

Use BREW AppLoader to add programs to the telephone. The following instance indicates files and locations for an software with the call " brewApp."

/brew/ brewApp.Mif

Generated by means of BREW MIF Editor.
/brew/ brewApp/ brewApp.Bar

Generated by BREW Resource Editor.
/brew/ brewApp/ brewApp.Mod

Compiled and related with ARM BREW Builder.
/brew/ brewApp/ brewApp.Sig

Digital Signature.
All listing and file names on the cellphone need to be in decrease case. Any additional documents unique for your software can also be copied to the utility directory, or subdirectories of the utility directory.

The Digital Signature report is generated the usage of the BREW TestSig Generator, then renamed with the name of the application. The first part of the .Sig filename have to be the same as the first a part of the .Mod filename.

After importing files, reset the cellphone.

Question 2. How To Compile An Application To Run On A Handset?

Answer :

To construct applications for the cellphone calls for the ARM Developer Suite of tools, that are used to collect and hyperlink a challenge that has been evolved the use of the PC-based BREW SDK, and associated tools. Running an software built the use of the ARM equipment requires a BREW-enabled smartphone, a information cable for establishing a serial connection to the cellphone, and report copying software including QUALCOMM's BREW AppLoader application. See How to Build a Downloadable BREW Application for more info.

Project Management Interview Questions
Question 3. How To Upload A Device Configurator File (.Qsc) To A Phonethe ?

Answer :

The tool configurator record (.Qsc) is utilized by the BREW Emulator utility, and isn't always required to run applications on the telephone.

Question 4. How To Debug Output On Emulator And Phone?

Answer :

When an software is jogging at the BREW Emulator, DBGPRINTF outputs messages to the Visual C++ Debug Window. Currently, DBGPRINTF messages are not available while strolling on a cellphone. Support for outputting debug messages to a bunch PC thru serial connection is underneath development.

Project Management Tutorial
Question five. What Compilers Can Be Used To Compile Brew Applications?

Answer :

The ARM BREW Builder can be used to compile BREW packages.

IBM-REXX Interview Questions
Question 6. What Guidelines Should Be Followed When Compiling An Application In Thumb Mode?

Answer :

characteristic AEEMod_Load() should be moved to a different supply report and this record have to be compiled in ARM mode. AEEMod_Load() need to constantly be compiled in ARM mode.

All documents which can be compiled in thumb mode MUST have the INTERWORK compiler alternative became on. If this feature is NOT turned on within the make report, the app will very in all likelihood crash.

Question 7. What To Do If We Installed Arm Brew Builder Or Arm Development Suite Into A Path With Spaces?

Answer :

The solution is to regulate your makefile in the following fashion:

Comment out the ARMBIN, ARMINC, and ARMLIB announcement.
Add the overall course to the ARMCC, LD, and HEXTOOL variables. Make sure you double quote the course.
IBM-REXX Tutorial Software Engineering Interview Questions
Question eight. What Are The Operating System Requirements Of The Brew Sdk?

Answer :

Due to the requirement for Unicode assist, the SDK runs only at the Microsoft Windows NT™ 4.0, Windows 2000™ and Windows XP™ structures. Windows ninety eight isn't always supported by using the BREW SDK.

Question nine. Does Brew Support Multi-threading?

Answer :

BREW does not support multi-threading. BREW does have help for cooperative multi-tasking.

Bada Mobile OS Interview Questions
Question 10. Can We Link To Windows Dlls From The Sdk?

Answer :

No. You should deal with the SDK as a completely incorporated stand-alone platform, which incorporates averting the C Standard Libraries. BREW has supplied a port of the most commonplace capabilities.

Software Engineering Tutorial
Question 11. On What Devices Is Brew Supported?

Answer :

Currently, aid for BREW is simplest to be had for devices based on the subsequent QUALCOMM chipsets: MSM3100, MSM3300, MSM5000, MSM5100, and MSM5105. In addition, for a particular smartphone or other tool to guide BREW, it must be "BREW enabled" with a model of the BREW runtime provided by way of the tool's manufacturer.

Symbian Interview Questions
Question 12. What Events Must An Applet Handle?

Answer :

In addition to the plain EVT_APP_START and EVT_APP_STOP, your applet must support EVT_APP_SUSPEND and EVT_APP_RESUME which will bypass True BREW Testing.

Project Management Interview Questions
Question thirteen. What Difference Is There Between Using The Phone's "quit" Key To Close An Applet, And Using The "clear" Key To Close An Applet?

Answer :

A key, that once pressed, will near the cutting-edge application. Most OEMs designate this to be the AVK_CLR key.

A key, that after pressed, will near all packages. Most OEMs designate this to be the AVK_END key.
When AVK_END is pressed, BREW will straight away ship EVT_APP_STOP to the active applet without first sending the AVK_END key. In addition, the FreeAppData() callback habitual provided to AEEApplet_New() will be called previous to unloading the applet; no different activities or callbacks will arise.
When AVK_CLR is pressed, BREW will first ship this occasion to the applet. If the applet does no longer handle the event (i.E. Returns FALSE in HandleEvent), best then BREW will close the software. In the implementation of your AVK_CLR handler, take into account to also name FreeAppData as follows:
case AVK_CLR:

if (pMe->OnMainMenu == TRUE) 
// App is on most important menu. Therefore pressing CLR key must motive app to go out
HelloWorld_FreeAppData(pi); //smooth up
return FALSE; //go back FALSE in order that BREW will now near software

else  // Not on foremost menu.
// Therefore pressing CLR key should motive app to undo one degree of menu
// nesting. Show previous menu in menu hierarchy
go back TRUE;

Make certain that your FreeAppletData() nicely cleans up all allotted memory and assets. All gadgets and interfaces created through CreateInstance, CreateDialog, MALLOC, and many others., need to have an associated name to Release or FREE.

Question 14. How Do I Deal With A Low Battery Warning?

Answer :

BREW sends the jogging utility an EVT_APP_SUSPEND event in the case of a Low Battery Warning. In order to handle low battery situation, you must correctly take care of EVT_APP_SUSPEND and EVT_APP_RESUME activities.

Question 15. What Is The Difference Between Ishell_sendevent() And Ishell_ Postevent()?

Answer :

XML is not any manner clashes with HTML, on account that they are for 2 distinct purposes.

ISHELL_SendEvent() :

In the case of ISHELL_SendEvent(), the occasion is without delay sent to the application of the desired Class ID. If an instance of that elegance is not presently gift, the AEE Shell creates one, and then invokes its IAPPLET_HandleEvent() function with the required event code and statistics parameters. Unless it chooses to start itself, the utility terminates after it completes processing of the event.
The ISHELL_SendEvent() characteristic permits for manipulate over the vacation spot applet. This function sends the event without delay to the vacation spot applet.
ISHELL_PostEvent() :

ISHELL_PostEvent() is comparable, besides that the destination magnificence's IAPPLET_HandleEvent() feature is not referred to as at once. The event is located in a queue and is despatched at a later time, which permits the calling utility to maintain its processing without interruption.
The processing of activities published the usage of ISHELL_PostEvent() is deferred until the subsequent new release of the occasion loop. This is useful in offering persevered execution at the same time as allowing other events to be processed.
Question sixteen. What Notification Events Can An App Register For?

Answer :

notifications:

TAPI (Class ID: 0x01001007)
NMASK_TAPI_STATUS
0x0001
TAPI Status trade occasion
NMASK_TAPI_SMS_TEXT
0x0002
Incoming SMS
NMASK_TAPI_SMS_TS
0x0004
SMS message on particular Teleservice ID
INETMGR
NMASK_OPENED
0x0001
Network layer is available
NMASK_CLOSED
0x0002
Network layer is closed
NMASK_IDLE
0x0004
Network layer to be had and idleNote
Question 17. How To Test Application For Proper Handling Of Suspend/resume Events On A Non- Provisioned Phone?

Answer :

On the Kyocera 3035, you may take a look at your app's dealing with of Suspend/Resume activities with the aid of allowing automated Keyguard (Main Menu->Settings->Keyguard) before jogging your app. When the Keyguard kicks in, the going for walks app will receive a Suspend Event. The app will obtain Resume occasion when the display screen is unlocked.

On the Sharp Z-800, you may take a look at your app's handling of Suspend/Resume events by way of putting the alarm to head off a few minutes within the destiny (Main Menu->Setup/Tools->Alarm->Daily Alarm) and then strolling the BREW app. Please observe that in order for the app to be suspended while the alarm goes off, BREW Priority Setting should be off (Main Menu->Setup/Tools->BREW Priority Setting).

Question 18. How To Recover The Phone From An "undefined Exception"?

Answer :

"Undef Inst Exception" stands for "undefined education exception," and approach that the program pointer has jumped to a code segment that consists of an undefined practise. This may be the result of memory corruption, a stack overrun, or model-related incompatibilities among applet code and the BREW picture at the smartphone.

Memory is tighter at the phone than while going for walks on the emulator. Therefore, reminiscence and stack overrun problems can be much more likely to show up at the telephone. You need to double check memory related regions of your code, mainly vehicle variable arrays and the most general length of allotted reminiscence. To clean the cellphone, pull the battery out for a few seconds.

IBM-REXX Interview Questions
Question 19. What Is A "re-entrant Data Abort?

Answer :

"The "Re-entrant Data Abort" exception is frequently caused by stack overrun. When an applet is walking at the smartphone the stack size is small, and you are more likely to peer stack overrun issues than when walking on the emulator. Solutions to this trouble are decreasing the scale or number of objects at the stack, and the usage of items allocated on the heap instead of computerized variables.

Note: Version-related incompatibilities among applet code and the BREW photograph on the smartphone also can result in this form of exception.

Question 20. What Is A "pref Abort Exception?

Answer :

"A "Pref Abort Exception" commonly indicates that memory important to the phone running machine has been trashed. The  maximum not unusual causes of this exception are records corruption (i.E. Jogging off the end of an array), and stack overruns.

Question 21. What Is An "swi Exception?"

Answer :

An "SWI Exception" is generally related to heap memory mismanagement. The maximum common reasons of heap memory corruption are: overwriting the boundaries of your allotted arrays, releasing items extra than once, and writing to wild or NULL recommendations. In addition to the more commonplace causes, stack overrun can also result in SWI Exceptions.

Note: It is recommended that huge buffers be allotted at the heap rather than on the stack as automatic variables.

Question 22. Why Does The Emulator Display A Blank Screen With My Application's Name When My Application Exits?

Answer :

Problem: When an application exits whilst going for walks on the emulator, rather than returning to the main menu screen, a blank display is displayed with the application name in the top left nook.

This behavior is because of not liberating all allocated reminiscence before exiting the application. Any buffer you allocate the usage of MALLOC or IHEAP_Malloc() ought to be freed the use of FREE or IHEAP_Free(). For any instance of a BREW class which you create, you must call the corresponding launch function to loose that example.

Question 23. How Does The Memory Architecture In Brew Work?

Answer :

BREW device has Flash RAM and Heap RAM. You can deal with Flash RAM as a tough force. Programs are saved there, but now not run from it. You can deal with Heap RAM as you will always deal with a reminiscence heap. Say you have an application this is 35k in size. This will take 35k from the Flash RAM to keep at the tool. When the utility is administered, the 35k will be loaded into Heap RAM in its entirety plus however much Heap RAM it wishes to allocate. When the applet is released, this Heap RAM is freed. It will nevertheless occupy space at the Flash RAM till it's far removed from the device.

Question 24. What Is The Size Limit For An Applet?

Answer :

The size of a BREW applet is limited by using the amount of loose report gadget area that is to be had, and by using the quantity of to be had RAM.

BREW applets, whilst completed, are loaded into RAM; any RAM left over may be used for reminiscence allocation, loading assets, developing controls, etc. How a whole lot RAM is to be had relies upon on the type of cellphone, and its configuration. On a QCP-3035, as an instance, the to be had RAM is 90K, 30K of which belongs to BREW and other smartphone associated duties, leaving 60K available for use with the aid of an applet. The reminiscence to be had on each of the telephones strolling BREW is to be had here.

Another proscribing thing for applet length is heap fragmentation. If the largest to be had reminiscence block is smaller than the dimensions of the applet, then the applet will not be loaded. Use IHEAP_CheckAvail() to decide whether or not a memory block of enough size may be allotted. IHEAP_GetMemStats() may be used to decide the amount of RAM already used. If you've got an applet that is too big for a selected device, a work-round is to break up the utility into more than one applets. Memory Allocation affords more records on the way to keep away from heap fragmentation.

Note: In order test a low memory circumstance at the BREW Emulator reduce the heap length within the Device Configuration file by way of the appropriate quantity. BREW's System Info screen reviews the quantity of available flash reminiscence, now not the amount of available RAM.

Software Engineering Interview Questions
Question 25. Why Can't An Applet Be Run Directly From Flash Ram?

Answer :

BREW hundreds the apps into Heap RAM because files on EFS are stored as non- contiguous blocks.

Question 26. What's The Difference Between Malloc() And Iheap_malloc() Function In Brew-sdk?

Answer :

MALLOC and IHEAP_Malloc() are equal, just as FREE and IHEAP_Free() are equal. In in advance versions of the BREW SDK, malloc became a part of the IHEAP Interface, and changed into later made into a helper feature for ease of use. Both are nonetheless to be had for backward compatibility, but it's far endorsed that, use MALLOC and FREE instead of IHEAP_Malloc() and IHEAP_Free().

An app needs to create IHeap interface only while it wants to get current memory usage data (IHEAP_GetMemStats()) or check if a memory block of a positive size may be allocated (IHEAP_CheckAvail()).

Question 27. How To Test An Application On The Emulator To Determine If It Behaves Properly Under Low Memory Conditions?

Answer :

This may be performed by way of decreasing the heap size in the device configurator file (.Qsc file) to nearly the dimensions of the .Mod report. Any run time allocations by means of the programs must fail and you could take a look at if your application deals with the ones screw ups successfully.

Since the scale of the mod file a is lots much less then the dll that runs inside the emulator, the emulator approximates the scale of the mod document to be 10% of dll.
To properly run this check, create a separate listing that includes simplest the MIF of the application under test and feature emulator point to this new directory (File->Change MIF Dir).
Bada Mobile OS Interview Questions
Question 28. How To Send Sms Messages From A Brew Application?

Answer :

Currently, BREW does now not divulge a means to ship SMS messages from inside a BREW applet. BREW packages can most effective receive SMS messages.

Question 29. Can An Sms Message Be Sent To An Inactive Applet?

Answer :

Yes, SMS notification occasions can be added to an utility, even though it is not presently energetic. To accomplish that, BREW first hundreds the applet, after which sends the EVT_APP_MESSAGE event to it. The software might also begin itself with the aid of calling ISHELL_StartApplet(), or can "silently" technique the occasion with out calling ISHELL_StartApplet().

Question 30. Can Incoming Sms Messages Be Emulated With The Sdk?

Answer :

SMS :SMS emulation might be to be had in version 1.1 of the BREW SDK.

Question 31. What Settings Are Required To Allow A Running Brew Application To Be Suspended When A Non-brew Sms Message Is Received On The Sharp Z-800?

Answer :

On the Sharp Z-800 handset, you must set the following with the intention to receive non-BREW SMS:
Main Menu -> Setup/Tool -> BREW Setting -> OFF.

Question 32. When Making A Voice Call Using Itapi_makevoicecall, Responding No To The Privacy Alert Hangs The Application. What Is The Workaround?

Answer :

This is a worm in BREW SDK model 1.0.1, and may be constant in an upcoming release.

The advocated workaround for BREW SDK Version 1.0.1 is for the consumer to press 'No' twice (i.E. Press Select Key two times). When the Privacy Alert Yes/No conversation is displayed, all key events up till the primary Select key press visit the Dialog. After the first Select key (for the conversation), subsequent key occasions visit the application.

Steps are mentioned beneath:

Added a boolean 'madeVoiceCall' in the Applet shape
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 within the app handler function. If the Select key was pressed and madeVoiceCall is TRUE, the person has selected No in reaction to the Privacy Alert. Set madeVoiceCall = FALSE and redraw display.
Case EVT_KEY:

if (wParam == AVK_SELECT && pMe->madeTapiCall ==
TRUE) 
// Redraw display
pMe->madeTapiCall = FALSE;

return TRUE;

If the consumer decided on 'Yes' to the Privacy Alert, the software would have been suspended. When resumed, the madeVoiceCall flag must be cleared.
Case EVT_APP_RESUME:
if(pMe->madeTapiCall == TRUE) 
pMe->madeTapiCall = FALSE;

… … …
… … …
go back TRUE;

Question 33. 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?

Answer :

Make certain that the parameter clsReturn (utility to begin while the decision ends) within the name to ITAPI_MakeVoiceCall is zero (0). If you specify clsReturn as your app's Class ID, then BREW attempts to create another instance of your app, in place of resume your app.

Symbian Interview Questions
Question 34. What Guidelines Should Follow When Making A Voice Call Immediately After A Data Call?

Answer :

After the closing socket is launched, BREW waits for the community linger time (default linger time is 30s) to run out earlier than terminating the PPP connection. The real tearing down of the PPP connection takes about 3s. Therefore, (linger time + 3 seconds) must elapse among liberating the closing socket and invoking ITAPI_MakeVoiceCall(). You have to introduce a (linger time + three seconds) timer between releasing the remaining socket and making the voice call.

For instance:

ReleaseNetAndSocket(pMe);
//LINGER_TIME below is in seconds
ISHELL_SetTimer(pMe->a.M_pIShell, (LINGER_TIME +three) * 1000,
Timer_CB, (void *)pMe);

In the timer callback code, you may make the voice name the usage of ITAPI_MakeVoiceCall().
Note: In BREW SDK model 2.Zero, this three-2nd lag is built into BREW. The utility will not need to enforce the extra 3 seconds in its timer.

Question 35. When Making A Voice Call Immediately After A Data Call, Why Do We See The Privacy Alert Again Instead Of "return To Application"?

Answer :

Refer to above FAQ In addition to the more not unusual causes, stack overrun can also cause SWI Exceptions.

Note: It is suggested that big buffers be allotted on the heap instead of at the stack as computerized variables.

Question 36. How Do I Obtain The Phone Number Of The Device On Which My Application Is Running?

Answer :

An utility can reap the telephone variety of the tool on which it is running through 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, four, "Mobile ID:");
DisplayOutput((IApplet*)pMe, five, tapiStat.SzMobileID);

Question 37. When Will Brew Offer Http Support?

Answer :

HTTP Support is available through the AEEWeb interface in version 1.1 of the BREW SDK and above. With in advance variations of the SDK, use the ISocket interface to hook up with a server's HTTP port, and ship HTTP "get" and "put up" requests.

Question 38. Why Does Gethostbyname() Not Work On My Phone?

Answer :

For INETMGR_GetHostByName() to function successfully, the cellphone's Domain Name Server (DNS) settings need to be well configured. This is normally taken care of via the Service Provider, in which case the cellphone should be lower back to the place of purchase, or a certified service middle in order that its DNS settings can be well configured.

Question 39. Why Do We Get The Value Of zero.Zero.Zero.Zero In Dnsresult.Addrs When I Use Gethostbyname()?

Answer :

This may be due to wrong implementation of errors managing within the GetHostByName() callback function. The errors handling implementation in the GetHostByName() callback of the NetSocket example is wrong. You can use the following sample implementation:

if(pMe->dnsresult.NResult > 0 && pMe->dnsresult.NResult
<= AEEDNSMAXADDRS) 
// DNS research achievement
// Process dnsresult.Addrs
for(i = 0; i < pMe->dnsresult.NResult; i++) 
SPRINTF(szMsg,"Addr=: %x",pMe->dnsresult.Addrs[i]);
DisplayOutput(pMe,i+four,szMsg);

 else 
// DNS Failure - mistakes code is dnsresult.NResult
SPRINTF(szMsg, "DNS: errors %d", pMe->dnsresult.NResult);
DisplayOutput(pMe, 2, szMsg);


Question forty. With No Tcp/ip Flush Command Available In Brew, How Can I Confirm That A Command Is Sent Right Away?

Answer :

It is not feasible to decide when a TCP/IP command is sent; BREW does no longer offer this capability.

Question 41. What Is The Largest Packet Size Supported By Brew?

Answer :

The most packet size is OEM dependant, and can vary from one producer's telephone to every other. BREW has no manipulate over this challenge.

Question 42. When Transmitting Large Files, Do We Have To Break The File Up Into Packets Before Sending, Or Does Brew Do This For Me?

Answer :

You must truly send what you can, and ISOCKET_Write() will inform you how plenty information was without a doubt sent. If there is facts closing to be sent, absolutely offset your facts pointer by means of the quantity indicated through your last name to ISOCKET_Write().

For Example:
void CommonWriteCB (void *pUser) 
char *psz = NULL;
int cbWrite;
… … …
SampleApp * pMe = (SampleApp*)pUser;
// pszData is the information to be written
psz = pszData;
cbWrite = STRLEN (pszData);
// Loop till all of the bytes are written.
Whilst (cbWrite > zero) 
rv = ISOCKET_Write(pMe->m_pISocket, (byte *)psz,
(uint16)cbWrite);
if (rv == AEE_NET_WOULDBLOCK) 
// No byte had been written successfully. Register
// callback to strive again later.
ISOCKET_Writeable(pMe->m_pISocket,
CommonWriteCB, (void *)pMe);
go back;
 else if (rv == AEE_NET_ERROR) 
// Write Error.
ReleaseNetAndSocket(pMe);
go back;

// In case of parital write, loop and write the relaxation
cbWrite -= rv;
psz += rv;

… … …


Question 43. How Many Sockets Can Be Opened Simultaneously?

Answer :

This restriction is OEM specific, and will range relying on the tool that your applet is jogging on---it isn't set via BREW.

Note: Multiple TCP sockets aren't supported at the Kyocera 3035. It lets in one TCP socket and one UDP socket at a given time.

Question 44. Are Network Callbacks Invoked In The Context Of The Main Thread, And If So How Is The Data Integrity Preserved In The Current Context?

Answer :

All network callbacks occur in the identical thread context, at some point in time after the caller returns control to the AEE occasion loop. If your application is busy doing some thing, callbacks can be queued, then invoked once your utility returns manipulate to the AEE occasion loop, ensuring data integrity..

Question forty five. When Reading From A Socket The Phone Reads Whatever It Can In One Go, While The Emulator Reads Large Packets In Chunks. Why?

Answer :

This is a problem of the smartphone.

Program should call ISOCKET_Readable() to be knowledgeable when greater statistics can be study from the circulation. The callback recurring registered by means of ISOCKET_Readable() may be invoked whenever statistics turns into to be had---you may commonly call ISOCKET_Read() at this point. Continue calling ISOCKET_Readable() for so long as your application expects greater facts.

Rv = ISOCKET_Read(piSock, (byte *)szBuf, sizeof(szBuf));
if (rv == AEE_NET_WOULDBLOCK) 
// WOULDBLOCK => no more records available in the mean time
// Register the callback to study the facts later.
ISOCKET_Readable(piSock, CommonReadCB, (void*)pMe);
go back;

else if (rv == AEE_NET_ERROR) 
// mistakes analyzing from socket
ReleaseNetAndSocket (pMe);

else if (rv > 0)  
// rv bytes of statistics has been read from the socket into
// szBuf
// Read last data
ISOCKET_Readable(piSock, CommonReadCB, (void*)pMe); 

else  // rv == zero
// There isn't any greater records to be received.
// The peer has shut down the relationship.
ReleaseNetAndSocket (pMe);


Question forty six. How Can We Check The Status Of My Sockets And Ppp Connection?

Answer :

We can test at the status of the PPP connection (active, inactive, establishing or ultimate) using INETMGR_NetStatus().

NetState netState = NET_INVALID_STATE;
AEENetStats netStats;
netState = INETMGR_NetStatus (pINetMgr, &netStats);
We can use INETMGR_OnEvent() to screen each the reputation of the PPP connection and socket connections. Refer to NetMgrEvent enum in AEENet.H for a list of all community and socket activities.
// Register to receive Network and Socket events
INETMGR_OnEvent(piNet, (PFNNETMGREVENT)CheckNetStatus,
(void*)pMe, TRUE);
//Callback invoked whilst Network/Socket occasion is acquired
static void CheckNetStatus(void* cxt,
NetMgrEvent evt, uint32 dwData) 
SampleApp *pMe = (SampleApp*)cxt;
if(evt == NE_PPP)  
// network event. DwData = NetState enum fee
// refer NetState facts structure in BREW API Reference doc

// socket event - last or closed. 
// DwData is pointer to socket

… …
go back;


Question 47. Is It Possible To Transfer Data Between Two Phones?

Answer :

Peer to look connections among two phones had been observed to be unreliable, failing while the telephones are on the identical subnet. It is quality consequently to apply a proxy server, transferring information among the telephones the use of the server as a pass between.

Question 48. Can A Brew-enabled Device Be Used As A Server?

Answer :

In addition to the apparent reminiscence and overall performance limitations, it isn't always feasible to listen on a socket connection whilst a BREW software is strolling on a telephone. These elements make implementing a server on BREW tough at exceptional.

Question forty nine. Is There Any Way To Tell If A Socket Is Already Connected?

Answer :

There are two approaches to determine if a socket is hooked up. The easiest is to test the return value of ISOCKET_Connect(). When a socket is already related, ISOCKET_Connect() will return EISCONN.

It is also feasible to reveal the state of a socket connection via registering for the socket repute change activities NE_SO_CLOSING, and NE_SO_CLOSED with INETMGR_OnEvent(). Using this method, your application can keep away from seeking to join an already linked socket.

For more information about network and socket activities, including NE_SO_CLOSING and NE_SO_CLOSED, please talk over with the following include record: AEENet.H

For Example:

// Register to get hold of Network and Socket activities
INETMGR_OnEvent(piNet, (PFNNETMGREVENT)CheckNetStatus,
(void*)pMe, TRUE);
//Callback invoked whilst Network/Socket event is received
static void CheckNetStatus(void* cxt, NetMgrEvent evt,
uint32 dwData)

// flag set to fake to suggest socket is disconnected
pMe->m_SocketConnected = FALSE;
ReleaseNetAndSocket(pMe);

if(evt == NE_SO_CONNECTED) 
// flag set to true to suggest socket is connected
pMe->m_SocketConnected = TRUE;

go back;


Question 50. Why Does Isocket_release() Return One When We Are Expecting A Return Value Of Zero?

Answer :

When an software calls ISOCKET_Release(), the inner kingdom of the ISocket item modifications to "ultimate," and BREW starts anticipating the asynchronous "closed" event. Since the closed event is received in a callback, the reference remember of the ISocket object is incremented to prevent it from being released before its inner country changes to closed.

Question 51. Why Does Ishell_createinstance Return Eclassnotsupport When I Try And Create An Instance Of The Net Manager (aeeclsid_net)?

Answer :

This is due to the permissions on the MIF document to your applet. Please open your MIF file in the MIF editor and check the checkbox for Network privileges, then store

Question 52. Can We Have A Listening Tcp Socket?

Answer :

No. You use UDP, particularly, ISOCKET_Bind and ISOCKET_RecvFrom

Question 53. Does Brew Support Blocking Sockets?

Answer :

BREW makes use of asynchronous sockets. You can use ISOCKET_Readable or ISOCKET_Writeable to be notified while it is safe to examine/write.

Question 54. When We Terminate A Data Call By Closing An Open Socket, Why Does The Phone Still Indicate That A Data Call Is In Progress?

Answer :

After the ultimate connected socket is closed, BREW waits for a certain linger time earlier than terminating the PPP connection. Hence the lingering name-in-progress indication.

The default linger time is 30 seconds. To change the linger time, use INETMGR_SetLinger().

Question 55. Why Does Connect Callback Not Timeout When Service Is Lost (even as Attempting To Connect) Or The Server Does Not Respond?

Answer :

This is due to a computer virus inside the BREW model 1.Zero.1 SDK - connect callback isn't always invoked under the following occasions:

Service is lost while connect is being tried
Server does now not reply
As a workaround, you should put in force a timer in association with the callback. If the connect callback does not occur in 30 seconds, you ought to timeout the relationship.

For instance:

// initialize pMe->connectCBInvoked = FALSE;
// Set timer for 30 seconds before invoking ISOCKET_Connect()
ISHELL_SetTimer(pMe->a.M_pIShell, 30000, ConnectTimeout_CB, (void *)pMe);
ISOCKET_Connect(pMe->m_pISocket, nodeINAddr, AEE_htons(USAGE_TEST_PORT),
SampleApp_ConnectCB, pMe);
// Set flag indicating join CB was known as
void SampleApp_ConnectCB(void *cxt, int err) 
SampleApp *pMe = (SampleApp*)cxt;
// Set flag indicating join CB turned into referred to as
pMe->connectCbInvoked = TRUE;
if (err) 
DisplayOutput((IApplet*)pMe, 3, "Connect failed!");
go back;

DisplayOutput((IApplet*)pMe, 3, "Connected!");

// When timer expires, test if connect CB became invoked
static void ConnectTimeout_CB(void* cxt) 
SampleApp *pMe = (SampleApp *)cxt;
if(pMe->connectCbInvoked == FALSE) 
// Callback became not invoked within 30seconds - cancel join callback
ISOCKET_Cancel(pMe->m_pISocket, zero, 0);
DisplayOutput((IApplet*) pMe, 3, "Connection timed out");

else 
// Callback invoked. Set flag to default price FALSE
pMe->connectCbInvoked = FALSE;

Note: Multiple TCP sockets are not supported on the Kyocera 3035. It lets in one TCP socket and one UDP socket at a given time.

Question fifty six. What Precautions Should We Take When I Invoke Inetmgr_gethostbyname() To Perform Dns Lookup?

Answer :

You need to ensure that your app cancels its pending DNS callback, if any, the use of CALLBACK_Cancel() in all exit routes. This consists of when the app is suspended and while the app is stopped (both thru the End key and the Clear key).

For example, in case you used the subsequent code to lookup a DNS deal with:

CALLBACK_Init(&pMe->cbkLookup, GetHostByNameCB, pMe);
INETMGR_GetHostByName(pINetMgr,&pMe->dnsresult, hostName,
&pMe->cbkLookup);
You must use the subsequent code to cancel the callback in all go out routes:
// Check if the callback can be cancelled. If NULL it has
// already occurred and can not be cancelled.
If(pMe->cbkLookup.PfnCancel != NULL) 
CALLBACK_Cancel(&pMe->cbkLookup);


The callback cancel code have to be incorporated in the Suspend event handler code ( EVT_APP_SUSPEND), the app's FreeAppData function (which is called when the app is stopped, i.E. Receives EVT_APP_STOP event), and within the Clear key occasion handler code (EVT_KEY and keycode AVK_CLR).

Note: Please be aware that your app will not bypass TRUE BREW Testing if it does not nicely cancel its pending DNS callback. Some symptoms that might suggest that your app isn't canceling its p finishing DNS callback are:,/p>

hone crashes upon commencing app
Phone displays "Please Re-insert Battery" errors upon commencing app
Both would possibly mean that the formerly strolling app did no longer cancel its pending DNS callback.

Question 57. Are There Any Restrictions On What Value We Can Set My Application's Network Linger Time To?

Answer :

The INETMGR_SetLinger() function is furnished to give developers flexibility in designing their application. However, it isn't always endorsed which you regulate the OEM's selected default linger time (generally 30 seconds), until your utility has a compelling motive to achieve this. Altering the default linger time in both course might also purpose your application to fail TRUE BREW Testing, or provider rejection of your application.

Question fifty eight. What Image Formats Are Supported In Brew?

Answer :

BREW helps any BMP file with a colour depth as much as that that's provided at the tool it is jogging on. BREW does now not yet assist GIF and JPEG pictures. For now, you need to transform GIF and JPEG pix into BMP snap shots. PNG format and BREW Compressed Image (BCI) format could be supported in BREW SDK version 1.1.

In SDK versions prior to 1.1, the emulator is capable of emulating most effective 1, four, and eight bit colour intensity BMPs. In model 1.1, the emulator also can show 2 bit color intensity BMPs

Question 59. What Is The Transparent Color On Color And Monochrome Phones?

Answer :

Magenta is the obvious shade for colour devices. White is the transparent shade on monochrome and four-stage grey-scale gadgets.

Question 60. How Can We Move The Cursor To The End Of The Text Input?

Answer :

The cursor may be moved to the cease of the string by means of continuously invoking ITEXTCTL_HandleEvent() approach n times on the string, wherein n is the period of the string.
For instance:

whilst(len) 
ITEXTCTL_HandleEvent(pMe->m_pIText, EVT_KEY,
AVK_RIGHT, dwParam);
len--;


Note: This does not presently paintings on the Kyocera 3035, until dwParam is set to 10 (corresponds to AVK_RIGHT). Kyocera is running on solving this difficulty such that dwParam will no longer need to be explicitly set. Setting dwParam = 10 will no longer have any unfavourable affect at the Sharp Z-800 handset.

A new API - ITEXTCTL_SetCursorPos(), could be added in BREW SDK version 1.2 to set the Text Control's cursor function.

Question sixty one. How Can We Create A Text Control With Horizontal And Vertical Scrollbars?

Answer :

If the textual content is larger than the Text Control length, then a vertical or horizontal scrollbar will appear and you can navigate thru the textual content the use of the directional keys.

Question 62. Why Do We Get Memory Errors Such As "memheap.C 0696" When Using Idisplay_bitblt() To Draw A Bitmap Image?

Answer :

Ensure which you are releasing the reminiscence allocated via CONVERTBMP. Check the last Boolean parameter of CONVERTBMP. If True, a reallocation was carried out and the memory must be freed using SYSFREE.

For instance:

pBmp = CONVERTBMP (pDataBytes, &imageInfo, &bVal);
IDISPLAY_BitBlt (pIDisplay, xDest, yDest, cxDest,
cyDest, pBmp, xSrc, ySrc, dwRopCode);
IDISPLAY_Update (pIDisplay);
if(bVal) //free most effective if realloc was performed
SYSFREE (pBmp);

Question 63. How Can We Suppress The Title Area From Showing On My Istatic?

Answer :

The identify location can not currently be suppressed in SDK version 1.Zero. This has been added in BREW model 1.1.

Question 64. How Can We Determine The Character Limit For The Display Of Application Names On The Phone?

Answer :

Different phones have one-of-a-kind display characteristics, so there may be no unique answer to this query. You can decide whether your application call will in shape on the phone's display with the aid of evaluating the width of the utility name to the width of the display.

Use IDISPLAY_MeasureText() to determine the pixel width of your utility name string. Use ISHELL_GetDeviceInfo() to decide the pixel width of the screen

Question 65. Does Brew Support Animation?

Answer :

BREW SDK version 1.Zero consists of support for animated BMP. This is executed by putting the frames aspect-by way of-aspect and specifying the width of every 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 report contains one or more compressed small graphic picture(s), each with a precise period in milliseconds. The duration represents how long you need every image to be shown earlier than it's miles changed by means of the next photo within the collection. You can use the BCI Authoring Tool included in BREW SDK Version 1.1 to create your BCI report. Please talk to 'Using the BREW Compressed Image Authoring Tool' file included within the SDK for extra information.

Question sixty six. How Can We Control Animation By Time?

Answer :

One way to do this is to use the IImage interface and set the price of animation (IImage_SetParm).

An example in which the animation price is ready to 750ms is shown below:

IIMAGE_SetParm(pMe->m_pIImage, IPARM_RATE, 750, zero);

You also can use a timer to trigger the image show 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 feature may be induced, within which you may manipulate your photograph.

Question sixty seven. What Is The Difference Between Multi-tap And T9 Text Entry Modes For Text Input?

Answer :

In Multi-faucet mode, a key have to be tapped several times so one can specify a letter. For instance, to specify the letter 'r', tap the variety '7' three times. In T9 mode, a key's tapped handiest as soon as in line with letter. T9 Text Input determines the maximum generally used word matching the input numeric collection. If more than once word suits the series, the most not unusual word is selected, with the ability to scroll to the following maximum typically used phrase.

The default text entry mode is Multi-faucet. T9 text access mode isn't always supported on the emulator.

Question sixty eight. How Can We Draw A Line In A Specific Color?

Answer :

IDISPLAY_DrawHLine() and IDISPLAY_DrawVLine() constantly draw traces in black. Therefore placing CLR_USER_LINE to the desired color and then invoking IDISPLAY_DrawHLine() or IDISPLAY_DrawVLine() will now not work.

The definitions of those  IDISPLAY macros are underneath. To draw a line in a coloration other than black, use the code contained inside the macro definition and trade to the preferred fill shade.

#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);

Question sixty nine. How Can We Create A Dialog?

Answer :

Use the BREW Resource Editor to create a conversation. You can also assemble the dialog manually through creating information structures on your application to define the contents of the conversation.

Note: If a bmp report is being used, ensure that the bmp format is supported and that the bmp report is a valid complete path, all in lowercase. 

Once the conversation has been created, it'll have a resource ID and a aid document (.Bar report). Use ISHELL_CreateDialog() to create the conversation:

ISHELL_CreateDialog(pMe->a.PIShell, SAMPLEAPP_RES_FILE,

RESOURCE_ID, NULL);

// SAMPLEAPP_RES_FILE is the useful resource report (.Bar report) and
// RESOURCE_ID is the resource ID distinctive within the aid
// editor

Process the subsequent occasions (return TRUE no less than) in the app handler characteristic:

case EVT_DIALOG_START:
go back TRUE;
case EVT_DIALOG_INIT:
return TRUE;
case EVT_DIALOG_END:
return TRUE;

Call ISHELL_EndDialog whilst the dialog item is not wanted. ISHELL_EndDialog(pMe->a.PIShell);

Question 70. How Can We Create A Scroll Bar If Menu Is Larger Than The Screen Size?

Answer :

The screen rectangle in which the menu is to be drawn (detailed by means of IMENUCTL_SetRect) must exceed the display screen height by using as a minimum the peak of a unmarried menu item. Otherwise the menu object could be clipped and no scroll bar will appear.

Question seventy one. How Cancwe Add Images To The Items In An Imenuctl?

Answer :

We can use the IMENUCTL_AddItemEx technique with CtlAddItem structure.

Question 72. Can We Remove The Multitap Item From The Softkey Menu Associated With My Text Control?

Answer :

Yes, We can do away with it through following the steps mentioned below:

Associate the smooth key menu along with your text control using ITEXTCTL_SetSoftKey().
Call IMENUCTL_DeleteAll() to delete the Multitap item.
Add gadgets using IMENUCTL_AddItem().
Question 73. Is It Possible To Get/manage The Palette Information Of The Device?

Answer :

No. The palettes are hard-coded by means of the seller and will range from device to tool.

Question seventy four. Can We Modify The Display Buffers Directly?

Answer :

No. There is no way for BREW to access those and the display data is saved as the vendor's proprietary format.




CFG