quick_recipes (779892), страница 3

Файл №779892 quick_recipes (Symbian Books) 3 страницаquick_recipes (779892) страница 32018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 3)

An additional benefit to using theconventions is that your code can then be tested with automatic codeanalysis tools, which can flag potential bugs or areas to review.The best way to get used to the conventions is to look at code snippetsin this book, and those provided with your chosen SDK.1.1 CapitalizationThe first letter of class names is capitalized:Class TColor;The words making up variable, class, or function names are adjoining,with the first letter of each word capitalized. Classes and functions havexxviSYMBIAN OS CODE CONVENTIONS AND NOTATIONS USED IN THE BOOKtheir initial letter capitalized while, in contrast, function parameters, local,global, and member variables have a lower case first letter.Apart from the first letter of each word, the rest of each word is givenin lower case, including acronyms.

For example:void CalculateScore(TInt aCorrectAnswers, TInt aQuestionsAnswered);class CActiveScheduler;TInt localVariable;CShape* iShape;class CBbc;//Acronyms are not usually written in upper case1.2 PrefixesMember variables are prefixed with a lower case ‘i’, which stands for‘instance’:TInt iCount;CBackground* iBitmap;Parameters are prefixed with a lower case ‘a’, which stands for ‘argument’. We do not use ‘an’ for arguments that start with a vowel.void ExampleFunction(TBool aExampleBool, const TDesC& aName);(Note: TBool aExampleBool rather than TBool anExampleBool).Local variables have no prefix:TInt localVariable;CMyClass* ptr = NULL;Class names should be prefixed with the letter appropriate to theirSymbian OS type (usually ‘C’, ‘R’, ‘T’, or ‘M’), as will be described furtherin Chapter 3:classclassclassclassCActive;TParse;RFs;MCallback;Constants are prefixed with ‘K’:const TInt KMaxFilenameLength = 256;#define KMaxFilenameLength 256SYMBIAN OS CODE CONVENTIONS AND NOTATIONS USED IN THE BOOK xxviiEnumerations are simple types, and so are prefixed with ‘T’.

Enumeration members are prefixed with ‘E’:enum TWeekdays {EMonday, ETuesday, ...};1.3 SuffixesA trailing ‘L’ on a function name indicates that the function may leave:void AllocL();A trailing ‘C’ on a function name indicates that the function returns apointer that has been pushed onto the cleanup stack:Ccylon* NewLC();A trailing ‘D’ on a function name means that it will result in thedeletion of the object referred to by the function:TInt ExecuteLD(TInt aResourceId);1Introduction and SetupThe first part of this chapter will help you set up your developmentenvironment using free tools.While your computer is busy downloading and installing software, youshould read the second part of this chapter.

It contains a host of criticalinformation you need before you start using the development tools.When all the tools are installed, there are a few more minor configuration steps to go through in the last part of this chapter.1.1 Tools: What You Need and Where to Find It1.1.1 System RequirementsSystem requirements for C++ development on Symbian OS v9.x are asfollows:• Microsoft Windows 2000 Professional with Service Pack 3 or MSWindows XP Professional with Service Pack 2, running on a laptop ordesktop computer. At the time of writing this book, most Symbian OSSDKs do not support Windows Vista.• At least 512 MB of RAM (1.5 GB recommended).• 1-GHz or faster Pentium-class processor (2-GHz Pentium-class processor recommended).• At least 1 GB of free disk space (5 GB recommended).• 16-bit color display capable of a 1,024 × 768 pixels resolution.• Java Runtime Environment (JRE) 1.4.1 02 or later (available fromjava.sun.com).• ActivePerl 5.6.1 build 568 or later (available from activestate.com).2INTRODUCTION AND SETUP• Microsoft Core XML Services (MSXML) 4.0.• ZIP decompression software to open the installation package.• Local-administrator rights for installation and removal of software.• The PC Suite software for your handset.

You should find the latestversion of this software on the website of the manufacturer of thehandset.ActivePerl may be bundled in some of the Software Development Kitpackages you will be installing.1.1.2 IDEThe recommended Integrated Development Environment for SymbianOS C++ development is called Carbide.c++. You can download the freeExpress Edition from: forum.nokia.com/carbide. Section 1.2.1 describesCarbide.c++ in more detail.1.1.3 SDKsSymbian OS is split into two platforms: S60 3rd Edition and UIQ 3. (Thereis a third one, called MOAP, available only in Japan, which this bookdoesn’t cover.)Each platform is replaced as different versions (or Feature Pack numbersfor S60).Once you know which handsets you want your applications torun on, you can identify all your target platforms and their versionusing the following websites: www.s60.com/life/s60phone (for S60) andwww.uiq.com/uiqphones (for UIQ).You need to download all the SDKs for all your target platforms.

