Главная » Просмотр файлов » Wiley.Developing.Software.for.Symbian.OS.2nd.Edition.Dec.2007

Wiley.Developing.Software.for.Symbian.OS.2nd.Edition.Dec.2007 (779887), страница 20

Файл №779887 Wiley.Developing.Software.for.Symbian.OS.2nd.Edition.Dec.2007 (Symbian Books) 20 страницаWiley.Developing.Software.for.Symbian.OS.2nd.Edition.Dec.2007 (779887) страница 202018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

Modules, called TSY modules, are installed to containthe implementation for the target device. An ETEL client will loadthe appropriate TSY, then use the ETEL-abstracted API to control thedevice. Symbian OS has many built-in TSYs for devices such as GPRSand GSM (these files end in .tsy).In addition to loading a connection agent, Nifman will load anetwork interface module (DLLs suffixed with .nif). This is usuallyPPP.nif, which implements the PPP data-link protocol.

This moduleuses the abstracted API of the communications server to transfer datato the device.•Serial Communications ServerThe serial communications server provides an abstraction for serialcommunication across multiple devices. Reading and writing serialdata and managing data flow control are example functions of thisabstracted API.

The details of the low-level protocols for handling aspecific device are implemented in DLL CSY modules (suffixed by.csy). Example CSY modules include IR, GPRS, and UART. CSYmodules communicate with the hardware through device drivers.The device drivers handle the actual control of the communicationshardware.Symbian OS v7.0 and previous versions could have only one activeIAP connection at a time. Symbian OS v7.0s introduced a multihomingcapability: the ability to have multiple IAP connections – each with itsown IP address – active at once. This is useful, for example, if you wantmultiple functions active that use different GPRS contexts (such as MMSand web browsing). Another example is having interfaces such as WLANand GPRS up at the same time.This feature opened up many possibilities for devices that supportmultiple ways of accessing the Internet and has become increasinglyimportant for smartphones built on Symbian OS v9.903.11SYMBIAN OS ARCHITECTUREApplication Engines and ServicesSymbian OS provides application engines to access and manipulate dataused by key applications, such as Calendar and Contacts.

This is usefulin creating companion applications that work in conjunction with them.API classes are provided to read and write calendar entries, to-do lists,and contact entries.Application services provide high-level utility functions for applications to use and consist of several client-side APIs and servers. Examplesare the alarm and log servers, which handle setting and initiating alarmsand logging various types of system information, respectively.3.12Platform SecurityPlatform security is a significant addition to Symbian OS v9.

The primaryrole of platform security is to ensure the integrity of the phone by restrictingaccess to sensitive functions and data only to software approved to accessthem.At a high level, platform security divides the system into three areas:the Trusted Computing Base (TCB), the Trusted Computing Environment(TCE), and applications, which may be trusted or untrusted, as shown inFigure 3.9.4 tiers of trustTrusted Computing Base:Has full ability to modify filesystem. Contains Kernel, F32and on open phones SWInstallTrusted Computing Environment:A large variety of system serversrunning with different privilegesMessagingEtelSWInstall is thegatekeeperWServKernel, F32, SWInstallMMFPart of the platform is lesstrustworthy.

Contains other signedsystem software and applicationsEsockThe rest of the platform isuntrustworthy. Contains otherunsigned system software andapplicationsFigure 3.9 Platform Security Tiers of TrustPLATFORM SECURITY91The TCB is the core software that has access to everything in thesystem. The kernel and the file server are examples of software that runsin the TCB.

The rest of the software on the device trusts that the TCBsoftware will behave correctly, and any code that runs in the TCB isreviewed very carefully.The TCE contains system components that access critical phoneresources, however, they are not granted blanket access, but only theparticular access needed. Functionality that runs in the TCE is usuallyimplemented in servers. Software at the application level communicateswith the TCE to access sensitive system functionality.Application-level software is typically less trustworthy and thus doesnot often have capabilities that allow access to sensitive functionality ofthe phone. However, applications do need certain user-level capabilitiesfor performing things like accessing the Internet, making a phone call orBluetooth connection, or accessing private user data.In addition to protecting access to critical functionality on the phone,platform security also provides a mechanism called data caging, whichallows an application to store data in a folder reserved for it that cannot be accessed by other applications (except for very high-privilegedapplications).Chapter 7 discusses platform security in detail and includes what theprogrammer needs to know to develop software for this architecture.Chapter 7 also covers the procedures necessary to get your applicationSymbian Signed, that is, getting your application signed with a digital signature trusted by the device to indicate that your application is approvedto access all the functions it uses.4Symbian OS Programming BasicsThis chapter focuses on the fundamentals of Symbian OS programming.So far, I’ve described smartphones in general, presented some steps to getstarted with the SDK, walked through some example code, and describedthe general architecture of the operating system.

