Главная » Просмотр файлов » Programming Java 2 Micro Edition for Symbian OS 2004

Programming Java 2 Micro Edition for Symbian OS 2004 (779882), страница 32

Файл №779882 Programming Java 2 Micro Edition for Symbian OS 2004 (Symbian Books) 32 страницаProgramming Java 2 Micro Edition for Symbian OS 2004 (779882) страница 322018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

Note that these APIs do not themselves form partof the MIDP 2.0 specification, but have their own specifications derivedfrom a Java Specification Request (JSR) presided over by an expert group.3.4.1Mobile Media APIAs discussed in Chapter 2, one of the most commonly-cited limitationsof MIDP 1.0 since it was launched in 2000 has been the level of supportit provides for multimedia functionality. ‘‘Out of the box’’ there is noaudio capability and limited graphics support only through the Canvas156MIDP 2.0 AND THE JTWIprimitive.

This was reasonable for the mainly monochrome devices withmore limited capabilities at which MIDP was targeted, such as thepioneering Motorola i3000 phone and RIM BlackBerry 950 and 957wireless handhelds. Given these limitations, it is perhaps remarkable howmuch media-rich content has yet made its way onto the first generationof MIDP 1.0-enabled mobile phones.However, Symbian OS devices like the Psion netBook and the Nokia9210 were already providing a PersonalJava Application Environmentwith AWT graphics, audio playback support and color screens.

MIDP 1.0was not sufficiently attractive to present itself as an alternative Java runtimeenvironment for Symbian OS phones. It is interesting to note here that noSymbian OS phone has shipped without the MIDP 1.0 Java functionalitybeing complemented either directly by additional multimedia functionality or else by inclusion of a PersonalJava Application Environment. Eventhe Nokia 7650, which provided one of the least feature-rich Java runtimeenvironments among Symbian OS phones, extended the basic MIDP 1.0specification with custom Nokia extension classes. A sound packageallowed playing of several audio formats and a UI package provided APIsupport for such multimedia enhancements as:• full-screen display• vibrator activation• a number of graphics utilities.And when the Nokia 3650 was released a few months later, the mainenhancement to the programming environment it provided was in termsof MIDP multimedia functionality.The limitations of MIDP have been systematically addressed over thelast few years through the Java Community Process.

From this haveemerged a number of extensions that have been made to, or madeavailable to, MIDP runtimes.We note first in this regard the extensions made directly to MIDP 1.0in its upgrade to MIDP 2.0, which have been discussed in Chapter 2 andSection 3.3. This upgrade included, for the first time, an audio API underthe javax.microedition.media package. However, in recognitionof the need for a J2ME-based framework supporting wider multimediacapabilities, such as tone generation, photo capture (given the ubiquityof camera phones) and video playback/capture, a Java SpecificationRequest was initiated by Nokia under the Java Community Process.

Thiswas JSR 135, the Mobile Media API, which is the main subject of thepresent section. We shall follow here the convention introduced in thespecification of referring to it as ‘‘MMAPI’’.Given the wide scope that is encompassed by the concept of ‘‘multimedia’’, both in terms of the kind of content (e.g. video and audio) andOPTIONAL J2ME APIS IN THE JTWI157of its encoding (e.g.

JPEG and GIF), the authors of the multimedia APIrecognized a need for flexibility. As a result, MMAPI is highly modular;also, where a module is supported in an implementation there is a greatdegree of latitude as to which protocols or file formats are supported.There are essentially three media types which can be handled withinthe framework. These are:• audio• video• generated tones.All of these or any non-zero subset may be supported in a particularMMAPI implementation, although it is unlikely that generated toneswould be omitted given their mandatory status in MIDP 2.0.

There isfurther modularity: three tasks can be performed in relation to audioand video:• playing – stored video or audio content is recovered from a file at aspecified URI (or perhaps stored locally) and displayed onscreen orsent to a speaker• capturing – a video or audio stream is obtained directly from hardware(camera or microphone) associated with the device• recording – video or audio content which is being played or capturedis sent to a specified URI or else cached as a local OutputStreamand is thus made available for ‘‘re-playing’’.Because of the nature of tone generation, playing is the only task ofrelevance.

Again, implementations are not required to support all threetasks, although clearly it is not possible to support recording withoutsupporting either playing or capturing. Further, in the context of a mobilephone, there is little point in supporting capture without the ability toplay. So the practical options for audio or video are:• only playing is supported• playing and capturing are supported, but not recording• playing and recording are supported, but not capturing• all three are supported.As we shall see, Symbian OS phones typically provide the secondoption for video (recording not possible) and the fourth for audio (everything supported).

There is further optionality in terms of supported formats158MIDP 2.0 AND THE JTWIand the ability to manipulate data streams or playback. We will return tothis below.3.4.1.1 MMAPI ArchitectureAt the heart of MMAPI is the concept of a media player. Players areobtained from a factory or manager which also serves to associate themwith a particular media stream. While the player allows basic start/stopcapability for the playback, fine-grained manipulation is achieved throughvarious kinds of control, which are typically obtained from a player.Another task performed by controls is the recording of incoming mediafor later playback. Also of interest is the concept of a player listener.This allows you to track conveniently on multiple threads the progress ofplayers being initialized, started or stopped. Since these events involveaccessing (shared) hardware resources, they can take some time to complete, so you will typically not want your program to block while waiting.The following classes or interfaces embody the above basic concepts:• Player• Manager• Control• PlayerListener.These are the fundamental elements of the core package javax.microedition.media.

In fact, of these only Manager is a concrete class; theothers are all interfaces. The Control interface exists merely as a markerfor the set of (more concrete) subinterfaces which are defined in the relatedpackage javax.microedition.media.control. The functionalityprovided by the latter is so diverse that nothing is in common, and theControl interface, remarkably, defines no methods!The package javax.microedition.media.protocol is provided by MMAPI for users who wish to define new protocols forobtaining/downloading media content.

This package provides data sourcefunctionality, introducing a common interface for handling content delivered by whatever protocol. Most MMAPI users will not have to workdirectly with data sources. Rather, DataSource objects will be marshaled on their behalf as a by-product of creating a player. But MMAPIdoes allow you the flexibility to define your own protocols for downloading/obtaining the media content to be played.

This involves definingconcrete implementations of the abstract DataSource class. As this is aspecialist topic beyond the scope of this chapter, we shall not say anythingfurther. The MMAPI specification document contains further details.OPTIONAL J2ME APIS IN THE JTWI159ManagercreatePlayer(source: DataSource):Player<<Interface>>ControllableDataSourcecreatesgetControl()gets controlPlayerFigure 3.22ControlThe basic architecture of the Mobile Media API.3.4.1.2 Obtaining Media ContentThe elements of the Mobile Media API work together as shown inFigure 3.22 (the PlayerListener has been omitted and we shallreturn to it in Section 3.4.1.3).A Player is typically created using the following factory methodof the javax.microedition.media.Manager class:public static Player createPlayer(String locator)The method’s argument is a media locator, a String representing aURI that provides details about the media content being obtained.

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

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

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

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