[Excerpt] How to Build a downloadable BREW application

Source: Internet
Author: User

 Http://soft6.com/html/tech/6/60272.shtml

Once an application is createdProgramAnd test it on the brew simulator. You will need to compile its arm application. We recommend that you use the brew realview compilation tool in collaboration with brew. You can also use the arm developer kit (ADS ). Brew realview "compilation tool is part of ads.

Step 1:Source codeGuiding principles

    1. No static or global data exists in the application. Static data can be simulated using the applet data structure. A applet should be built without static or global data and will generate a location independentCode. Since the compiler library can introduce its own global data, you should check the ing file after compiling the application to ensure that no data segment is marked as read/write.

    2. Do not include and link "Standard C library ". Use the aee Memory Service (in aeeheap. h) and standard library macro (in aeestdlib. h ). For example, use malloc () to allocate memory and use wstrcpy () to copy Unicode (width) strings.

    3. Except for isolatin1/ANSI, brew is only compatible with Unicode (wide string) (non-isolatin1/ANSI ). Always use aechar instead of "char ". Use the string service provided in aeestdlib. h to manipulate the string.

Step 2: Install the brew/ADS realview compilation tool
Install the brew/ADS realview compilation tool. The installation path must not contain spaces. We recommend that you install the arm compiler in the C: \ ads directory.

Step 3: compile for ARM

    1. Use the brew SDK "to generate a file copy. Change the name of the generated file and all references to the Application name in the generated file. This generated file applies to ads 1.0.1. To apply it to the ads1.1 and brew realview compilation tools (part of ads1.1), search for za1 in the file and change it to Zo.
      For ads 1.0.1: Za =-za1
      For analyticdb 1.1: Za =-zo

      You can check the ads version by opening the MS-DOS command prompt and typing the following command: ARMCC-vsn

      If the arm compiler is installed in a non-c: \ ads location, you must modify the generated file and environment variables accordingly.

    2. Open the MS-DOS command prompt and type the following command: nmake/F MyApp. Mak all

      This command will create the arm Executable File MyApp. Mod.

Compilation error:

Arm compiler warningYou will find that some warnings are issued during the compilation process. They can be completely ignored:

    • Warning c2067i: The zas option is not supported in future compiler versions.

    • Warning c2071w: Future compiler versions do not support the-za Option

    • Warning l6305w: The image has no entry point. (Not specified or not set due to multiple options ).

For more information about how to compile a BREW application, see the BREW application compilation FAQ.

Step 4: create a signature file
To obtain the test signature of your application, you must have the permission to access the developer's external network (to obtain the permission to access the developer's external network, click the following link: www.qualcomm.com/brew/#/resources/gs/get_auth.html ).

After logging on to the developer's external network, start the test signature generator (available from the http://brewx.qualcomm.com/brew/sdk/download.jsp ).

Enter valid ESN and (optional) Application names. ESN can be found at the rear of the phone by removing the battery. ESN adopts the H: 0 xaabbccdd format and is located under the first barcode. ESN must enter-0 xaabbccdd in the following format. Press generate to generate a test signature file, and then press download to transfer it to your computer.

Step 5: Make sure the mobile phone has passed the test
To use the test signature file on your handheld device, the handheld device must have passed the test. This is a security measure. If you load the test signature to a handheld device that has not passed the test, brew deletes the application from the handheld device. To make your handheld device pass the test, send it to the QIS phone center. For more information, see where should I send the phone number if I need to resize the phone, configure DNS, or enable the test Bit?

Step 6: transfer the file to the phone

    1. Use a data cable to connect your phone to your PC.

    2. Make sure the phone is switched on.

    3. Use brew apploader (available from the developer's Internet http://brewx.qualcomm.com/brew/sdk/download.jsp) to send files to the phone.

Note: Make sure that all files and folders are in lowercase when transferred to the phone's file system.

    1. Create a new folder named "MyApp" under ". Here, MyApp is your application name.

    2. Copy MyApp. Mod (compiled in step 3) to the "MyApp" folder created on the phone.

    3. Copy MyApp. Sig (obtained using the test signature generator in step 4) to the MyApp folder on the phone.

    4. If you use this function, copy the bar file "MyApp. Bar" (generated by the brew resource editor) to the MyApp folder on the phone.

    5. Copy the "MyApp. MIF" file of the MIF file to the "/" directory on the phone.

    6. You can also copy any other application-specific files to the application directory or the subdirectory of the application directory.

The directory structure on the phone should be as follows:

/MyApp. MIF -Generated by the brew MIF Editor
/MyApp. Mod -Use the arm developer kit to compile and link
/MyApp. Sig -generated by the test signature generator
/MyApp. Bar (if used) -Generated by the brew resource editor

Step 7: reset the phone number
After the instance is shut down, start the instance again. Your new BREW application will be located under the brew apps menu.

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.