Shared Files for BREW application Communication

Source: Internet
Author: User

As mentioned above, ififo is actually a file, and shared files, that is, sharing resident data is also the easiest way for brew applications to communicate with each other. There are three data resident methods in brew: system storage, files, and databases.

System Storage refers to the method of resident data through ishell_setprefs () and ishell_getprefs. Ishell_setprefs () and ishell_getprefs () provide a method to save the data structure that contains or reads the first address of the application or class level, which is equivalent to the serialization in VC and easy to use, data is shared by the entire aee layer.

A shared directory such as shared exists on a mobile phone. All files under the shared directory can be accessed by any application (the application must have at least the File Permission ). Therefore, if a file name is specified, two or more applications can access the file to communicate with each other. The const file allows the OEM to reduce the ram load. Generally, You cannot delete or modify the const file. ifile_map () can be used to map the const file to the memory. Therefore, the const file is rarely used as a carrier for communication. The file size supported by ifilemgr_getinfo () and ifilemgr_getinfoex () cannot exceed 4 GB (earlier than brew3.x). The file name length is also limited, through ishell_getdeviceinfo (pishell, Pi ), pi-> wmaxpath, you can get the maximum length of the file name including the path.

Idatabase is a database interface. Multiple applications can share the same database. Idatabase can create and access the records in the database created and opened by idbmgr, and call idbmgr_opendatabase () to open the required database to obtain the idatabase interface. In addition, you can use the functions in idbrecord to access the fields recorded in each database. ApplicationProgramThe permission level must be "file" or "all" to call the function that can modify the database content in this interface.

The idatabase_createrecord () function creates a new record and adds it to the database (idbrecord_remove () is used to delete records in the database ). Each record can contain one or more fields. Each field is defined by the aeedbfield structure. When creating a record, you must first enter the aeedbfield structure array, to specify the name, type, content, and length of each field in the record. Then, call idatabase_createrecord () and provide the pointer to this array and the number of aeedbfield structures to be included as the input parameter. Idatabase_createrecord () returns a pointer to the idbrecord interface instance, which can be used to access and update record fields. When creating or updating a record, the number of fields and field type are specified for each record. All records in the given database do not have the same structure. After creating a database and adding records, you can use other idatabase functions to retrieve records from the database.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/wireless_com/archive/2010/09/29/5914161.aspx

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.