Wiley.Symbian.OS.C.plus.plus.for.Mobile.Phones.Aug.2007 (779890), страница 3
Текст из файла (страница 3)
One of Rick’shobbies is collecting qualifications. His first was in physics in the early1980s. After that he graduated in software engineering, going on to qualifyin french studies and classical history. His latest project is working towardan OU post-graduate degree in physical science, with a particular interestin quantum computing. On one particularly sad occasion, he sat andpassed the Mensa exam.Sanjeet MatharuSanjeet (Sanj) graduated from the University of Westminster in 1998 witha BSc in computing. He eventually found himself joining Symbian in2000 as a software engineer working on test tools. He developed much ofthe core code for the Symbian Test Automation Tool (STAT) which is nowused in a majority of integration testing for Symbian OS.
He also workedon a number of other tools within the System Test team as a developer,technical architect and project manager culminating in the creation ofthe Symbian Test Network (involving many hours of reverse engineeringand assembling rack-mount servers). This network is now used as a testharness for much of the Symbian OS testing.In 2004, he moved into Marketing and had a direct involvement inthe Symbian Signed program and Developer Certificates. Since then hehas moved on to manage the Symbian Signed program and the SymbianDeveloper Network with his core focus being on after-market applicationdevelopers and other developer programs such as Forum Nokia and SonyEricsson Developer World.
Sanj would like to thank his team for puttingup with his continual demands to get things done and his wife, Jaskie, forjust generally putting up with him.Tim WilliamsTim joined Symbian when it took over Origin’s Automation Technologygroup with which he had worked mainly on manufacturing controlsystems. An interest in user interfaces saw him work on the first S60phone and Symbian’s smartphone reference user interface. Currentlya technical author he was previously a user-interface specialist in theABOUT THE AUTHORSxviiSymbian Licensee Technical Consulting group.
Away from the office,he is normally riding his bike or coaching triathletes. He is married toHeather.Yang ZhangYang has a BEng in communication systems, an MSc in physics and a PhDin engineering. He has contributed a number of works to IEEE journals,international conferences and book chapters. He is now working forSymbian after years of industrial experience in the telecommunicationsdomain. His current interests include mobile social networking, mobilecomputing and mobile machine learning.AcknowledgementsWe would like to thank:The authors, who toiled hard and long to give us their manuscripts,and the technical reviewers who corrected and enhanced the text.Freddie Gjertsen, who gave us the opportunity to polish our egos bywriting another book, and Laura Sykes.Satu McNabb, for keeping our noses to the grindstone and makingsure that the work at each stage was completed – more or less – on time.Our colleagues, who answered our queries and bore additional workload as this volume demanded ever-increasing amounts of time.All those at Wiley who coaxed us into agreeing to a challengingschedule for delivery of the text and then, following delivery, added theirinimitable professional touches.Our families and friends who, throughout the long process of preparingthis book, saw much less of us than they had the right to expectSymbian Press AcknowledgmentsSymbian Press would like to thank Richard for not retiring too soon, andMark for more than helping him to bear the heavy burden of workingwith us.We’d also like to thank every member of the glittering crowd thatcontributed: the authors who worked so hard to create this book andthe reviewers who shared their expertise by reviewing the content.
Aspecial thank you to Adi for saving us as disaster loomed – very muchappreciated.And last but not least, Satu, Freddie, Laura, Mark, Jo, Phil and everyoneat Developer Product Marketing would like to wish Richard a relaxingretirement and every happiness in the future; it really has been a pleasureworking with you.About this bookSymbian OS C++ for Mobile Phones Volume 3 draws on the experienceof Symbian’s own engineers to provide a thorough grounding in writingC++ applications for mobile phones that use Symbian OS version 9.0 andbeyond.
It won’t teach you everything you need to know about developingSymbian OS applications – no single book could do that. However, itwill take you a long way along the road to being an effective SymbianOS developer, and give you a deep understanding of the fundamentalprinciples upon which Symbian OS is based. The text is complementedwith a specially developed suite of examples.The book is broadly organized into four sections:–Section one (Chapters 1 to 6) introduces Symbian OS itself, anddescribes the basic building blocks and usage patterns.–Section two (Chapters 7 to 11) explains the core concepts, resources,APIs and programming idioms that you need to create, test and publisha simple GUI (graphical user interface) application.–Section three (Chapters 12 to 18) provides a detailed description ofthe use of the Symbian OS graphical user interface to create non-trivialstand-alone applications.
It looks deeply into the effective use of theavailable range of graphics APIs and helps you to ensure that yourapplication code is as device-independent as possible.–Section four (Chapters 19 to 22) provides an introduction to some ofthe most significant and useful of the Symbian OS system services.Starting with a discussion of extensibility and the use of plug-ins, thissection continues with practically-based descriptions of the communications, multimedia and database services.xxivABOUT THIS BOOKSymbian OS is used in a variety of phones with widely differing screensizes.
Some have full alphanumeric keyboards, some have touch-sensitivescreens and some have neither. As far as possible, the material in this bookis independent of any particular user interface. However, real applicationsrun on real phones so, where necessary, we have chosen to use concreteexamples based on both the S60 and UIQ user interfaces. Whereverrelevant, the text explains the principal differences between these twouser interfaces. This kind of information is invaluable for anyone whowishes to create versions of an application to run on a variety of SymbianOS phones.Symbian OS C++ for Mobile Phones Volume 3 complements SymbianOS software development kits. When you’ve put this book down, theUIQ and S60 SDKs will be your first resource for reference informationon the central Symbian OS APIs that we cover here. For more specializedand up-to-date information relating to a specific mobile phone, youwill probably need to refer to a phone-specific SDK, available from therelevant manufacturer.The SDKs contain valuable guide material, examples and source code,which together add up to an essential developer resource.
We’ve pointedto these where they tie in with the book content. But as a general rule,look in the SDK anyway: you’ll usually find additional information thatexplains things further than we could in this one book.Who Is This Book For?If you’ve programmed, at any level, in C++, it’s for you.
As a real andcomprehensive system written in C++ from the ground up, and targetedat the high-growth area where computers and mobile communicationsconverge, Symbian OS gives you unparalleled opportunities in massmarket, enterprise and system programming.Besides C++ programmers, this book is of interest to other audiences:• any other programmer or manager looking to exploit the potential ofmobile solutions with Symbian OS technology• consultants, trainers and authors thinking of basing their activity onSymbian OS technology• anyone with an interest in system design, since Symbian OS is a fulland interesting example in its own right.ConventionsTo help you get the most from the text and keep track of what’s happening,we’ve used a number of conventions throughout the book.ABOUT THIS BOOKxxvThese boxes hold important, not-to-be forgotten information that isdirectly relevant to the surrounding text.We use several different fonts in the text of this book:When we refer to words you use in your code, such as variables,classes and functions, or refer to the name of a file, we use this style:iEikonEnv, ConstructL(), or e32base.h.URLs are written like this: www.symbian.com/developerAnd when we list code, or the contents of files, we use the followingconvention:Lines that show concepts directly related to the surrounding text areshown on a gray backgroundWe show commands typed at the command line like this:abld build winscw udebGlossaryACIDACS Publisher IDActorANSIAppUiAutomatic variableBLOBCapabilitiesChunkCLOBCONEContext switchControlA database operation should be atomic,consistent, isolated, durableClass 3 ID certificateSomething or someone (a system or end-user)with which or whom a use case scenario interactsAmerican National Standards InstituteA class that forms the core of an applicationa variable that is created automatically when it isrequired and destroyed when it goes out of scopeBinary Large ObjectAPI protection within Symbian OSA mechanism by which the kernel (memorymodel) allocates and manages memory, containsphysical RAM pages mapped to virtual addressesCharacter Large ObjectA control environment that provides the basicframework for controlsA task-switching facility to switch betweenprograms and keep track of the executionenvironment for the first programprovides the principal means of interactionbetween an application and the user; eachapplication view is a control, which forms thebasis of all dialogs and menu panesxxviiiCo-operativemultitaskingDBMSDFCDialogDLLECOMEKA2EshellEvent-drivenApplicationFEPFIFOGCGUIIMEIIPCISRMBMMetrowerks TargetNon-pre-emptiveMultitaskingPanicPlug-inPre-emptiveMultitaskingGLOSSARYA multitasking environment in which multipleprograms running on a CPU voluntarily yieldcontrol of the processor to each otherDatabase Management SystemA deferred function call that forms part of thedriver non-ISR processingA specialized window-owning compound control.Dynamic Linked LibraryA system service developed with the expresspurpose of enabling application extensibilityThe Symbian OS kernel architectureA simple command-line-mode shellAn application that is always waiting for the userto interact with the device and then carries outsome operation in response to that interactionFront-end processorFirst-in, first-out orderGraphics contextGraphical user interfaceA unique number used by the GSM network toidentify valid devicesInter-Process CommunicationInterrupt-Service RoutineMulti-bitmap file format; a graphics format usedby Symbian OSA Symbian OS application that runs inside the OSand resident kernel and provides debuggingservices over serial communications (MetroTRK)see co-operative multitaskingA run-time failure in a programA computer program that interacts with a main (orhost) application (a web browser or an emailprogram, for example) to provide a certain,usually very specific, function on-demand.A multitasking environment in which theoperating system determines when and for howlong a program has control of the processorGLOSSARYProcessRDBMSReal-timeNanokernelRound robinScalable vectorgraphicsSIDStoreStreamThreadTwo-phaseconstructionUse caseView serverViewWindow serverXMLxxixA running instance of a program; unit of memoryprotectionA relational-database management systemThe core of the modern Symbian OS kernelarchitecture (EKA2)an operating-system scheduling algorithm whichallocates equal processing time to all activeprocessesA format for icons, introduced by S60 3rd editionSecure IDA collection of streams, generally used toimplement the persistence of objectsAn external representation of one or more objectsThe basic unit of execution – a sequence ofinstructions that can be executedA mechanism that separates the safe constructions(which can be put into the constructor) from theunsafe constructionsA complete sequence of actions, initiated by anactor, that represents a particular way of using asystem; often used for test scenariosAerver with which each application may registerits viewsA class that implements an interface to the viewarchitectureA server that ensures that the correct window orwindows are displayed, managing overlaps andexposing and hiding windows as necessaryExtensible Markup Language1Getting StartedIt seems to be traditional to start a book on computer programmingwith a ‘Hello World’ example and, although this book is more about anoperating system than a programming language, we are following thattradition.