Главная » Просмотр файлов » John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG

John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (779881), страница 7

Файл №779881 John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (Symbian Books) 7 страницаJohn.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG2018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

These will need to be installed on your PC before we moveon to creating our first OPL program, "Hello World".2.3.1Text Editor ApplicationYou will need a program to enter the source code into a plain textfile. Notepad ships as part of every Windows installation and you can(if you wish) use Notepad for all your source code needs. But thereare other text editors out there that are geared towards programmersentering source code on their PC.

Three of the more popular choices areTextPad (www.textpad.org/), Crimson (www.crimsoneditor.com/), andSource Edit (www.sourceedit.com/). All OPL needs is the source codesaved as an ASCII (ANSI) text file. The OPL translator on the PC does notuse Unicode text files.GATHERING TOOLS232.3.2 C++ SDKUnless you have good reason, you should use the default paths wheninstalling the SDK, and install all the optional components.

This will makeit easier to use the command line tools and follow the examples in thisbook.Series 60 and CommunicatorsThe regular C++ SDK can be used. Links and information can be foundon the accompanying website www.symbian.com/books/rmed/rmedinfo.html. Alternatively, the SDKs can be downloaded at Forum Nokia(http://forum.nokia.com).UIQWhile you are not going to be using C++ to code your programs, the UIQC++ SDK has many of the underlying files and tools that need to be presenton your PC to develop in OPL. The easiest way to have these in placeis to install the SDK from www.symbian.com/developer/sdks uiq.asp.There is more than one download type for the UIQ SDK, so you shouldmake sure that you download the Metrowerks Codewarrior UIQ SDK.Links and information can be found on the accompanying website,www.symbian.com/books/rmed/rmed-info.html.What if I Want to Program for Communicator or Series 60 Phones?There is nothing to stop OPL programs being compiled using the UIQSDK running on non-UIQ, Symbian OS phones.

Because OPL is filecompatible across the range you can compile with any of the SDKs, andthe resulting object code should run on other phones. It is recommendedyou install the SDK for the primary machine you will be programming on.As we work through our examples, we’ll show you how your OPLcode can be written so you only have to maintain one version that willrun over all the OPL runtimes for Symbian OS.For the purposes of this book, we’ll assume you are using only the UIQSDK and you have not altered the files or folder names from the defaultvalues.2.3.3 OPL Developer’s PackSymbian OS licensees do not ship OPL as part of the standard SDKs, soyou will need to add these elements in yourself.

The OPL SourceForgeProject page will provide you with the relevant OPL Developer’s Pack.Download: http://opl-dev.sourceforge.net/. You’ll need to copy andplace the files in the correct directories manually, but this is covered indetail in the accompanying documentation.242.3.4INTRODUCING THE TOOLS OF OPLThe OPL RuntimeThe OPL Runtime for your phone is a standard .sis file and can be installedjust like any other program. The file will be found on the SourceForgesite along with the Developer Pack. Assuming you have the PC Suiteinstalled for your phone, double clicking the .sis file will start the PCSuite’s installer program and place the runtime onto your phone.2.3.5 Command Line ToolsNow the above elements are in place, you have access to three tools thatare run from the command line on your PC.OPLTran (the PC-Based Translator)OPLTran is the primary tool for taking OPL source code and creatingobject code.

The command syntax is:OPLTRAN <sourcefile> <flags> <output file> <flags>When installing the UIQ C++ SDK your PC’s PATH variable will beupdated, adding the directory that holds all the command line tools. Thismeans you can use the tool from any directory on your PC.Open up the command line on your PC (use Start | Run ‘cmd.exe’on Windows 2000/XP, or ‘command.com’ if you’re using Windows 98).You need to navigate to the directory holding your OPL source.

If you areusing the suggested folder structure, this will be C:\OPL\Tim\Source\(assuming the project is called ‘Tim’). To translate the Tim source codefile (Tim.tpl) you would type in:OPLTRAN Tim.tpl Tim.opoThe resulting .opo file can then be copied to C:\OPL\Tim\Compiled\.Alternatively, you could use:OPLTRAN Tim.tpl ..\Compiled\Tim.opoThis will copy the compiled file to the compiled directory if you are usingthe recommended folder layout.OPLTran (for File Conversion)As noted earlier, OPLTran requires your source code to be an ASCII (ANSI)text file (7-bit character representation), not Unicode text.

Symbian OSuses Unicode throughout, so if you are moving a text file from the phone(e.g. an export of source code from the Program application) then youGATHERING TOOLS25will need to use the convert function of OPLTran:OPLTRAN Tim.tpl -convThis will take our source code file called Tim.tpl, and change theformat. If it is ASCII (ANSI), it will be converted to Unicode. If it isUnicode, it will be converted to ASCII (ANSI).BMConvThis allows you to take Windows bitmap files, and combine them in oneMultiple BitMap file that Symbian OS can understand and use in OPL.BMConv and other issues around graphics are discussed in more detailin Chapter 6.MakeSISThis allows you to take your compiled program, the resource files,libraries, and any other files to be packaged up in a standard SymbianInstallation System.

SIS files are the standard way to distribute SymbianOS applications to phones. Distributing applications is covered in moredetail in Chapter 8.2.3.6 Symbian OS File ManagerCommunicatorsThe Nokia Communicator has a file manager built-in – this can be foundunder the Office quick launch button, and is called ‘File manager’.Series 60Series 60 does not come with a file manager as standard, although somephones (e.g. the Siemens SX-1) do ship with a file manager built-in.There are a number of file managers available for Series 60, and youcan use whichever you feel most comfortable with. When discussingSeries 60 OPL in this book, we will use FExplorer, which is a freewarefile manager available from www.gosymbian.com. Download FExplorerand install the SIS file as you would for any other application – but notethis is not supported or endorsed by either me or Symbian.UIQFor UIQ phones, there is a free developer tool called QfileMan, whichyou can use on your own phone.

You can get this from the support site26INTRODUCING THE TOOLS OF OPLfor this book at www.symbian.com/books/rmed/rmed-info.html. SomeUIQ models (such as the P900) come with a File Manager built in.Epocware’s PC File ManagerAnother alternative is to manage your phone’s directories and files using aPC-based file manager. Third-party developer Epocware supply a productcalled PC File Manager. When your Symbian OS phone is connected viathe PC Suite, the PC File Manager opens a window similar to WindowsExplorer, and you can drag and drop files onto and around your phone.It is available as a 30-day trial version from www.epocware.com.

Again,this is not supported or endorsed by either myself or Symbian.2.3.7 Creating and Compiling OPL on the PhoneAs well as installing the OPL Runtime onto your Symbian OS phone,you can also install a program called TextEd or ‘Program’. This is a texteditor that is specifically geared towards writing OPL programs on thephone. As well as the normal editing commands, you have a translatefunction built in, and other useful functionality such as jumping straightto procedures by name.Once your code has been translated you will be given the opportunityto run it immediately.You can also use Program on your SDK emulator, it’s part of thestandard Developer Pack binaries. Some people find this easier thanOPLTran.

As with programming, there’s no ‘correct’ method – just workin whichever way suits you.2.4 How we Program2.4.1 The Development CycleDeveloping programs is a process much like a loop inside a program.You repeat lots of small steps again and again until you get a successfulresult. That result is the finished program. The steps you go through are:• edit your source code• translate the source code• run the compiled code• edit your source code if needed to fix any problems• repeat.HOW WE PROGRAM27With every program you write, you will go through these steps countlesstimes – as you add new sections to the code. Let’s look at each stepin turn.2.4.2 Source CodeWhichever environment you write your code in, the code you write andthe techniques used will be the same.Let’s open a new .tpl file in your preferred text editor (or if you’reusing Program on your Symbian OS phone, a new .opl file).

Type in thefollowing lines exactly as they are printed here:PROC Main:PRINT "Hello World"GETENDPCongratulations. You’ve typed in your first OPL program! Make sure thatall the punctuation, spelling, and capitalization are exactly as listed here.Save the file as HelloWorld.tpl/HelloWorld.opl before movingto the next step.Before we move on, a quick word on capitalization. Unlike othercomputer languages, OPL is not strict on capitalizing procedure, variable,or command names. So PROC Main: is the same as proc MAIN: or pROcMaiN:, but there are certain conventions used in OPL programs that wewill use in this book:• procedure and variable names have the first letter of each wordcapitalized• where procedure and variable names contain more than one word,each word is capitalized, but no spaces are included (e.g.

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

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

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

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