Brew advanced and proficient-3G mobile value-added business operation, customization and Development serialized 78--brew mobile phone event handling

Source: Internet
Author: User

Brew is event-driven and can send or receive specified events through relevant methods in the ishell interface. The distribution and processing of events in the system is implemented through the aee layer. The methods for sending events include ishell_sendevent and ishell_postevent. The methods for receiving specific events are mainly implemented through the ishell_registerpolicy method, or through the settings in the MIF file. If the application registers an event, the aee layer sends the evt_notify event to the application when the event occurs.

Some events do not need to be registered, such as general system events evt_app_start, evt_app_stop, evt_app_suspend, and evt_app_resume. Mobile Keyboard Events generally do not need to be registered, such as evt_key_press, evt_key, evt_key_release, and evt_char. Before brew 3.1, only visible applications on the top of the screen can receive Keyboard Events, from Brew 3.1, all applications can receive Keyboard Events. If it is not a mobile phone screen top-layer visual application, you must register the nmask_shell_key notification to receive the relevant Keyboard Events.

Control events are generally named with the prefix evt_ctl, such as evt_ctl_tab and evt_ctl_add_item. Dialog Box events are generally named with the prefix evt_dialog. If an application uses a control or dialog box, it generally Processes related events. Generally, there are two methods to Set alert events: ishell_setalarm and ialarmmgr_setalarm. When the alert time is approaching, the evt_alarm event will be sent to the application. The evt_alarm event type is distinguished by mask.

The message queue of an event has no priority. All events have the same priority, that is, the system regards all messages as having the same priority, A message can be processed only after processing is completed, that is, the event processing method is returned. Therefore, an application must receive and process event messages from the system in a timely manner, and return control to the system in a timely manner to ensure the normal operation of the application. If the processing method of an event in the program runs for a long time and the system cannot return a response to another system event in time, aee will consider it as a system error. to avoid damage to the system, the device is forced to restart.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.