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

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

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

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

The example target platform line:[0x101F7961], 0, 0, 0, {"S60ProductID"}is a requisite statement that the ‘component’ named S60ProductID,with a UID of 0x101F7961, and version number 0.0.0 or higher, mustexist in order for the installation to continue. Note that in the case ofhardware dependency, like the case just mentioned, brackets are used toenclose the UID instead of parentheses.5.9.4Language SupportMultiple translated versions of an application can exist within a singleSIS file. When a user installs a SIS file, they are prompted to select whichlanguage they would like installed.To specify the language variants that you want to be included, add alanguage line at the top of your PKG file.

The language line begins with‘&’ and contains a list of comma-separated language codes. Below is alist of some common languages. Reference the Symbian OS library in theSDK documentation for the complete list.AM – US EnglishAS – Austrian GermanAU – Australian EnglishBF – Belgian FrenchBL – Belgian FlemishCS – CzechDA – DanishDU – DutchEN – UK EnglishFI – FinnishFR – FrenchGE – German158SYMBIAN OS BUILD ENVIRONMENTHK – Hong Kong ChineseHU – HungarianIC – IcelandicIF – International FrenchIT – ItalianJA – JapaneseNO – NorwegianNZ – New ZealandPL – PolishPO – PortugueseRU – RussianSF – Swiss FrenchSG – Swiss GermanSK – SlovakSL – SlovenianSP – SpanishSW – SwedishTC – Taiwan ChineseTH – ThaiTU – TurkishZH – Prc ChineseAn example language line is:&EN, FR, FIwhich specifies that the SIS file contains English, French, and Finnishlanguage variants.If a language line is not included, &EN is assumed.How does makesis use the language information?So far, we have used only language-independent statements in oursample PKG file, which will install exactly the same regardless of anadded language line, or a language selection by the user.In order to use the language information, you must use languagedependent versions of the applicable PKG statements.Language-dependent filesThe first rule in internationalizing an application is to keep the languagedependent parts of your application separate (i.e., in different files) fromthe language-independent parts.

For example, Symbian OS uses resourcefiles to contain text strings, and a separate resource file would exist forINSTALLING APPLICATIONS ON THE SMARTPHONE159each language. When the user selects a particular language to install, youwant to install the appropriate resource file for that language.As an example, the following .PKG line specifies the installation of aresource file based on the language:&EN, FR, FI...{"c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.en","c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.fr"," c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.fi",}-"!\resource\apps\SimpleEx.rsc"In this example, makesis includes all three resource files in the SIS file.However, the language chosen during the installation determines whichfile is actually copied to smartphone file \resource\apps\SimpleEx.rsc.

The order in which the source files are listed must agree with theorder of the languages in the language statement – so that UK Englishchooses SimpleEx.en, French chooses SimpleEx.fr, and Finnishchooses SimpleEx.fi.Note that, if you use this language-dependent version of a file specification line, you must include a source file for each of the languages listedin the language line.As another example, you could also have language-dependent versionsof a text notice, such as:{"license.en.txt","license.fr.txt","license.fi.txt"} - " ", FILETEXT,TEXTCONTINUEOther language-dependent statementsWhen specifying multiple languages you will need to ensure that yourproduct header provides a component name for each language, and thatyour target platform lines (as well as other requisite lines) provide productid strings for each language.

Although it is common for the componentname to be in English for each language variant, there still needs to bea string entered for each language, otherwise an error will occur whenmakesis runs.The following shows the PKG file shown previously with modificationto support multiple languages.; SimpleEx.pkg - S60;&EN,FR,FI; standard SIS file header#{"SimpleEx_EN","SimpleEx_FR","SimpleEx_FI"},(0x10005B94),1,0,0;Supports S60160SYMBIAN OS BUILD ENVIRONMENT[0x101F7961], 0, 0, 0, {"S60ProductID","S60ProductID","S60ProductID"}"c:\Symbian\9.2\S60_3rd_FP1\epoc32\release\gcce\urel\SimpleEx.exe"-"!:\sys\bin\SimpleEx.exe""c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.rsc"-"!:\resource\apps\SimpleEx.rsc"{"c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.en","c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.fr"," c:\Symbian\9.2\S60_3rd_FP1 \epoc32\data\z\resource\apps\SimpleEx.fi",} -"!\resource\apps\SimpleEx.rsc"5.9.5Signing Your SIS FileAs mentioned in Chapter 2, in Symbian OS v9 you must have your SIS filedigitally signed before it can be installed on the phone.