At thetime of writing, this could mean up to five different SDKs for developmenton Symbian OS v9.x: S60 3rd Edition Maintenance Release, Feature Pack1 and Feature Pack 2 Beta, along with UIQ 3.0 and UIQ 3.1.The SDKs can be downloaded from: developer.symbian.com/main/tools.1.1.4 CompilersThere are two free compilers used for Symbian OS C++ development.The Nokia x86 compiler targets the Symbian OS emulator for MicrosoftWindows included in the SDK. You will see this referenced as WINSCW.The open source GCC-E compiler targets the actual handsets, whereSymbian OS runs on an ARM processor.Both compilers should be bundled in the SDK installation package,but GCC-E must be installed to a folder whose path contains no ‘space’characters or your builds will fail with ‘missing separator’ errors.WHILE YOU ARE WAITING31.2 While You are Waiting1.2.1 Carbide.c++There are four different editions of Carbide.c++:• Express Edition• Developer Edition• Professional Edition• OEM Edition.The free Express Edition is the only one that doesn’t allow debuggingan application running on the actual phone (on-target debugging).

Allversions allow emulator debugging.Carbide.c++ is based on Eclipse and is highly customizable. You caneven create your own plug-ins to extend its functionality.When you first launch Carbide.c++ it allows you to define a ‘workspace’. We suggest you create a different workspace for each SDK.There is a very nice Flash tutorial to introduce Carbide.c++ atdeveloper.symbian.com/main/learning/flash, and a booklet about getting started with Carbide.c++ available from developer.symbian.com/carbide booklet wikipage.1.2.2 Development CommunitiesIn order to get more information, meet your fellow developers, askquestions and find out the solutions for common problems, you shouldvisit the following links:• Symbian Developer Network: developer.symbian.com.• Forum Nokia: forum.nokia.com.• UIQ Developer Community: developer.uiq.com.• Sony Ericsson Developer Forum: developer.sonyericsson.com.• MOTODEV Developer Forum: developer.motorola.com.While you are waiting, you should register on, at the very least, thefollowing website:• Symbian Signed: www.symbiansigned.com.There are also many independent sites, which contain a lot of helpfuland educational information; for instance, www.newlc.com.4INTRODUCTION AND SETUP1.2.3 Concepts of Mobile DevelopmentOn an open operating system such as Symbian OS, third-party developerslike you can install their own applications.Programming for smartphones puts you in a position where youhave quite limited resources, such as CPU capabilities, battery power,input methods, available memory amount and so on.

Software developerstargeting such a challenging environment need to focus on code efficiencyand robustness more than they may be used to for desktop platforms.We are working in an environment where any heap memory allocationcan fail and where the cost of forcing the CPU to switch between processes(or even between threads) is non-negligible.Several Symbian OS development efforts are worth being aware of:• Open Source projects at www.symbianos.org.• P.I.P.S. and Open C are there to help you port applications using thePosix libraries to Symbian OS (see www.forum.nokia.com/openc).• The Standard Template Library is being ported to Symbian OS.• The Net60 framework from Red Five Labs allows you to use Microsoft.NET Compact Framework (see www.redfivelabs.com).• There are runtime environments for Java, Ruby and Python availablefor Symbian OS (see developer.symbian.com/main/getstarted/hub/runtimes hub.jsp).1.2.4 ARM HardwareWhen targeting the actual handset, Symbian OS binaries are based onthe Application Binary Interface (ABI) for the ARM Architecture.

ABI is astandard for the interfaces of binary code running in ARM environments.The specification is published by ARM at: www.arm.com/products/DevTools/ABI.html.We will not go into the details of various ARM instruction sets and ABIversions in this book.1.2.5 EmulatorIn addition to debugging using a stack trace, breakpoints and variablemonitoring, the emulator allows you to test your deployment packages toensure your application will be installed properly on the real smartphone.The S60 emulator preferences allow you to set up several usefulparameters, like Bluetooth and IrDA (Infrared) ports and platform securityWHILE YOU ARE WAITING5Figure 1.1 S60 Utilitiessettings.

In addition, the emulator has a powerful utilities applicationwhich helps you test your software by triggering various events, likememory card insertion (Figure 1.1).The UIQ emulator also offers some configuration capabilities via aseparate utility – SDKConfig (Figure 1.2) – a graphical configuration toollocated in the . . . \epoc32\tools\distrib folder of your SDK.Figure 1.2 UIQ SDK Configurator6INTRODUCTION AND SETUPSDKConfig launches a number of scripts from . . .

\epoc32\tools.This utility can be used to select the default device, change the UI style ofthe emulator and set up communication ports and Ethernet connection.The easiest way to define Ethernet setting is to use DHCP and uncheck the‘Modify MAC-address’ checkbox.1.3 Post-Installation1.3.1 Command Line ToolsWithout arguments, the devices command lists all the installed SDKsfrom a DOS prompt:S60_3rd:com.nokia.s60S60_3rd_FP2_Beta:com.nokia.s60 - defaultS60_3rd_FP1:com.nokia.s60UIQ3.1:com.symbian.UIQIt also allows you to switch between SDKs as follows:devices -setdefault @S60_3rd_FP1:com.nokia.s601.3.2 SDK Directories StructureEach SDK installs its own emulator binaries, handset libraries, tools codeexamples and documentation on your hard drive..

Характеристики

Тип файла
PDF-файл
Размер
1,59 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6367
Авторов
на СтудИзбе
309
Средний доход
с одного платного файла
Обучение Подробнее