BREWTM SDK Getting Started (1)

xiaoxiao2021-03-06  39

The first part - Preliminary knowledge You need the following environment: Microsoft Visual C 6.0® (or later) version 1.1 BREW SDK (or higher). To understand the minimum system, and get More detailed information, SDK installation guidance, check the ReadMe file of SDK 1.1. Note that here I assume that you have read an article before this series, "What is Brew". In the following examples, you need to know that the file name is very important. Specifically, the application module's information file (.mif file) must be the same name with the DLL file of the module. Basically, use BREW you need to choose a name and use it from beginning to end. When you finish this article, you will clearly know the importance of the. MIF file suffix. The SDK of the BREW Application Wizard version 1.1 includes a BREW Application WizardTM, which is not in version 1.0. This application wizard sets most of the applicable project options, and generates the smallest frame code for the BREW application. The wizard assumes that you will develop with C. The project settings and initial codes are compatible with the 1.0 version of SDK. At US, there are currently 4 BREW phones, two are installed with version 1.0 version of Brew Aee (Application Execution Environment), and two of them are 1.1. To ensure compatibility of these and subsequent, it is recommended that you use version 1.0 of SDK to develop future to prepare commercial projects. In this course, you can generate basic items with SDK1.1, then move the application-related file to a safe location, reversely install SDK 1.1, download and install SDK1.0, complete the remaining development. This way you can guarantee that the project is compatible with SDK1.0 and can run in the current and later phones.

After installing the SDK, open Visual C Click "File> New" to open the New Dialog box, select the Item tab. Select BREW Application Wizard to confirm that the location bar is entered YourBrewDir / Examples (Examples directory in the Brew SDK installation directory), enter "Hellobrew" as the project name in the engineering bar. Click OK to start the BREW Application Wizard. For the simplest application, we don't need any items involved in this dialog, so we don't choose this. If we need to join these items, we must clarify a little: just selecting the options in this dialog may not be enough. These multi-selected frames are to ensure that the appropriate interface file is included in the code generated by the wizard. The application needs to have a corresponding priority in the General tab of the BREW MIF EditorTM. MIF editor we will discuss below. We will introduce the related interfaces in the following article and will discuss the priority mentioned herein.

The MIF editor is in the second step of the wizard, with a "note" reminds us to create a module information file (.mif) for the BREW application. Click the button to write the "MIF Editor" to start the BREW MIF editor.

