quick_recipes (779892), страница 2
Текст из файла (страница 2)
Or perhaps you have to investigatewhether Symbian OS could be suited to an idea from a designer friend ofyours. But the trouble is, you don’t have much time, and you have heardthat Symbian OS is a sophisticated and rich software system with a notinsignificant learning curve.If you are like the majority of software engineers, you would like totake some time to investigate this kind of task. You might prefer to attenda training course, or work your way through some of the comprehensivereference material that already exists for Symbian OS. However, I guessthat you don’t have the luxury of doing that – because you are facingtight schedule pressures.
There isn’t sufficient slack in your schedule toresearch options as widely as you’d like. Your manager is expecting yourreport by the end of the week. So you need answers in a hurry.That’s why Symbian Press commissioned the book you are now holdingin your hands. We are assuming that you are a bright, savvy, experiencedsoftware developer, who is already familiar with C++ and with modernsoftware programming methods and idioms. You are willing to workhard and can learn fast. You are ready to take things on trust for awhile, provided you can quickly find out how to perform various taskswithin Symbian OS. Over time, you would like to learn more about thebackground and deeper principles behind Symbian OS, but that will haveto wait – since at the moment, you’re looking for quick recipes.xviFOREWORDCongratulations, you have found them!In the pages ahead, you will find recipes covering topics such asBluetooth, networking, location-based services, multimedia, telephony,file handling, personal information management – and much more.
Inmost recipes we provide working code fragments that you should beable to copy and paste directly into your own programs, and we provide a full set of sample code for download from the book’s website(developer.symbian.com/quickrecipesbook). We have also listed somecommon gotchas, so you can steer clear of these potential pitfalls.Since you are in a hurry, I will stop writing now (even though there islots more I would like to discuss with you), so that you can proceed atfull pace into the material in the following pages. Good speed!David Wood, Symbian, March 2008About this BookThis book sets out to accomplish two goals:• For readers who don’t know Symbian OS C++ development, this bookis a two-week crash-course in developing applications for mobilephones.• For readers who know Symbian OS C++ development, this bookexplains how to use 10 different technologies in a condensed form.It can be used as a desk reference or to learn a new technology in afamiliar environment.The focus of the book is on the reader being able to manage the timeit takes to understand and implement the new concepts in Symbian OS.Chapter 1 will explain how to set up a development environment.
Italso contains useful information for you to read while you wait for yoursoftware development kit to download and install.Chapter 2 is about your first HelloWorld application and basic use ofthe new toolchain.Chapter 3 explains the essentials of the common Symbian C++ APIsand idioms. Without understanding these, you cannot make much progress.Chapter 4 is the main course of this book. It consists of recipesfor ten self-contained technologies, each explained as a time-bounddevelopment learning task.
For each technology, the recipes are listed inorder of increasing complexity.Chapter 5 will help you reach the next level of Symbian OS development expertise.Chapter 6 is dedicated to commercial-grade application development.xviiiABOUT THIS BOOKThis book is by no means an introduction to software development ingeneral or even to the C++ language. The authors expect the readers tobe familiar with both.We have included some links to help you find additional information, but to avoid repetition, we don’t always refer you to theSymbian Developer Library API reference documentation wheneverwe introduce a new API. It’s worth mentioning it here though.
You’llfind a huge amount of reference material in the Symbian DeveloperLibrary, which is available in every SDK, and can also be browsedonline on the Symbian Developer Network (developer.symbian.com/main/oslibrary/osdocs). Chapter 6, Section 6.3 contains other links andsuggestions for how to get more information.About the AuthorsMichael AubertMichael has worked on Symbian OS for 7 years, in the Java teamat Symbian itself and the R&D team at iAnywhere. During that time,he has received in-depth exposure to a wide range of technologiesincluding telephony, messaging, 3D graphics, networking, multimedia,PIM, cryptography, platform security and software deployment.He holds an MSc in Software Engineering from E.S.I.A.L. and isprobably the only person to have ever explained the crazy Java TeamEvent Server Framework to a French audience.Alexey GusevAlexey started to play with mainframes at the end of the 1980s, usingPascal and REXX, but soon switched to C/C++ and Java on differentplatforms before moving into mobile technologies.
After working foralmost a decade as a team leader and architect on Windows Mobile, hedecided to join the Symbian Core Development team, originally workingon Security and later on USB.He holds an MSc in Applied Mathematics and Physics from theMoscow Institute of Physics and Technology.
He is also an AccreditedSymbian Developer and regular author at www.developer.com.Tanzim HusainTanzim joined Symbian in 2004 as a member of the networking technology team and has worked there ever since, surviving two architecturalxxABOUT THE AUTHORSchanges and three team re-organizations. Before joining Symbian, heworked extensively on Windows Mobile, delivering pioneering applications in the areas of mapping and GIS.Tanzim holds a B.S.
in Computer Science from NSU. Outside work,he likes to fiddle around with photography and enjoys escaping to thecountryside. He tries to maintain an infrequently updated website/blog atwww.tanzim.co.uk.Jenny MulhollandSince graduating with an MSc in Physics from the University of Cambridgein 2006, Jenny has worked in Symbian’s Licensee Product Developmentteam, as a member of the Comms Porting Group. Jenny recently renewedher Accredited Symbian Developer status.Outside of work, when she is not in the pub with her colleagues, sheenjoys performing concerts with the Chandos Chamber Choir and hasrecently taken up the flute.Antony PranataAntony holds an MSc in Information Technology from the University ofStuttgart, Germany.He has been involved in a number of Symbian OS projects in differenttechnology areas, including security, tools, multimedia and locationbased services.
He currently works for Nokia in Canada.Antony is a Forum Nokia Champion, Accredited Symbian Developerand Accredited S60 Developer. He has a personal website and blog atwww.antonypranata.com. He now lives in Vancouver with his wife, Emi.Jukka SilvennoinenJukka holds a PhD in Computer Information Systems.Before joining Forum Nokia recently, he spent several years developingmany Symbian OS applications, mainly for the Asian markets. As acertified Nokia Trainer he was also a visiting lecturer in one of the bestuniversities in Thailand.Jukka can often be found haunting the Forum Nokia developer discussion boards and wiki.
He recently renewed his Accredited SymbianDeveloper and Accredited S60 Developer status.ABOUT THE AUTHORSxxiJo StichburyJo is Senior Technical Editor with Symbian Press. She has worked withinthe Symbian ecosystem since 1997; in the Base, Connectivity and Securityteams of Symbian, as well as for Advansys, Sony Ericsson and Nokia.Jo is the author of Symbian OS Explained: Effective C++ Programmingfor Smartphones, published by Symbian Press in 2004; she also coauthored The Accredited Symbian Developer Primer: Fundamentals ofSymbian OS with Mark Jacobs, in 2006.
Her most recent publication isGames on Symbian OS: A Handbook for Mobile Development, publishedin early 2008.Jo became an Accredited Symbian Developer in 2005 and a ForumNokia Champion in 2006 and 2007.AcknowledgmentsThe authors would like to thank the Symbian Press team for allowing usthis opportunity, for their patience and for making the process as smoothas possible.The authors would also like to thank all the technical reviewers fortheir invaluable comments and for stopping us from making fools ofourselves.Michael would like to thank: my fellow authors on this book formaking me look cleverer than I am, the kind people at Symbian Pressfor entrusting this project to a new author, David Wood for initiating theproject, my family and my current or former colleagues for their help andinspiration.Tanzim would like to thank: my great colleagues, particularly Nadeem,Tom and Petr, for their insightful knowledge of the Symbian OS networking architecture, and my fellow authors for their helpful suggestions.Jenny would like to thank: Aaron for all the weekends when his livingroom became my study, and the Quick Recipes team for all their help.Antony would like to thank: Emi for her support and understandingduring this project and my uncle, William Suryawijaya, for introducingme to the wonderful world of programming back in the 1990s.Symbian Press would like to thank: each of the authors, who gave up somuch of their time to contribute to this book, and our technical reviewers,for their generous feedback.
In particular, we’d also like to thank Tanzimfor dropping everything to work with us on the copy edits. We’d also liketo thank Daniel Mattioli, for letting us ‘borrow’ Tanzim, and EmmanouilPapathanassiou and Neil Taylor, for help with our example code.Symbian OS Code Conventionsand Notations Used in the BookFor you to get the most out of this book, let’s quickly run through thenotation we use. The text is straightforward, and where we quote examplecode, resource files, or project definition files, they will be highlighted asfollows:This is example code;Symbian C++ uses established naming conventions. We encourage youto follow them too, in order for your own code to be understood mosteasily by other Symbian OS developers, and because the conventionshave been chosen carefully to reflect object cleanup and ownership,and make code more comprehensible.