版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、<p> 外文翻譯 中文+英文 14頁2651字?jǐn)?shù)</p><p><b> 外文文獻(xiàn):</b></p><p> Develop Rich Multimedia Apps with J2ME</p><p> The portability of J2ME across platforms can be used to cr
2、eate multimedia apps that take full advantage of the blistering connectivity speeds provided by 3G networks.</p><p> Tuesday, March 03, 2009</p><p> Sun Microsystems claims that Java ME is the
3、 most ubiquitous application platform for mobile devices, deployed on more than a billion sets. Apart from the great advantage of portability across devices along with robust security, Java ME provides a rich set of APIs
4、 for today's multimedia and web enabled mobile handsets. Some of the useful libraries/APIs provided by the Java ME platform are:</p><p> Wireless Messaging API </p><p> Mobile Media API &l
5、t;/p><p> JAXP XML Parser </p><p> Location API </p><p> Mobile 3D Graphics </p><p> Payment API </p><p> In the article “Creating Apps for Mobiles”, pub
6、lished in PCQ Jan'09, we explored the J2ME development tools to create a simple application. We will continue the exploration by creating a tiny video player using the Mobile Media API。</p><p> Mobile M
7、edia API (JSR 135)</p><p> The Mobile Media API provides an interface to the multimedia capabilities of the mobile device running J2ME. This includes the speaker (or headset), microphone, LCD Screen (for vi
8、deo) and Camera (if available).</p><p> The package name for the Mobile Media API is:</p><p> "javax.microedition.media".</p><p> The building blocks of the system cons
9、ist of -Manager, Player and Control. The Manager is the top level controller for the multimedia resources. J2ME applications use the Manager to create and manage Players and query status and properties of the Players. Th
10、e Players actually play the multimedia content. The Control interface is used to implement the different controls a Player might have, such as VolumeControl to increase/decrease the volume.</p><p> Create a
11、 tiny video player application</p><p> In this article we will go through the steps of creating a project using the Mobile Media API and then develop the code required to create the player. Please refer to
12、the PCQ Jan '09 issue (also available online at pcquest.com) for the procedure to install the tools. You can test this application on the Emulator, but to use it on a mobile device, you will need a data connection su
13、ch as GPRS or the blazing fast 3G.</p><p> We will start by creating a project with the following details:</p><p> The toolkit will create the project and show the paths where you have to crea
14、te the source files.</p><p> Creating the source file for PCQ_Player Application</p><p> We now write the code to provide the desired functionality to your application:</p><p> p
15、ackage com.j2me.part1;</p><p> import javax.microedition.lcdui.*;</p><p> import javax.microedition.midlet.MIDlet;</p><p> import javax.microedition.media.*;</p><p>
16、 import javax.microedition.media.control.*;</p><p> public class PCQ_Player extends MIDlet implements</p><p> CommandListener {</p><p> private Display display;</p><p
17、> private Form form;</p><p> VideoPlayer vPlayer;</p><p> public PCQ_Player() </p><p><b> {</b></p><p> display = Display.getDisplay(this);</p>
18、;<p> form = new Form("PCQ Player");</p><p><b> }</b></p><p> public void startApp() {</p><p> form.addCommand( new Command( "Exit", Comma
19、nd.EXIT, 1 ));</p><p> form.setCommandListener(this);</p><p> vPlayer = new VideoPlayer(display, form, "http://createapoll.net/guest/R1.mpg");</p><p> Thread runner = n
20、ew Thread(vPlayer);</p><p> runner.start();</p><p><b> }</b></p><p> public void pauseApp() {</p><p><b> }</b></p><p> public
21、void destroyApp(boolean unconditional) {</p><p><b> }</b></p><p> public void commandAction(Command command, Displayable disp) </p><p><b> {</b></p>
22、<p> vPlayer.playerClose();</p><p> destroyApp(true);</p><p> notifyDestroyed();</p><p><b> }</b></p><p><b> }</b></p><p&
23、gt; class VideoPlayer implements Runnable, PlayerListener</p><p><b> {</b></p><p> Form form;</p><p> Player player;</p><p> Display display;</p>
24、<p> String url;</p><p> public VideoPlayer(Display display, Form form, String url)</p><p><b> {</b></p><p> this.display = display;</p><p> thi
25、s.form = form;</p><p> this.url = url;</p><p><b> }</b></p><p> public void run() {</p><p><b> try {</b></p><p> Alert alert =
26、 new Alert("Buffering ..."); //Download takes time</p><p> alert.setTimeout(Alert.FOREVER); //so display message</p><p> display.setCurrent(alert);</p><p> player = Man
27、ager.createPlayer(url);</p><p> player.addPlayerListener(this);</p><p> player.setLoopCount(1); </p><p> //Play only once</p><p> player.start(); // Start the playb
28、ack</p><p> display.setCurrent(form);</p><p><b> } </b></p><p> catch(Exception e)</p><p><b> { </b></p><p> Alert alert = new
29、 Alert("Failed to play video"); //Display message in case</p><p> alert.setTimeout(Alert.FOREVER); //there is an error</p><p> display.setCurrent(alert);</p><p><b>
30、; }</b></p><p><b> }</b></p><p> public void playerUpdate(Player player, String event, Object eventData)</p><p><b> {</b></p><p> if(
31、event.equals(PlayerListener.STARTED)</p><p><b> )</b></p><p><b> {</b></p><p> videoControl vControl = (VideoControl) player.getControl("VideoControl
32、");</p><p> form.append((Item)v Control.initDisplayMode(vControl.USE_GUI_PRIMITIVE, null));</p><p> } else if(event.equals(PlayerListener.CLOSED))</p><p><b> {</b&g
33、t;</p><p> form.deleteAll(); </p><p><b> }</b></p><p><b> }</b></p><p> public void playerClose() {</p><p> player.close(); //
34、 close playback</p><p><b> }</b></p><p><b> }</b></p><p> Copy the above source code in Notepad and save this as PCQ_Player.java in the fully qualified so
35、urce path, which is the path you copied in the previous step plus 'com\j2me\part1'. In my case the path is</p><p> D:\Users\Sudipto Chanda\ j2mewtk\ 2.5.2\ apps\PCQ_Player\src\ com\j2me\ part1.</
36、p><p> Important: Make sure that you select 'All Files', while saving from Notepad, otherwise, Notepad may append a '.txt' extension. It is a good idea to verify the file name to be PCQ_Player.
37、java.</p><p> The source given in this article is very minimal without much error handling. The documentation provided with WTK (usually located in C:\WTK2.5.2\docs\ api\midp) contains more detailed guideli
38、nes of using the Mobile Media API and other packages of J2ME.</p><p> Executing the PCQ_Player</p><p> Use the Build option to compile and build the player source. Then you need to click on Ru
39、n to execute the code in the Emulator. Next click on the button that is located below 'Launch' to start the PCQ_Player application.</p><p> The Emulator will present you with the question “Is it OK
40、to Use Airtime?” You need to click on the button below 'Yes' to continue. This option is valuable in mobile phones as service providers will charge you for data downloads. You might need to be patient though, as
41、your video will take a while to come up, depending on your computer and Internet speed.</p><p> The PCQ_Player application plays the content from the URL:</p><p> "http://createapoll. net
42、/guest/R1.mpg".</p><p> Now, you can upload content to any website where you have access. However, the content should be converted for the size and capability of the device. Files with MPEG1/MPEG2 vide
43、o with MP3 audio in QVGA or QCIF sizes usually work fine with this application.</p><p> Conclusion</p><p> As you have seen, J2ME can be used to create professional quality applications for ri
44、ch multimedia and graphics experience. You can also extend this functionality to create robust enterprise class applications for banking and finance.</p><p> These days you see a lot of banks and financial
45、institutions giving importance to the mobile banking platform. With millions of mobile devices being sold around the world that support the Java ME platform, along with the spread of Internet connection for mobile device
46、s such as GPRS, Edge and the blazingly fast 3G and WiMAX just round the corner, the possibilities for developers providing apps for these platforms are immense.</p><p> The core advantage of Java ME-which i
47、s portability across platforms (such as Windows Mobile, Symbian, Linux etc.) makes it a winner in the diverse jungle of embedded systems.</p><p><b> 譯文:</b></p><p> 開發(fā)豐富的多媒體應(yīng)用與J2ME
48、</p><p> J2ME的跨平臺(tái)的可移植性,可用于創(chuàng)建多媒體應(yīng)用程序,可以利用起泡連通3G網(wǎng)絡(luò)提供的速度充分利用。</p><p> 星期二,2009年3月3日</p><p> Sun公司稱,Java ME是部署于超過一億套移動(dòng)設(shè)備的最普遍的應(yīng)用平臺(tái)。除了在便攜設(shè)備以及強(qiáng)大的安全性很大的優(yōu)勢(shì),Java ME還為現(xiàn)在具備多媒體和網(wǎng)絡(luò)功能的移動(dòng)手機(jī)提供了豐富
49、的API集。由Java ME平臺(tái)提供的有用的庫和API集有:</p><p><b> ?無線消息API</b></p><p><b> ?移動(dòng)媒體API</b></p><p> ?JAXP的XML解析器</p><p><b> ?位置API</b></p&
50、gt;<p><b> ?手機(jī)3D圖形</b></p><p><b> ?支付API</b></p><p> 在文章“創(chuàng)建用于手機(jī)應(yīng)用程序”發(fā)表于一月九日的PCQ后,我們探討了J2ME開發(fā)工具來創(chuàng)建一個(gè)簡單的應(yīng)用。我們將繼續(xù)創(chuàng)造一個(gè)微小的視頻播放器使用移動(dòng)媒體API的探索。</p><p> 移動(dòng)
51、媒體API(符合JSR 135)</p><p> 移動(dòng)媒體API提供了一個(gè)接口上運(yùn)行的J2ME的移動(dòng)設(shè)備的多媒體功能。這包括揚(yáng)聲器(或耳機(jī)),麥克風(fēng),液晶顯示屏(視頻)和攝像機(jī)(如果有的話)。</p><p> 為移動(dòng)媒體API的包名是:</p><p> “javax.microedition.media”。</p><p> 該
52、系統(tǒng)的組成部分包括管理者、播放器和控制。管理者是頂級(jí)的多媒體資源控制器。J2ME應(yīng)用程序使用管理器來創(chuàng)建和管理播放器和查詢狀態(tài)和Player的屬性。Player真正發(fā)揮多媒體內(nèi)容??刂平涌谑怯脕韺?shí)現(xiàn)不同的控制一個(gè)Player可能有諸如VolumeControl來增加/降低音量。</p><p> 創(chuàng)建一個(gè)小的視頻播放器應(yīng)用程序</p><p> 在這篇文章中我們將通過創(chuàng)建一個(gè)項(xiàng)目使用的
53、移動(dòng)媒體API的步驟,然后發(fā)展需要?jiǎng)?chuàng)建的播放器代碼。安裝的程序的工具時(shí)請(qǐng)參閱1月9日的PCQ(也可在網(wǎng)上查詢pcquest.com)。你可以在模擬器上測(cè)試這個(gè)應(yīng)用,而如果讓它在移動(dòng)設(shè)備上運(yùn)行,您將需要諸如GPRS或高速3G的數(shù)據(jù)連接。</p><p> 我們將首先創(chuàng)建一個(gè)具有以下詳細(xì)項(xiàng)目:</p><p> 該工具包將創(chuàng)建項(xiàng)目并顯示的路徑,你必須創(chuàng)建源文件。</p>&l
54、t;p> 創(chuàng)建應(yīng)用程序源文件的PCQ_Player</p><p> 現(xiàn)在,我們編寫代碼來為您的應(yīng)用程序提供所需的功能:</p><p> package com.j2me.part1;</p><p> import javax.microedition.lcdui.*;</p><p> import javax.micr
55、oedition.midlet.MIDlet;</p><p> import javax.microedition.media.*;</p><p> import javax.microedition.media.control.*;</p><p> public class PCQ_Player extends MIDlet implements<
56、;/p><p> CommandListener {</p><p> private Display display;</p><p> private Form form;</p><p> VideoPlayer vPlayer;</p><p> public PCQ_Player() </p>
57、;<p><b> {</b></p><p> display = Display.getDisplay(this);</p><p> form = new Form("PCQ Player");</p><p><b> }</b></p><p>
58、 public void startApp() {</p><p> form.addCommand( new Command( "Exit", Command.EXIT, 1 ));</p><p> form.setCommandListener(this);</p><p> vPlayer = new VideoPlayer(dis
59、play, form, "http://createapoll.net/guest/R1.mpg");</p><p> Thread runner = new Thread(vPlayer);</p><p> runner.start();</p><p><b> }</b></p><p&g
60、t; public void pauseApp() {</p><p><b> }</b></p><p> public void destroyApp(boolean unconditional) {</p><p><b> }</b></p><p> public void c
61、ommandAction(Command command, Displayable disp) </p><p><b> {</b></p><p> vPlayer.playerClose();</p><p> destroyApp(true);</p><p> notifyDestroyed();<
62、;/p><p><b> }</b></p><p><b> }</b></p><p> class VideoPlayer implements Runnable, PlayerListener</p><p><b> {</b></p><p&
63、gt; Form form;</p><p> Player player;</p><p> Display display;</p><p> String url;</p><p> public VideoPlayer(Display display, Form form, String url)</p>&l
64、t;p><b> {</b></p><p> this.display = display;</p><p> this.form = form;</p><p> this.url = url;</p><p><b> }</b></p><p> p
65、ublic void run() {</p><p><b> try {</b></p><p> Alert alert = new Alert("Buffering ..."); //Download takes time</p><p> alert.setTimeout(Alert.FOREVER); //s
66、o display message</p><p> display.setCurrent(alert);</p><p> player = Manager.createPlayer(url);</p><p> player.addPlayerListener(this);</p><p> player.setLoopCount
67、(1); </p><p> //Play only once</p><p> player.start(); // Start the playback</p><p> display.setCurrent(form);</p><p><b> } </b></p><p> c
68、atch(Exception e)</p><p><b> { </b></p><p> Alert alert = new Alert("Failed to play video"); //Display message in case</p><p> alert.setTimeout(Alert.FOREVE
69、R); //there is an error</p><p> display.setCurrent(alert);</p><p><b> }</b></p><p><b> }</b></p><p> public void playerUpdate(Player player,
70、 String event, Object eventData)</p><p><b> {</b></p><p> if(event.equals(PlayerListener.STARTED)</p><p><b> )</b></p><p><b> {</b&
71、gt;</p><p> videoControl vControl = (VideoControl) player.getControl("VideoControl");</p><p> form.append((Item)v Control.initDisplayMode(vControl.USE_GUI_PRIMITIVE, null));</p>
72、;<p> } else if(event.equals(PlayerListener.CLOSED))</p><p><b> {</b></p><p> form.deleteAll(); </p><p><b> }</b></p><p><b> }
73、</b></p><p> public void playerClose() {</p><p> player.close(); // close playback</p><p><b> }</b></p><p><b> }</b></p><p&
74、gt; 在記事本中復(fù)制上面的源代碼,并保存完整的源代碼到PCQ_Player.java這一位置,并在你在上一步復(fù)制的路徑加上使用“com\j2me\part1”。在我的情況下,路徑是:</p><p> D:\Users\Sudipto Chanda\ j2mewtk\ 2.5.2\ apps\PCQ_Player\src\ com\j2me\ part1.</p><p> 重要事
75、項(xiàng):請(qǐng)確保您選擇'所有文件',而從記事本保存,否則,記事本可能追加擴(kuò)展名'txt '。這是一個(gè)好辦法來驗(yàn)證名稱為PCQ_Player.java的文件。</p><p> 在這篇文章中給出的源文件是最小的且沒有太多的錯(cuò)誤處理。與WTK中提供的文件(通常位于C:\WTK2.5.2\docs\ api\midp)包含使用移動(dòng)媒體API和J2ME的其他包具有更詳盡的指引。</p&g
76、t;<p> 執(zhí)行PCQ_Player</p><p> 使用構(gòu)建選項(xiàng)來編譯和構(gòu)建的Player來源。然后你需要點(diǎn)擊運(yùn)行以執(zhí)行在模擬器的代碼。下一步點(diǎn)擊按鈕位于下方是'啟動(dòng)'開始PCQ_Player應(yīng)用。</p><p> 模擬器將會(huì)對(duì)你提出問題“是否可以使用通話時(shí)間?”,你需要點(diǎn)擊下面的'是'按鈕來繼續(xù)。這個(gè)選項(xiàng)是在移動(dòng)電話服務(wù)供應(yīng)商向
77、你提供付費(fèi)文件下載時(shí)所需要的。您可能需要耐心等待一段時(shí)間,因?yàn)槟囊曨l將需要一段時(shí)間才能上傳到,這取決于您的計(jì)算機(jī)和互聯(lián)網(wǎng)的速度。</p><p> 該P(yáng)CQ_Player應(yīng)用程序播放URL中的內(nèi)容:</p><p> “http://createapoll.net/guest/R1.mpg”。</p><p> 現(xiàn)在,你可以向你可以訪問的網(wǎng)站上傳文件。然而,
78、內(nèi)容要轉(zhuǎn)換的規(guī)模和設(shè)備的能力有關(guān)。MPEG1/MPEG2的視頻文件和QVGA/QCIF類型的MP3音頻文件通??捎么藨?yīng)用程序較好地播放。</p><p><b> 結(jié)論</b></p><p> 正如你所看到的,J2ME可以用于創(chuàng)建豐富的多媒體和進(jìn)行專業(yè)的圖形開發(fā)應(yīng)用。你還可以擴(kuò)展此功能來創(chuàng)建功能強(qiáng)大的銀行和金融類的應(yīng)用程序。</p><p&g
79、t; 現(xiàn)在,你所看到的銀行很多都對(duì)移動(dòng)銀行業(yè)務(wù)給予較高的重視。隨著數(shù)百萬支持Java ME平臺(tái)的移動(dòng)設(shè)備在世界各地的普及,隨著互聯(lián)網(wǎng)如GPRS,高速3G和WiMAX移動(dòng)設(shè)備的連接以及傳播銷售指日可待,這些平臺(tái)對(duì)于開發(fā)商提供的應(yīng)用程序具有巨大的可能性。</p><p> Java ME的核心優(yōu)勢(shì),就是跨平臺(tái)的可攜性(例如Windows Mobile,Symbian和Linux的等),這將使其成為在多樣化的嵌入式
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 基于j2me開發(fā)工具下的多媒體【文獻(xiàn)綜述】
- 基于J2ME的手機(jī)多媒體應(yīng)用解決方案的研究與實(shí)現(xiàn).pdf
- j2me畢業(yè)論文-- j2me手機(jī)彩票軟件開發(fā)
- j2me手機(jī)游戲的開發(fā)-beckhamgoal
- 基于J2ME的移動(dòng)應(yīng)用系統(tǒng)的研究與開發(fā).pdf
- J2ME多媒體手機(jī)閱讀器的設(shè)計(jì)實(shí)現(xiàn)與改進(jìn)分析.pdf
- 基于j2me平臺(tái)的手機(jī)游戲開發(fā)
- 基于j2me平臺(tái)的手機(jī)游戲開發(fā)
- 計(jì)算機(jī)外文翻譯---j2me和java領(lǐng)域
- 基于j2me平臺(tái)的手機(jī)應(yīng)用開發(fā)-畢業(yè)論文
- 畢業(yè)論文——基于gprs網(wǎng)絡(luò)的j2me應(yīng)用開發(fā)
- 基于J2ME的手機(jī)應(yīng)用軟件的研究與開發(fā).pdf
- 基于J2ME的嵌入式系統(tǒng)應(yīng)用開發(fā)與研究.pdf
- 基于J2ME平臺(tái)的手機(jī)應(yīng)用程序研究與開發(fā).pdf
- 基于J2ME的手機(jī)游戲開發(fā)與實(shí)現(xiàn).pdf
- 基于J2ME的手機(jī)銀行應(yīng)用系統(tǒng)的開發(fā)與設(shè)計(jì).pdf
- 基于j2me平臺(tái)的手機(jī)應(yīng)用開發(fā)-畢業(yè)論文
- 基于J2ME的手機(jī)游戲設(shè)計(jì)開發(fā).pdf
- 基于J2ME的手機(jī)游戲開發(fā)定稿.doc
- 基于J2ME的手機(jī)游戲的開發(fā)與設(shè)計(jì).pdf
評(píng)論
0/150
提交評(píng)論