On the MIF Editor Master dialog box, click the New Program button to open the Generate ClassID dialog box shown in Figure 3 ("Small Program" and "Application" in this article refer to the same thing. May be used alternate). Note that the classID must be unique. In the name box, we entered "Hellobrew" as class name. After quick view of the header file in the BREECLASSIDIR / INC / INC Directory: AeeClassIDS.H, AeeeusageAppids.h and AeeeSampleAppids.h, we know that 0x1234ABCD does not conflict with any other ID contained in the SDK. So we choose "Local" here and enter "1234ABCD" in the ClassID text box or other IDs that do not have conflicts. If you need a commercial application in the future, you must get the world's unique ID from the BREW developer's outslon. Click the "Generate" button and click "Yes" in the next confirmation dialog to determine the generated local classID. At this point, the MIF editor creates a BREW ID (.bid) file. This file is just a simple "#define" definition statement including the local ClassID that has just been generated. In the following article, we must confirm that the "Hellobrew.bid" file is referenced by the "Hellobrew.c" source file (#NinClude). Figure 4 shows the "Small Program" tab of the BREW MIF editor. Enter "Hello Brew" in the name, select Tools in the small program type. We have not yet give the icon file. Don't close the Mif Editor now, we will come back soon. In our .mif file, three bitmap (.bmp) files will be used: one is approximately 85 × 40 pixels, one is 26 × 26 pixels, and there is a thumbnail is 16 × 16 pixels. You can create these bitmaps in a brush program in the Windows attachment or the resource editor in Visual Studio®. Of course, you can use anything you hand. (Note: Save these bitmap files as a 256-colored bitmap file, otherwise it cannot be displayed in Emulator.)

After completing and saving these three bitmaps, return to the MIF editor, now you can enter images of 26 × 26 pixels just created in the "Icon" bar. Next, click the "Advanced" button in the MIF Editor's Apparatus tab. This dialog requires you to provide a "image" file and "thumbnail" file. "Image" is the file of 85 × 40 pixels, and "thumbnail" is 16 × 16. This routine is about to be applied to Sharp Z800 mobile phones. This phone has a 128 × 144 pixel display that shows an image of up to 108 × 72 pixels. Note that this maximum is only available in the MIF editor. The image size of the SDK-based IIMAGE interface is limited to the size of the device physical screen. Different phones have different screen sizes and maximum image size. Certified BREW developers can get detailed mobile phone specifications on the BREW Outer Online. To learn how to become a BREW certified developer, please refer to the Qualcomm® Brew website. Question out, if you want to display animations on the simulator or phone, you can create a larger image. In the MIF editor, you can create a large picture very simply, this picture is arranged in a multi-horizontal direction, consistent frame consistent. At any time, the animation only displays 1 frame, so that the total width of this bitmap may be greater than the display width of the device. It should be noted that in order to make the animation very good, the width of the bitmap must be just a few times it is high. Now we have created a basic module information file, you can turn off the MIF editor to continue our adventure. Remember the points mentioned before, .mif file must be the same name with the application's .dll file. Note that the "Hellobrew.mif" file just created must be copied to the ... / YourBrewDir / Examples / Mif / 256Color / Directory, so that AEE can find and appropriately initialize the Hellbrew application. Next time, this is especially important to add your own code in the source code generated by the BREW application wizard and let the app run on the BREW emulator. This is especially important. The resource editor most applications require strings and image resources, do not involve some user interfaces composed of different screens. BREW's small program resource file (. Bar) is like a central repository of these resource files like your application. In this series, we will learn images and user interface resources. In this introductory application, we need a simple resource file containing two strings. We will load this file and display it during the running phase. Click the Resource Editor in the BREW program group to run the BREW resource editor. Figure 6 shows the resource editor after the two strings. Initially, the panel on the right of this dialog is empty. To be familiar with all the details of the resource editor, you can read the relevant chapters in the SDK documentation. Now right click on the left panel and select "New String ...", or simply knock the keyboard shortcut, Alt-s. The dialog shown in Figure 7 will appear. Fill in the required reference in the dialog as shown in Figure 6. After filling, select File> Save or Save the BREW Resource Intermediate (. Bri "as" Hellobrew.bri "on the toolbar. Note that both the. BRI file to open with a resource editor and modify it. As long as you create or edit the resources of the application, you must click the blue "Q" word in the toolbar after completion. This operation will generate two files: "Hellobrew.bar" and "Hellobrew_RES.H".

You must copy the generated "hellobrew_res.h" file to the "... / YourBrewDir / Examples / Hellobrew" directory, and use the #include statement in the "Hellobrew.c" file. Copy the "Hellobrew.bar" file to "... / YourBrewDir / Examples / EN / 256COLOR /". When running on the simulator, the Hellobrew application will access string resources from "Hellobrew.bar" based on the "need". On a phone, at least most of them are not too common, one application does not need to access all resources in concurrently. In this way, large strings, image, and user interface elements can be transferred to the burying file system (EFS) of the phone instead of being in very expensive RAM. In addition, the concept of resource documents makes it easy to apply internationalization. Summary In this article, we introduced three important BREW SDK Tools: Brew App Wizards, BREW MIF Editor, BREW Resource Editor. The BREW Application Wizard creates a framework that can be based on our BREW project. The BREW MIF editor creates a module information file (.mif) including basic information of the project, including the application's UNIQUE CLASS ID, the application type, and the image file corresponding to the three icons. The BREW resource editor is used to create application resources. These resources will be compiled into the BREW applet resource file (.bar) file, this file will provide resources when the application has a request. Next time, we will process the "Hellobrew.c" files generated by the application to join our own code to implement simple features, and run this application with the BREW simulator. At the same time, we will also see how to use the Visual C to combine the BREW simulator to debug a BREW application. © Copyright 2002, Golden Creek Software Inc. Author: By Murray Bonner

转载请注明原文地址:https://www.9cbs.com/read-58370.html

New Post(0)