Brew程序的自动启动

来源:互联网 发布:数据挖掘导论中文答案 编辑:程序博客网 时间:2024/06/09 16:38

Can my BREW application be notified when there is a TAPI event, such as an incoming call?

You can register your app for TAPI Status Change event by modifying your MIF file:
1. In the MIF Editor, select the Advanced button
2. In the Notifications box, select the Add button
3. In the Custom field, enter the hex value for AEECLSID_TAPI (the hex value can be found in BREW/inc/AEECLASSIDS.h - 0x01001007)
4. In the Mask field, enter the hex value for NMASK_TAPI_STATUS (0x00000001)
5. Save the MIF file

Your app will now be notified (via EVT_NOTIFY event) when there is a change in TAPI Status, such as an incoming call. Your app must handle the EVT_NOTIFY event. For example:

case EVT_NOTIFY:
{
AEENotify* notifyData;
TAPIStatus* tapiStatusData;

notifyData = (AEENotify *)dwParam;
if(notifyData->dwMask == NMASK_TAPI_STATUS) {
tapiStatusData = (TAPIStatus*) notifyData->pData;
if(tapiStatusData->state == PS_INCOMING) {
//Incoming call
// App may wake itself up by calling ISHELL_StartApplet()
}
}
}

Please refer to the INotify usage example for more information. TAPIStatus structure is defined in AEETapi.h.

Please note that BREW 1.0 apps should not register for NMASK_SMS_TAPI because of a BREW 1.0 bug. Please refer to Registering for NMASK_TAPI_STATUS event notification causes device to be unable to connect to Application Download Server (ADS) for more information.