Programming Java 2 Micro Edition on Symbian OS A developer’s guide to MIDP 2.0 phần 5

Sau khi hiển thị một cảnh báo lỗi, ðược trình bày hiện tại được thiết lập để InitialView cho phép người dùng thử hoặc là cùng một URL hoặc một URL khác nhau. Lớp MIDletController cũng cung cấp một vài phương pháp gọi lại: (giao thức, Bluetooth địa chỉ của thiết bị cung cấp dịch vụ, kênh RFCOMM máy chủ định danh, vv) để kết nối với dịch vụ. | 172 ANDTHEJTWI public void itemStateChanged Item item if item instanceof Gauge Gauge volumeIndicator Gauge item int level level The itemStateChanged method obtains the value requested by the user and invokes the setVolume method to adjust the audio playback volume via the Player s VolumeControl. The showAlert method see below is called by the AudioPlayer instance in the event of an Exception being thrown at any stage of the Player lifecycle. public void showAlert String title String message Alert alert new Alert title message null alert initialView playCommand After displaying an error Alert the current Displayable is set to the InitialView allowing the user to try either the same URL again or a different URL. The MIDletController class also provides a couple of callback methods updateProgressGauge and removeVolumeControl. The first updates the InitialView progress gauge as the Player progresses through its lifecycle. The second removes the interactive volume indicator Gauge from the PlayerView in the event that the implementation of Player does not support a VolumeControl. The full source code and JAR and JAD files for the Audio Player MIDlet can be downloaded from the Symbian website at . com books. Working with Video We shall now illustrate how to play a video with code highlights taken from a simple Video Player MIDlet see Figure . The architecture of the Video Player MIDlet see Figure is very similar to that of the Audio Player. The MIDlet contains four classes MIDletController InitialView VideoPlayer and VideoCanvas. The VideoCanvas is used for rendering the video playback as well as providing controls similar to those found in the PlayerView of the Audio Player MIDlet. The other classes fulfill very similar roles to their equivalents in the Audio Player MIDlet. OPTIONAL J2ME APIS IN .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
18    96    2    10-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.