You can sign theapplication yourself using the signsis tool if either your application hasno security capabilities (i.e., no CAPABILITY line or CAPABILITY Nonein your MMP file or Carbide project), if you have a developer certificateor if your application contains only user-level capabilities. Applicationsigning is discussed in detail in Chapter 7.6Strings, Buffers, and Data CollectionsThis chapter covers the basic string and data buffer APIs, as well as othercommon data organization classes. These classes are part of what isknown in Symbian OS as the Base APIs, and they reside in euser.dll.This chapter covers the following types of data classes:•Descriptors for handling strings and binary data.•Dynamic buffers for buffers that grow at runtime.•Array classes.•Other data organization classes like linked lists and circular queues.The chapter includes numerous examples, and the complete source ofthe examples can be downloaded from the book’s website.

The examplesoutput their results via a printf()-style function, to what is known asa text console.Before diving into string and buffer management, let’s take a look athow a text console program works. This provides an easy way to compileand run the examples in this chapter on the emulator and do experimentsof your own without writing a full GUI program.6.1 Introducing the Text ConsoleSymbian OS provides a text console API class called CConsoleBasethat allows you to output formatted text to the screen, without theoverhead of using the GUI framework.

The class also accepts keyboardinput. While the text console is not very useful for product software, it’sexcellent for learning and experimenting with non-GUI-related SymbianOS functionality.162STRINGS, BUFFERS, AND DATA COLLECTIONSBelow is a very minimal console CPP file that outputs ‘Hello’ to thetext console so you can get the general idea. For simplicity, the exampledoes not TRAP the call to the Console::NewL() leaving function, buta later example shows how this should be done correctly, to ensure thatE32Main() doesn’t contain functions that can leave.#include <e32base.h>#include <e32cons.h>CConsoleBase* console;TInt E32Main(){_LIT(KName,"Tests");_LIT(KAnyKey,"[Press any key]");console=Console::NewL(KName,TSize(KConsFullScreen,KConsFullScreen));console->Printf(_L("Hello\n"));console->Printf(KAnyKey);console->Getch();delete console;return(0);}Symbian OS uses LIT and L to define string literals.

We will discussthem in section 6.2.3.CConsoleBase::Printf() works in much the same way that astandard C printf() function works – it accepts a format string, anda variable number of arguments to output using the specified formattedstring.

The above example shows the simplest possible form, with noformat elements or arguments beyond the text string itself. The formatstring has the same syntax as the C printf() format string, but has someextra, Symbian OS-specific format identifiers. For example, %S is used toprint the contents of a string descriptor – you will use that one frequently.The method CConsoleBase::Getch() is used to wait for andretrieve a key from the keyboard, although the return value is discarded.The following example shows an expanded version of a consoleprogram that provides a general framework for running experiments,including the examples in this chapter. It also correctly creates a cleanupstack and handles error leaves correctly.#include <e32base.h>#include <e32cons.h>CConsoleBase* console;void RunExampleL(){console->Printf(_L("Example Code\n"));// Add example code here}void RunConsoleL(){_LIT(KName,"Tests");console=Console::NewL(KName,TSize(KConsFullScreen,KConsFullScreen));CleanupStack::PushL(console);INTRODUCING THE TEXT CONSOLE163RunExampleL();_LIT(KAnyKey,"[Press any key]\n");console->Printf(KAnyKey);console->Getch();CleanupStack::PopAndDestroy(console);}TInt E32Main(){__UHEAP_MARK;CTrapCleanup* cleanupStack = CTrapCleanup::New();TRAPD(error,RunConsoleL());__ASSERT_ALWAYS((KErrNone!=error),User::Panic(_L("Example"),error));delete cleanupStack;__UHEAP_MARKEND;return(0);}The code in E32Main() creates a cleanup stack for your test codeto use if needed.

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

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

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

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