2 brew创建app的过程
- 格式:ppt
- 大小:1.08 MB
- 文档页数:28
BREW 手机软件安装全过程(本文以海信手机:HS-S17为例)第一步:准备硬件①:手机②:数据线③:手机驱动文件******************************************************************************* 注意:①:数据线连接电脑后,电脑会提示“找到新的硬件”,如果没有提示,一般是你的数据线有问题。
海信手机自带的“数据线”只支持充电,不支持数据传输!可以更换一根普通MP3的数据线即可!②:驱动文件获取:(1)、可以到手机官方网站搜索下载。
(2)、可以到各大手机论坛下载。
(3)、可以到以下网站下载:/mobiled.asp(上述网站为天翼软件开发员网站,有一般常见品牌手机驱动及资料下载!)。
如图:第二步:安装驱动文件①:手机连接后,右击桌面:我的电脑→管理→设备管理器:如图:②:右击带“黄色问号”的设备,选择更新驱动程序。
③:选择从列表或指定位置安装(高级)。
④:选择驱动文件所在文件夹(将上面第一步下载的压缩包解压)⑤:当提示“安装的驱动未经过认证或者存在兼容性问题时”点击仍然安装。
⑥:安装完成后,到:计算机管理 设备管理器,查看手机端口。
(如下是COM5)第三步:用BMC联机软件联机①:运行下载好的Brew Mobile Commander.exe②:设置BMC。
可能软件运行后是英文界面,可按下图设置为中文。
③:设置手机端口,准备联机。
注意:设置端口(在上面的计算机管理中查看的)时候,两个一定要不同!只有下边的有用。
④:联机,选择联机模式为:BREW,然后点击“菜单栏”的“连接”⑤:安装BREW软件(先自己申请SIG文件,申请方法见文件最后附录!)在弹出设置里面选择你的SIG文件所在位置,BMC程序自动为安装的软件匹配SIG文件名!软件文件传输完成后按以下步骤重启手机,软件即可运行!至此!安装BREW软件完成!看看你的“软件超市”是不是有新安装的软件了?附录:(一)、SIG文件申请:SIG文件是电信BREW平台软件的证书文件,没有证书文件,软件没法安装到手机上。
iOSApp开发的基本流程与规范随着移动互联网的快速发展,iOS系统越来越成为移动应用开发的主流平台之一。
iOS系统的稳定性和用户口碑成为了nirvana 开发者想要进入移动应用市场必不可少的一个平台。
在iOS应用开发过程中,开发者需要遵循一些基本流程和规范,保障应用的开发进度和质量。
一、 APP设计在APP设计阶段,开发者需要充分了解和了解目标用户和使用场景。
这个步骤的重点是确定应用的功能和流程。
合理设计可以让用户在使用过程中更加便捷和舒适。
二、UI设计UI是APP界面的设计和呈现。
UI界面设计所依据的约束是谷歌,在谷歌平台下要求app的UI设计必须符合一定的标准,包括配色、布局、icon设计、字体选择等等,UI与用户的体验息息相关,切不可因为某些因素心急快速完成。
三、APP开发APP开发的基础是开发者需要学习掌握Objective-C或Swift的语言语法、框架、界面框制造,同时还需熟悉iOS开发的API和规范。
1.编程语言Objective-C和Swift是iOS应用开发的主要编程语言。
iOS 开发者可以使用这两种语言之一开发应用。
Objective-C在iOS开发中被广泛使用,但Swift也逐渐开始在iOS开发中发挥作用。
Swift获得了定期更新,在语言中加入了许多新功能,它的用法也更加高效和灵活。
2.框架与控件iOS系统提供了许多可用于快速构建界面和处理常见任务的框架和控件。
熟悉这些控件和框架是开发一个高效、稳定的应用的基础。
常见的iOS框架包括:UIKit框架:UIKit框架包括许多用于构建iOS应用的类和组件,包括视图、控制器、转换器、动画、文本和图像组件。
Core Data框架:Core Data是一种轻量级的数据管理框架,用于在iOS应用中存储和管理应用数据。
Core Animation框架:Core Animation是用于iOS动画的基本框架。
3.API调用iOS开发者需要熟悉iOS开发的API和框架,可以使用这些库快速完成许多任务。
1 BREW SDK 一览BREW SDK 包含了一组工具以帮助软件开发人员快速、高效率地开发,发布用于手持设备的 BREW 应用程序。
1.1 BREW SDK 组件BREW SDK包含了下列几个组件:∙BREW AEE:BREW AEE 是一个可扩展、面向对象的开发和运行环境,它提供了一个可以用 C 或 C++ 开发BREW小应用 (Applet) 或共享模块 (Shared Module) 的高效平台。
它采用一种消息驱动机制(类似与 Microsoft Windows,Macintosh 和 X Windows)以提高可用性。
∙模拟器:BREW 模拟器提供了一个图形界面用于装载和测试 BREW 应用程序,BREWSDK 套件中自带了几种模拟设备的配置文件,用户也可以自己创建新的设备模拟配置文件,以模拟不同的手持设备。
∙设备配置器:设置配置器可以用来创建新的设备配置文件或修改已有的设备配置文件,可以帮助配置诸如按键及其功能,设备屏幕大小和分辨率以及内存大小等。
∙资源编辑器:使用 BREW 的资源编辑器,可以为应用程序创建资源文件,开发者可以在Windows 或手持设备上使用同样的资源文件。
∙MIF 编辑器:BREW 的 MIF 编辑器用于生成 MIF(模块信息文件)文件,MIF文件包含了用于装载模块或应用相关的一些信息,如应用程序名称,图标等。
∙BREW 动态连接库:BREW SDK 套件包中包含几个动态连接库用于提供 BREW 相关的一些Window 平台核心服务调用接口。
∙BREW OEM 动态连接库:该动态库提供了下层用于在 Window 平台上模拟设备一些动态库。
∙BREW头文件:BREW SDK 头文件中定义了 BREW SDK 所提供了接口定义,用作开发BREW应用,每个 BREW 接口都有与之对应的头文件,在开发应用程序时如果用作某个接口,必需在源代码中包含该头文件。
∙VS Add-ins:BREW SDK 套件可与 Visual Studio 结合使用,在成功安装 BREW SDK 套件后,在 Visual Studio 开发环境中会自动创建一个 BREW 应用开发向导以简化 BREW 开发过程。
使用React Native开发iOS和Android移动应用的流程和技巧移动应用的开发已成为现代社会中极为重要的一环。
随着技术的不断进步,开发人员需要掌握多种工具和技能来满足市场的需求。
React Native是一种流行的跨平台开发框架,能够帮助开发人员同时开发iOS和Android应用程序。
本文将介绍使用React Native开发移动应用的流程和一些实用技巧。
一. 环境搭建开始使用React Native之前,首先需要搭建相应的开发环境。
对于iOS开发,您需要安装Xcode和相关的开发工具;而对于Android开发,则需要安装Android Studio以及Java Development Kit。
同时,您还需要安装Node.js和React Native命令行工具来支持React Native的开发环境。
二. 创建项目通过React Native命令行工具,您可以轻松地创建一个新的React Native项目。
在命令行中输入以下命令:```npx react-native init ProjectName```这将创建一个名为ProjectName的新项目文件夹,并在其中包含所需的初始文件。
三. 编辑代码一旦项目创建成功,您可以使用您喜欢的文本编辑器打开项目文件夹,并开始编辑代码。
React Native使用JavaScript语言进行开发,您可以使用React Native提供的组件和API来构建界面和实现应用程序的逻辑。
四. 调试调试是开发过程中非常重要的一步。
React Native提供了一些工具来帮助您调试您的应用程序。
例如,您可以使用React Native Debugger来检查和调试网络请求、状态管理和组件通信等方面的问题。
此外,您还可以使用React Native提供的开发者菜单来实时查看和修改应用程序的状态。
五. 跨平台兼容性React Native是一种跨平台开发框架,但在一些特定情况下,某些功能或样式可能在iOS和Android之间存在差异。
如何使用iOS开发工具Xcode创建iPhone应用一、简介Xcode 是专为开发 iOS 应用程序而设计的集成开发环境(IDE)。
它提供了丰富的工具和功能,帮助开发者创建出色的iPhone 应用程序。
本文将详细介绍如何使用 Xcode 创建 iPhone 应用程序的步骤及常用功能。
二、安装 Xcode首先,你需要从 App Store 中下载并安装 Xcode。
在 App Store 搜索 Xcode,并点击“获取”按钮进行下载和安装。
安装完成后,可在 Launchpad 中找到并打开 Xcode。
三、创建新项目1. 打开 Xcode 后,点击“创建新 Xcode 项目”按钮,或者选择“文件”菜单中的“新建”>“项目”。
2. 在弹出的模板选择窗口中,选择“iOS”标签,并选择“应用”分类下的“Single View App”。
点击“下一步”。
3. 在“项目选项” 窗口中,为你的项目指定一个唯一的名称,并选择你想要的语言(通常选择 Swift)。
选择你的组织名称或者输入一个新的组织名称,然后点击“下一步”。
4. 在“存储项目的位置” 窗口中,选择一个存储位置,然后点击“创建”按钮。
Xcode 将自动为你创建一个 iOS 应用程序的基本项目结构。
四、界面设计1. 打开创建的项目后,可以看到 Xcode 的界面分为多个区域。
其中,“导航器”区域显示项目文件结构,“编辑器”区域用于编辑代码,“动作”和“对象”区域用于设计用户界面,“控制台”区域显示应用程序运行时的日志信息。
2. 点击“Main.storyboard”文件,在“动作”和“对象”区域可以对应用程序的用户界面进行设计。
你可以通过拖拽预置的视图控件(如按钮、标签等)来创建界面。
使用约束对控件进行位置和大小的调整,以适应不同尺寸的设备屏幕。
3. 在“导航器”区域中,可以查看项目的文件结构。
可以通过添加新的文件或文件夹来组织代码文件,例如模型、视图和控制器。
AP代码学习总结1. AP生成的步骤一般AP应用程序的生成包含以下几个重要步骤:1)加载AP,指定AP的创建函数;2)创建AP,并初始化;3)在事件处理函数中处理各种事件;对应的几个重要函数如下:XXX_Load ----应用程序加载函数;XXX_CreateInstance ----应用程序创建函数;XXX_HandleEvent ----应用程序事件处理函数;2. 函数的具体解析2.1 XXX_Load每个模块都有对应的Load函数,该函数需要在Brew中注册并与其对应的模块的mif文件关联起来,具体关联位置如下:文件OEMModTableExt.c中的gOEMStaticModList表中,如下:该表实际上是把每个模块的Load函数与本模块的mif文件关联起来,当Brew加载模块时,会先到相应模块的mif文件中获取模块相应信息,然后再进行加载(个人觉得既然注册在OEM,那么模块应该由Brew的OEM层来获取信息进行加载);以闹钟模块代码为例,XXX_Load函数实现如下图:实际上XXXApp_Load函数调用了函数AEEStaticMod_New,再来看一下AEEStaticMod_New函数的实现,在AeeModGen.c中可以找到,简化过后如下:概括起来,该函数就是在为module分配内存,并且实例化vtbl表,代码中有两行比较重要:modFuncs->CreateInstance = AEEMod_CreateInstance;pMe->pfnModCrInst = pfnMC;上面第一行指定module的创建函数为AEEMod_CreateInstance,而第二行是指定该module具有自身特殊的创建函数,该函数即为参数pfnMC指定的函数。
而如果pfnMC传入的是NULL,则表示调用AEEMod_CreateInstance创建模块,该调用方式为动态加载模块方式;我们现在一般都是静态方式,即模块的创建函数由参数pfnMC传进来,如上面例子闹钟模块的创建函数CAlarmApp_CreateInstance;指定好模块创建函数之后,我们便可以创建模块文件,编写模块代码了;2.2 XXX_CreateInstance该函数创建模块,初始化模块相关内容,以alarm模块为例,内部调用了两个函数,实现大致如下图(部分内容裁剪):这里AEEApplet_New函数比较重要,每个模块创建时都必须调用它,主要功能是具体分配applet内存,初始化applet的vtbl(这里最重要的是实例化applet_handleevent)并返回Iapplet指针,供运行时使用;申明如下:参数说明:nIn:模块数据结构的大小;clsID:模块的ClassID,一般在模块对应的.bid文件中定义;ppobj:*ppobj指向有效的AEEApplet结构在实际开发中,一般自定义一个模块结构体,其中第一项必须是AEEApplet类型的变量(类似于类中的继承原理),后边的变量可以将可能用的接口都封装起来,然后将该自定义结构体用于程序中;pAppHandleEvent:自定义的模块事件处理函数;pFreeAppData:自定义模块释放函数;在看一下AEEApplet_New的具体实现:其中的27,32两行比较重要;32行便是指定了模块的事件处理函数;如果pAppHandleEvent为NULL,则采用底层的AEEApplet_HandleEvent来处理事件;模块的创建函数XXX_CreateInstance中调用AEEApplet_New实现模块的创建后,再对模块进行初始化,如Alarm模块调用自定义函数alarm_InitAppData进行模块数据结构的初始化;一般情况下,还会在该初始化函数中创建RootForm,当然RootForm也可以在事件处理函数里创建,不过有一点必须保证: RootForm在所有窗口之前创建;2.3 XXX_HandleEvent在AP模块创建并初始化之后,模块即可以接收系统的各种事件了,在XXX_HandleEvent 函数中对各种事件进行相关处理。
QUALCOMM Incorporated5775Morehouse DriveSan Diego,CA.92121-1714U.S.A.This manual was written for use with the BREW SDK TM for Windows.This manual and the BREW SDK software described in it are copyrighted,with all rights reserved.This manual and the BREW SDK software may not be copied,except as otherwise provided in your software license or as expressly permitted in writing by QUALCOMM Incorporated.Copyright 2002QUALCOMM IncorporatedAll Rights ReservedPrinted in the United States of AmericaAll data and information contained in or disclosed by this document are confidential and proprietary information of QUALCOMM Incorporated,and all rights therein are expressly reserved.By accepting this material,the recipient agrees that this material and the information contained therein are held in confidence and in trust and will not be used,copied,reproduced in whole or in part,nor its contents revealed in any manner to others without the express written permission of QUALCOMM Incorporated.Export of this technology may be controlled by the United States Government.Diversion contrary to w prohibited.Binary Runtime Environment for Wireless,BREW,BREW SDK,TRUE BREW,BREWStone,CMX, MobileShop,Eudora,and PureVoice are trademarks of QUALCOMM Incorporated.QUALCOMM is a registered trademark and registered service mark of QUALCOMM Incorporated.Bluetooth is a trademark of Bluetooth SIG,Inc.Microsoft,Windows,Visual Studio,and Sound Recorder are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.Macintosh is a registered trademark of Apple Computer,Inc.UNIX and X-Windows are trademarks of The Open Group.Adobe,Acrobat,and Photoshop are trademarks of Adobe Systems Incorporated.All trademarks and registered trademarks referenced herein are the property of their respective owners.Creating a BREW™Application from Scratch80-D4369-1AOctober23,2002ContentsIntroduction5The best way to use this manual5Prerequisites5A word about BREW versions5BREW documentation6Requesting new BREW features7For more information7Overview of the BREW development process—from idea to Emulator8Creating your project in Visual Studio10Writing your BREW application10The MIF11Resources12Testing your application on the Emulator13Tutorial:Creating Your First BREW Application15Before you begin15Your objective for MyFirstApp15Creating the MyFirstApp project files16Initial source code for myfirstapp.c23Creating resources for MyFirstApp26Writing the source code for MyFirstApp30Adding#include statements31Adding the application-specific data structure32Adding function prototypes33Modifying the AEEClsCreateInstance function33Adding the MyFirstApp_InitAppData function34Adding the MyFirstApp_FreeAppData function36Modifying the MyFirstApp_HandleEvent function36Handling SUSPEND and RESUME events39Adding the CMyFirstApp_Move function40Testing MyFirstApp on the Emulator41ContentsWhat’s Next?44Learning BREW by example44Learning BREW using other resources46 BREW SDK documentation46BREW Developer Extranet46BREW training46BREW Developer Conference47 Index48IntroductionThis guide walks you through the basic steps necessary to create your first Binary Runtime Environment for Wireless™(BREW™)application using the tools provided in the BREW Software Development Kit(BREW SDK™).It also provides an overview of the BREW application development process,so you can understand how each step in the tutorial relates to the rest of the process.The best way to use this manualThe best way to use this manual depends on how you like to work.In other words,it’s entirely up to you.If you think you’ll benefit by first gaining an understanding of the BREW development process before creating an application,start with Overview of the BREW development process—from idea to Emulator on page8.If,on the other hand,you can’t wait to roll up your sleeves and start cranking out your first BREW application,see Tutorial: Creating Your First BREW Application on page15.After completing the first two sections of this guide,proceed to What’s Next?on page44to examine the sample applications included with the BREW SDK.Studying these applications can help you gain greater understanding of how various APIs and controls can be used to increase the functionalities of BREW applications.PrerequisitesIt is assumed that you already possess a working knowledge of C/C++and the Microsoft Visual Studio development environment.A word about BREW versionsThis manual is essentially BREW version-independent.In instances where a feature described in this manual became available with a particular BREW software release,you will see an indicator similar to:New in BREW x.x.BREW documentationThis guide is part of an information set that includes the following documents:BREW SDK User’s Guide Introduces the components of the BREW SDK and theirrelationship to one another.The document also containsgeneral instructions for developing BREW applications and forusing the BREW Emulator.BREW API Reference Provides information about BREW Application ProgrammingInterfaces(API),functions,and data structures needed todevelop applications for BREW-enabled mobile platforms.BREW Sample Applications Guide (New in BREW2.0)Describes several sample applications created with BREW that demonstrate the capabilities of BREW interfaces and controls commonly used to develop complex BREW applications.BREW Device Configurator Guide Describes how to use the BREW Device Configurator tocreate effective wireless devices for emulation by the Emulator.BREW Resource Editor Guide Describes how to use the BREW Resource Editor to create thetext strings,images,and dialogs used by BREW applications. BREW MIF Editor Guide Describes how to use the BREW MIF Editor to create andmodify Module Information Files(MIF)—a special type ofBREW file that contains information about the classes andapplets supported by a particular BREW module.BREW SDK Utilities Guide Describes how to use the utilities,such as the PureVoiceConverter,2Bit T ool,and NMEA Logger,included with theBREW SDK.BREW Compressed Image Authoring Guide Describes how to use the BREW Compressed Image Authoring Tool to create files for displaying and animating images in your applications.Creating a BREW Application from Scratch Provides a tutorial designed to guide new BREW application developers through the creation of their first BREW application.It also provides an overview of the components of the BREW SDK as they relate to application development. NOTE:This manual can be downloaded from the BREW Developer Extranet and the BREW web site.Requesting new BREW featuresDo you have ideas for features that would make the BREW SDK more valuable and useful to you?If so,send us email at brew-request@.Each request is evaluated,and a member of the New Features Response Team will respond to your email.For more informationOnline information and support is available for BREW application developers.Please visit the BREW web site for details:/brew/developer.Overview of the BREWdevelopment process—from idea to EmulatorThis section starts by offering a high-level view of the process of creating a BREW application, then examines each element more closely.The BREW SDK is made up of several components,including the following:•BREW Application Execution Environment(AEE)provides the foundation for BREW applications•A set of tools that are the main development elements of the SDK(MIF Editor, Resource Editor,Emulator,and Device Configurator)•BREW header files•BREW utilities for adding functionality to your BREW applications-PureVoice Converter(New in BREW1.1)-2Bit Tool(New in BREW2.0)-NMEA Logger(New in BREW2.0)•Add-ins to Microsoft Visual Studio to ease your application development -BREW Application Wizard add-in(New in BREW1.1)-Automated ARM compiling add-in(New in BREW1.1)-BREW Integrated Help add-in(New in BREW2.0)•Sample applications to demonstrate BREW capabilities•Online help(New in BREW2.0)The following diagram shows how the pieces fit together,and identifies the files created by each tool for an application called MyFirstApp.MyFirstAppThe process works like this:n With your plan for the next killer application in mind,use the BREW ApplicationWizard,an add-in to Microsoft Visual Studio,to create the project file,workspacefile,a skeletal source file,and two additional files (AEEAppGen.c andAEEModGen.c)that are essential to all BREW applications.o Create a Module Information File (MIF)that includes all module-and applet-specific information required to load the applet.p Create resources,such as strings,images,dialogs,and controls,to be used by theapplication.qBREW Project in MS Visual Studiomyfirstapp.dllpResource Editormyfirstapp_res.hmyfirstapp.baro MIF Editor myfirstapp.mif nBREW ApplicationWizardmyfirstapp.dspmyfirstapp.dswAEEAppGen.cAEEModGen.cmyfirstapp.c r BREWEmulatorrunningmyfirstapp ApplicationDeveloperq Compile the source files generated by the BREW Application Wizard and the resource files to create the application DLL file.r Launch the BREW Emulator,specifying the MIF and Applet directories,and test your application.NOTE:The process for moving a BREW application that has been tested on the Emulator to the actual handset is described in the tutorial section.NOTE:Although the Configurator is an integral part of the BREW SDK,it is not discussed in this guide because users of the Configurator typically are device manufacturers.Application developers can also use the Configurator to change device settings to test their applications; however,that is beyond the scope of this guide.For information on the Configurator,see the BREW Device Configurator Guide.Creating your project in Visual StudioThe BREW Application Wizard guides you through the tasks involved in creating a new BREW application project,including the creation of the following files:•Project file(myfirstapp.dsp)•Workspace file(myfirstapp.dsw)•Application source file(myfirstapp.c)NOTE:A sample of the source code generated by the BREW Application Wizard is shown on page23.Two other files required by BREW applications,AEEAppGen.c and AEEModGen.c,are included with the BREW SDK in the<BREW/Src>directory.These two files are automatically included in your new BREW project when you use the BREW Application Wizard.Writing your BREW applicationAfter creating your Visual Studio project and the skeletal application source file(myfirstapp.c), you can begin coding your first BREW application.The MIFIf you were to immediately compile the application,you would receive one compilation warning and one error.These occur because all BREW applications require a MIF file containing unique BREW ClassIDs(BID)for each of the module’s classes.After you create the MIF,the warning and error are removed.The following diagram illustrates the steps you need to follow to create the MIF using the MIF Editor.Creating the MIFThese are the steps required to create a MIF for a BREW module called myfirstapp:n From the BREW Developer Extranet,obtain a BID file for each class and applet that the module contains.Each BID file contains a unique,32-bit ClassID that isstored in the MIF.o Compile and link the BID and application source files to create the application’s DLL file(myfirstapp.dll).p In the MIF Editor,enter the required information,including the ClassIDs contained in the BID file(s),and save the MIF as myfirstapp.mif.The MIF and DLL are used to test the application in the Emulator.This is discussed in Testing your application on the Emulator on page13.ResourcesAs you write MyFirstApp,you will also need to create resource files that contains character strings,images,and dialogs that are loaded at runtime.Resources are useful for storinglanguage-specific strings,dialogs,and bitmaps.If you need to localize your application for use in a target device in a different language,you simply need to translate the resources in the resource file.It is not necessary to recompile the MOD or DLL file.So rather than hard coding controls into your application source code,consider using resources whenever possible.The following diagram illustrates the steps you need to follow to create a resource file using the Resource Editor.Creating resourcesNOTE:The Resource Editor is made up of two integrated parts:the Resource Editor and Resource Compiler.These are the steps required to create resource files for a BREW module:n Use the Resource Editor to create all character strings,images,and dialogs to beused in your application.The Resource Editor creates a BREW ResourceIntermediate (BRI)file that contains all of the resource ID information for theapplication.As you create resources,you assign each a unique resource IDnumber.o The BRI file is then compiled by the Resource Compiler to produce the BREWApplet Resource (BAR)file and a resource header file,with the _res.h extension.The BAR file is used by the BREW executable file (MOD or DLL)at runtime to loadresources.o myfirstapp_res.h nBREWResource Editor/CompilerYou define resources.myfirstapp.bri omyfirstapp.bar C Compiler/Linker BID files myfirstapp.c myfirstapp_res.hp myfirstapp.dllp When you compile your C source code,include the header file(myfirstapp_res.h) so that it is compiled and linked along with the other application source files toproduce the DLL file.Testing your application on the EmulatorAfter you have created a DLL and a MIF(and optionally,resource files)for your application, you can run it on the Emulator.The Emulator presents an image of a selected handset and emulates the running of your application as it will appear on the actual handset.You can load your application in the Emulator by specifying the applet directory that contains the DLL.By default,the MIF directory is the same as the applet directory.When you run the Emulator,the BREW Application manager presents a series of applets contained in the applet directory.When you choose your application from the list,the Emulator executes the application’s DLL,showing its initial screen on the device.If the application uses resources,it uses the resource-loading functions in the IShell interface to load the resources from the application’s BAR file.The Emulator,showing MyFirstApp in two different device configuration filesTutorial:Creating Your FirstBREW ApplicationThis section provides a step-by-step introduction to BREW application development.You will learn by doing.If you’d rather get some background on the process first,see Overview of the BREW development process—from idea to Emulator on page8.Before you beginBefore attempting to build your first BREW application,complete the following steps.•Obtain Microsoft Visual Studio6.0.Visual is not yet supported.•Download and install the latest version of the BREW SDK.Here is the download site:https:///developer/sdk/download.jsp.NOTE:It is important that you install Microsoft Visual Studio before the BREW SDK.If you install the SDK first,BREW’s add-ins to Visual Studio,including the BREW Application Wizard, will not be available.Your objective for MyFirstAppFor your first taste of BREW,you will create a simple application,called MyFirstApp,that performs the following functions:•It loads two text strings from a resource file that you define.•It prints the strings in the upper half of the device screen.•It draws a thin,color-filled,horizontal rectangle,dividing the screen into two halves.•It loads a bitmap image,representing a cursor,from the resource file and draws the cursor in the middle of the bottom half of the screen.•It allows the user to move the cursor bitmap using the up,down,left,and right arrow keys on the device.Creating the MyFirstApp project filesThe following instructions are designed to lead you through the creation of MyFirstApp.The tutorial begins with the BREW Application Wizard(New in BREW1.1),describes the MIF Editor and Resource Editor,discusses the functions you need to define to meet the objectives stated above,and explains how you can compile and test the application.For more detailed instructions on using the BREW Application Wizard,or any of the other BREW SDK tools,see BREW documentation on page6for the list of documentation included with the BREW SDK.To create the MyFirstApp project with the Application Wizard1.Start Microsoft Visual Studio,and choose File>New.The New dialog box opens.2.Click the Projects tab.The following fields are shown.3.Select BREW Application Wizard and do the following:a.In Project name,type MyFirstApp.b.In Location,enter a path to the directory where you want to store the files for theproject.c.Click OK.The first of two BREW Application Wizard windows opens.This window allows you to define the types of interfaces you intend to use in your application.4.Leave all of the check boxes unchecked,and click Next.The second BREW Application Wizard window opens.At this point,the experienced BREW developer has two options:•Bypass the MIF Editor and complete the BREW Application Wizard to build the BREW application project file,leaving the creation of the MIF for a later time.•Create the MIF now.You have the option of skipping the MIF creation process now,but because the MIF is essential to all BREW applications,it is recommended that you create it before completing the BREW Application Wizard.For more information on the MIF, see The MIF on page11.5.Click MIF Editor.The BREW MIF Editor window opens.6.Click New Applet.The ClassID Generation dialog box opens.7.Make the entries shown above.NOTE:The name you assign the ClassID should be the same name you assigned the project in the BREW Application Wizard.NOTE:The Locally option allows you to run your application for testing purposes.Before you can submit an application for TRUE BREW™T esting,you are required to obtain a unique,32-bit BID for each BREW class you create,including BREW system classes and all applet and non-applet classes,from the BREW Developer Extranet.For more information,see the BREW MIF Editor Guide.8.Click Generate.A confirmation box asks if you are sure you want to generate the ClassID locally.9.Click Yes.The Save As dialog box opens,prompting you to specify a location for themyfirstapp.bid file.10.Navigate to the<BREW/Examples/MyFirstApp>directory and click Save.The ClassID you defined is added to the main MIF Editor window,as shown below.11.In Name,type MyFirstApp.This name appears on the device display when theuser chooses the applet from the device’s applet menu.NOTE:You must always ensure that the MIF filename is not made up exclusively of numbers,such as1003.mif.The name of the MIF must contain,and must begin with,alphabetical characters.Examples of valid MIF names are helloworld.mif, b2b.mif,and good4u.mif.12.In the Applet Type combo box,select Tools.NOTE:Applets can be grouped by applet type on the device’s applet menu and on the carrier web site from which the user downloads applications for purchase.The supported applet types are Game,T ools,PIM,Web Applet,and Hidden.Hidden applets do not appear in the Application Manager on the device.They are activated when certain circumstances occur.A screen saver,for example,is a hidden applet.It is activated only after a predefined amount of inactivity occurs.NOTE:For the purposes of MyFirstApp,leave the Icon field blank.This field allows you to specify the path and filename for a medium-sized graphic image(approximately26x26pixels)you want to use in the MIF.When you leave the field blank,a default image is supplied by BREW.13.For MyFirstApp,it is not necessary to enter information on any of the other MIFEditor tabs.Choose File>Save As,assign the MIF the myfirstapp filename,and click Save.The Save As dialog box closes.14.In the MIF Editor window,click the Windows Close button.15.In the BREW Application Wizard window,click Finish.The New Project Information dialog box opens.16.Click OK.The Microsoft Visual C++window reopens with your new BREW application project loaded in the workspace.The Application Wizard has created the following files:•Project file(myfirstapp.dsp)•Workspace file(myfirstapp.dsw)•Application source file(myfirstapp.c)NOTE:Two other files required by BREW applications,AEEAppGen.c andAEEModGen.c,are included with the BREW SDK in the BREW/Src directory.These two files are automatically included in your new BREW project.17.Look over the source code for MyFirstApp and familiarize yourself with theinformation that was automatically generated by the BREW Application Wizard.18.When you’re ready to move on,proceed to Creating resources for MyFirstApp onpage26.Initial source code for myfirstapp.cWhen you have run the BREW Application Wizard,your source code looks like the following. /*========================================================================= FILE: myfirstapp.c=========================================================================*/ /*========================================================================= INCLUDES AND VARIABLE DEFINITIONS======================================================================== */#include "AEEModGen.h"// Module interface definitions#include "AEEAppGen.h"// Applet interface definitions#include "AEEShell.h"// Shell interface definitions/*-------------------------------------------------------------------Function Prototypes-------------------------------------------------------------------*/static boolean MyFirstApp_HandleEvent(IApplet * pi, AEEEvent eCode,uint16 wParam, uint32 dwParam);/*========================================================================= FUNCTION DEFINITIONS======================================================================== */ /*======================================================================== FUNCTION: AEEClsCreateInstanceDESCRIPTIONThis function is invoked while the app is being loaded. All Modules must provide this function. Ensure to retain the same name and parameters for this function. In here, the module must verify the ClassID and then invoke the AEEApplet_New() function that has been provided in AEEAppGen.c.After invoking AEEApplet_New(), this function can do app specificinitialization. In this example, a generic structure is provided so that app developers need not change app specific initialization section every time except for a call to IDisplay_InitAppData(). This is done as follows: InitAppData() is called to initialize AppletData instance. It is app developers responsibility to fill-in app data initialization code of InitAppData(). App developer is also responsible to release memoryallocated for data contained in AppletData -- this can be done inIDisplay_FreeAppData().PROTOTYPE:int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * po, void ** ppObj)PARAMETERS:clsID: [in]: Specifies the ClassID of the applet which is being loaded pIShell: [in]: Contains pointer to the IShell object.pIModule: pin]: Contains pointer to the IModule object to the current module to which this app belongsppObj: [out]: On return, *ppObj must point to a valid IApplet structure.Allocation of memory for this structure and initializing the base data members is done by AEEApplet_New().DEPENDENCIESnoneAEE_SUCCESS: If the app needs to be loaded and if AEEApplet_New()invocation was successfulEFAILED: If the app does not need to be loaded or if errors occurred in AEEApplet_New(). If this function returns FALSE, the app will not be loaded.SIDE EFFECTSnone=========================================================================*/ int AEEClsCreateInstance(AEECLSID ClsId,IShell * pIShell,IModule * po,void ** ppObj){*ppObj = NULL;if(ClsId == AEECLSID_MYFIRSTAPP){if(AEEApplet_New(sizeof(AEEApplet),ClsId,pIShell,po,(IApplet**) ppObj,(AEEHANDLER)MyFirstApp_HandleEvent,NULL)== TRUE){// Add your code here .....return (AEE_SUCCESS);}}return (EFAILED);}/*========================================================================= FUNCTION MyFirstApp_HandleEventDESCRIPTIONThis is the EventHandler for this app. All events to this app are handled in this function. All APPs must supply an Event Handler.PROTOTYPE:boolean MyFirstApp_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)PARAMETERS:pi: Pointer to the AEEApplet structure. This structure containsinformation specific to this applet. It was initialized during theAEEClsCreateInstance() function.ecode: Specifies the Event sent to this appletwParam, dwParam: Event specific data.DEPENDENCIESnoneTRUE: If the app has processed the eventFALSE: If the app did not process the eventSIDE EFFECTSnone=========================================================================*/ static boolean MyFirstApp_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam){switch (eCode){case EVT_APP_START:// Add your code here .....return(TRUE);case EVT_APP_STOP:// Add your code here .....return TRUE;default:break;}return FALSE;}Creating resources for MyFirstAppOne of the objectives for the creation of MyFirstApp(see page15)is to create a resource file that contains two text strings and a cursor image.You won’t always know up front all of the resources that a given application requires.In general,you will define the resources you know about in the BRI file and,using the Resource Editor Compiler,compile them into the BAR file that is used at runtime by the application DLL whenever resources are required.Then,as you define more controls for the application,you can add them to the BRI and compile when necessary.NOTE:If you have already defined resources and compiled them into the BAR file,and then modify those resources,it is not necessary to recompile your application source code to use those resources.If,however,you add new controls to the resource file(that is,if you change the-res.h file),you must recompile the application source code before they can be used by the application.To define the string resources for MyFirstApp1.Choose Start>Programs>BREW>BREW Resource Editor.The BREW Resource Editor window opens.2.Choose Resource>New String.NOTE:You can also right-click on String in either of the window panes,and choose New String.The String Resource dialog box opens.3.Make the entries shown above.A Resource ID number between1and5000is assigned automatically;however,you can change it if you want to assign a specific ID.The important thing toremember is that the ID must be a unique integer among string resources within the same resource file(BRI).So you can assign Resource ID1to two stringcontrols as long as you do not use them in the same BRI file.The Value field contains the actual string content for the resource.NOTE:Depending on the fonts supported by your target handset,you may need to change the entry in the String Format field.4.Repeat steps2and3to add your second string,making the entries shown below.5.Click OK.The String Resource dialog box closes,and the string resources you created appear in the right pane of the BREW Resource Editor window.6.Now you’re ready to create your image resource.To define the image resource for MyFirstApp1.With the Resource Editor window open,choose Resource>New Image.NOTE:You can also right-click on Image,and choose New Image.。
2010年第34期(总第169期)NO.34.2010(C um ula tive tyNO.169)摘要:随着3G手机业务的逐步发展,全球的软件开发商和手机运营上逐渐将目光转向了手机应用软件开发领域,美国高通公司从无线行业的需求出发设计出了BREW开发平台。
它比其它应用程序平台或成熟的操作系统小好几倍,是一些运营商开发商业级应用的唯一指定平台。
关键词:手机开发平台;B REW;BDS;AEE体系中图分类号:TP311 文献标识码:A文章编号:1009-2374(2010)34-0014-03近年来,中国移动通信市场保持快速稳定的增长。
根据工业和信息化部的统计,截至2009年8月底,国内手机数量已超过7.1亿。
而3G产品作为中国通信产业中重要的组成部分,正逐步扮演成为通信产业中重要的角色。
随着3G手机业务的逐步发展,全球的软件开发商和手机运营上逐渐将目光转向了手机应用软件开发领域。
为用户提供功能多样快捷方便的应用软件,成为众多手机运营商吸引顾客的新手段。
目前在移动领域广泛使用开发平台是Sun公司的J2ME,美国高通公司的BREW平台,Nokia的Symb ian平台,微软的Window s mobile平台,Linux平台,苹果公司的iPhone平台,以及g oogle公司的Android等多种手机应用开发平台。
美国高通公司作为CDMA(Code Divis ion Multiple-Acces s)的版权拥有者,从无线行业的需求出发设计出了BREW平台。
它比其它应用程序平台或成熟的操作系统小好几倍。
BREW是Bin ary Ru ntime Environm ent for Wireles s(无线二进制运行时环境)几个英文单词的缩写,它目标文件是二进制代码,不是中间解释程序。
它基于普及型编程语言C/C++开发,其轻量级API占用内存少,执行速度快。
BREW发布系统(BREW Distribution Syst em)使运营商可以轻松地将应用程序投放到市场,并协调结算和支付。
系列: BREW开发入门指南手机,这一再普通不过的通讯工具已成为人们随身携带的IT终端,而且重要性正超越电脑。
随着通讯技术的发展,3G、4G、5G……它的地位将越来越高。
在软件开发领域,从PC平台向手机平台转换也是很多人的必然之选。
IT界,“快鱼吃慢鱼”是永恒的真理。
本期,我们就为大家带来继J2ME之后当前最火爆的手机开发技术BREW,希望能给有志于手机软件开发的同学一个正确的指引。
手机软件开发新贵——BREW首先我们从字面意思来了解,BREW(Binary Runtime Environment for Wireless)的全称是无线二进制运行环境,是美国高通公司于2001年推出的基于CDMA网络“无线互联网发射平台” 上的增值业务开发运行的基本平台。
它主要用于无线应用程序和服务,结合数据和语音等功能,能够更好地满足逐渐成型的无线因特网用户需求。
相对Java,BREW是一个更底层的技术,主要应用在移动通信领域,类似于一个开放免费的中间件系统,其他厂商可以在这个平台上设计各项应用。
目前,支持BREW的手机也逐渐增多,主要是日系和韩系手机,例如LG向全球推出了15款支持BREW的手机,其中在中国市场可以买到LG 8188和LG 8280下面就让我们来细数BREW的种种优势吧!一、“钱”途无量的BREW根据高通公司2006年提供的资料,当时全球已有近1.5亿部支持BREW的手机。
预计到2008年底,全球将再增2亿部支持BREW的手机。
在商业模式上,高通选择的是和运营商合作的方式,通过运营商进行手机和业务的定制,从而促进BREW的发展。
事实证明了这种模式的成功,自2001年11月第一家运营商推出基于BREW的服务以来,整个BREW无线服务成功地保持了增长的势头。
从高通公布的官方资料来看,截至2006年6月,全球BREW发行商和开发商通过销售BREW应用和服务已获利超过7亿美元;而短短几个月之后,到2007年3月,这个数字已经突破10亿美元大关,这是BREW无线数据业务发展的重大里程碑,有力的证明了BREW产品和解决方案在全球稳定的和可持续的发展。