This chapter, however,marks the real beginning of your Symbian OS programming training aswe get down to the basics.You will not find any references to S60 or UIQ in this chapter. The information presented here is generic for all platforms based on Symbian OS.I begin the chapter with an overview of the use of C++ in SymbianOS, followed by a look at the basic data types, the key types of classesyou’ll use and create, and the Symbian OS naming conventions. Then,I show how to program using the error-handling mechanism in SymbianOS, using leaves and traps, and how to use the cleanup stack. Next, Icover libraries in Symbian OS – both statically linked and DLLs.Finally, I summarize the key points to remember when writing SymbianOS software.4.1 Use of C++ in Symbian OSC++ is the primary language for software development on Symbian OSsince it provides the most efficient and natural interface to the systemlevel frameworks and APIs, which themselves are written in C++.

In fact,Symbian OS itself is written almost entirely in C++. The first version of theoperating system (known then as EPOC32) was created before C++ itselfwas formally standardized, that is, prior to 1998. For this reason, and thefact that C++ was not designed to be optimal on mobile devices, some ofthe later additions to C++, such as exceptions and namespaces, were notoriginally adopted by Symbian OS, although v9 has introduced them.When developing Symbian software, you’ll be using many of thestandard C++ language features, including inheritance, encapsulation,virtual functions, function overloading, and templates.94SYMBIAN OS PROGRAMMING BASICSThese language features are not only used for implementing yourapplication logic, but also in using the system APIs.

For example, someAPIs are abstract classes that your application classes can inherit fromand extend their functionality as needed. Other APIs are classes thatare instantiated and used directly. Still others are simple function callsimplemented as static class methods that can be called directly in thesame manner as C-based APIs – no class instantiation is required (thestatic API class User is a good example of this).4.2 Non-standard C++ CharacteristicsAlthough Symbian OS uses many of the object-oriented features of C++,some of its functionality is implemented in non-standard ways. Thiscan require an adjustment, even for experienced C++ programmers. Forexample, instead of ISO standard C++ exceptions, Symbian OS has itsown mechanism for exception handling in the event of conditions suchas low memory or a dropped Internet connection.

Also, Symbian OSdoes not provide a Standard Template Library (STL) and instead hasSymbian OS-specific implementation classes for functions such as stringmanipulation and complex collection types. Symbian decided on thiscourse for a variety of reasons, which include making the OS moreefficient for resource-constrained devices.To begin the discussion of Symbian OS basics, let’s start with the basicdata types.4.3 Basic Data TypesTo provide machine and compiler independence, Symbian OS providesa set of data types that should be used in place of the standard C++ types,such as int, long, and char.•TInt, TUint: An integer whose size is the natural machine wordlength (at least 32 bits). These are mapped to int and unsignedint.• TInt8, TInt16, TInt32: Signed integers of 8, 16, and 32 bits,respectively.• TUint8, TUint16, TUint32: Unsigned integers of 8, 16, and 32bits, respectively.• TInt64, TUint64: A 64-bit integer, which is typedef’d to longlong and unsigned long long, respectively from Symbian OS v9,and uses the available native 64-bit support.

Before Symbian OS v9,TInt64 was implemented as a class.SYMBIAN OS CLASSES•95TText8, TText16, TText: Simple character data. TText8 andTText16 are mapped to unsigned char and unsigned short,respectively. However, TText is the best one to use, since it willbe defined as either 8- or 16-bit, depending on whether or not yourapplication is configured for a Unicode build.• TChar: A class (as opposed to the simple typedefs used for theTText types) that represents a character.

It contains various characterdetection and manipulation methods, such as converting betweenupper and lower case, and checking whether it’s a control character.TText should be used if possible, since it has less overhead cost.TChar forms the basic building block for the string functionality inSymbian OS.• TBool: A Boolean type, whose value is either ETrue or EFalse.This type is mapped to int.•TReal32, TReal64, TReal: Floating point numbers. TReal64 andTReal both represent double-precision 64-bit real numbers and aremapped to the double data type. TReal32 represents a 32-bit floating point value. This smaller precision can be limiting; however, it’suseful in cases where performance is more important than precision.The smaller data size results in faster floating point operations.• TAny: Mapped to the standard void data type in C and C++.Symbian uses TAny* because it is more descriptive than void*when representing a ‘pointer to anything’. Functions that return novalue still use void, since in that case void is accurately descriptiveand compiler independent.The example below shows some sample declarations for the basic datatypes.TInt Foo(TInt aParm1, TText aParm2, TAny *aPtr)// returns an int// takes an int, a character, and a pointer{TInt var1;TChar dummyChar;dummyChar = ‘A’;for (TInt i=0;i<10;i++){ /* some stuff */ }dummyChar.LowerCase(); // converts the ‘A’ to ‘a’}4.4 Symbian OS ClassesThere are four main categories of C++ class in Symbian OS.

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

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

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

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