国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

用Java在Palm和Pocket PC上編程

2019-11-17 05:55:45
字體:
供稿:網(wǎng)友

  由于自己一直用的是java,看不慣C的易錯(cuò)性和C++的復(fù)雜性,再加上論壇上很多朋友都不了解SuperWaba這個(gè)偉大的Java虛擬機(jī)——世界上還有第二臺(tái)VM能夠同時(shí)在臺(tái)式機(jī)(Java applet)、Palm OS和Pocket PC上跑的嗎?沒有!!
  
  1.SuperWaba是什么東西?
  
  SuperWaba的前身是Waba,而Waba現(xiàn)在已經(jīng)差不多死了……最初SW的原意只是Waba上的一個(gè)擴(kuò)展,但是后來一發(fā)不可收拾,在經(jīng)歷的大大小小的改進(jìn)和更新?lián)Q代后成為了現(xiàn)在的SW。
  
  優(yōu)點(diǎn):
  
  1. 跨平臺(tái)兼容性超高,一個(gè)程序基本不用改動(dòng),重新編譯一下就可以在Palm OS或PPC上跑;
  
  2. 豐富的API,可以使用到Symbol的條形碼識(shí)別及擴(kuò)展卡等等;
  
  3.可以方便的從Palm OS style換到非Palm OS style;
  
  4. SW的更新速度驚人的快,平均每個(gè)月都有新的版本發(fā)布!
  
  5.最重要的一條……它是完全免費(fèi)的,而且遵守GPL協(xié)議,源代碼全部公開,并放在sourceforge上。
  
  缺點(diǎn):
  
  1.比起用CW寫的C程序會(huì)(當(dāng)然)慢一些,但是下周一(12月15號(hào))發(fā)布的SW4.1將是ARM native,到時(shí)候會(huì)有很明顯的速度提升;
  
  2.目前還不支持中文,但即將到來的SW 4.1將會(huì)!!(它的官方網(wǎng)站上就用中文寫著:Full Unicode support (UfoLib) – ready 在下一版本(4.1)中將會(huì)假如對(duì)中文的支持。
  
  3.比C程序能用到的API會(huì)少一些
  
  以下是已知的SW支持的OS:
  
  Palm OS 3到5.2.1(HandSPRing的OS3.1 需要打個(gè)補(bǔ)丁才能跑)
  Windows CE 從2到3(CE.NET還沒試過)
  Pocket PC從2000一直到2003(只能用一個(gè)字形容:爽!那個(gè)程序能支持這么多的OS和處理器框架!)
  
  以下是已知的SW支持的設(shè)備
  
  Palm OS 設(shè)備
  
  Handspring: Treo 180, Visor Pro (PalmOS 3.5), Visor Platinum, Visor Prism, Treo 600 (!!!)
  Palm:
  o Professional, III, IIIx, IIIc, IIIe, V, Vx
  o M105, M500, M505, M515, M125, Palm 130
  o Zire, Zire 71, Zire21
  o Tungsten C, Tungsten W, Tungsten T, Tungsten T2, Tungsten T3, Tungsten E
  Samsung: SPH-I330, Kyocera Smartphone 6035, Kyocera 7135
  Sony CLIE: S300, T-615, S360, TG50, N770C/E, NX70V, NX60, SJ30, SL10, SJ33, SJ20
  Symbol: SPT 1500, 1550 and 1700
  Handera 330(不支持虛擬手寫區(qū);而且不知為什么字體變成了小字體)
  
  Windows CE/Pocket PC 設(shè)備
  
  Compaq: ipaq 3670, iPaq H3970, iPaq 3900, iPaq 1910, Pocket PC Aero 1550
  Dell: Axim A5, Axim X5
  HP: Jornada 540 (SH3), Jornada 680/690
  HTC: Falcon
  Symbol: PDT8100 (Pocket PC 3.0), PDT8146 (Pocket PC 2002)
  Toshiba: e350 Intel PXA
  Vandem: Clio (HPC 2.11) - cabs don't work but the files can be installed manually for MIPS
  ViewSonic: V35, V37
  
  32-bit Windows
  
  Windows 98
  Windows NT
  Windows xp
  windows 2000
  
  2. 如何獲得SuperWaba
  
  SuperWaba的官方網(wǎng)頁:www.superwaba.com.br
  
  要下載它的SDK話,得先注冊(cè)(免費(fèi)):點(diǎn)Sign Up,然后按照提示完成。
  注冊(cè)好了后,點(diǎn)Downlaod,登陸后點(diǎn)Download SuperWaba SDK即可。
  
  這里推薦一個(gè)很不錯(cuò)的免費(fèi)IDE:Tauschke MobileCreator 1.7,可以到 http://www.tauschke.com/download/index.Html 去下載。

  
  VisualWaba是一個(gè)法國人用Java寫的Visual IDE,可惜是共享軟件,有誰能……
  
  目前大多數(shù)人用的是Eclipse,這個(gè)想必熟悉Java的朋友都知道吧,是完全公開和免費(fèi)的,有位大蝦已經(jīng)寫了個(gè)Superwaba plugin, 下載的鏈接請(qǐng)?jiān)跇窍抡摇_@里是plugin的快速教程:http://superwaba-ide.sourceforge.net/usage.html
  
  假如在使用Superwaba中有什么困難或建議,不妨訂閱一下superwaba的新聞組:news://news.superwaba.net ,非常有幫助的(外加鍛煉英文!其實(shí)superwaba的老大guich是巴西人……從.br這個(gè)國家域名就可以看得出來,superwaba是很國際化的,成員多來自德國、法國等等……但是大家都用英語!)
  
  O'Reilly的OnJava.com有一個(gè)不錯(cuò)的Waba教程:http://www.onjava.com/pub/a/onjava/2001/04/19/java_palm.html
  http://www.onjava.com/pub/a/onjava/2001/06/19/waba.html
  
  狂暈……昨天夜里23:48,superwaba 4.1 正式發(fā)布,現(xiàn)在官方的網(wǎng)頁上竟然說……竟然說下個(gè)版本會(huì)有:
  Native ARM VM for Palm OS 5, expecting 4-8 times faster……
  5-15 times faster VM for Windows CE using the SDL (and, in XScale processors, boosted by Intel's optimized compiler)
  ……最恐怖的是……下個(gè)版本將增加對(duì)linux PDA, Symbian V.7和Brew(雖然我不知道這是什么玩藝)的支持!!!!
  
  英文好的朋友可以看看superwaba老大guich剛給我發(fā)的SW簡(jiǎn)介:
  
  SuperWaba is a Java-like VM for PDAs. Can run in PalmOS, in Windows CE/PocketPC devices and in Windows 98 and beyond, and is fully emulated under JDK and browser. Have support for Exceptions, Threads, lots of user interface controls, double and long 64 bit types, supports Grayscale in all PalmOS devices starting 2.0, supports Color, has a beautiful set of 3d controls, supports JNI and Java libraries, its fast and small, lets you use all device's memory if needed, supports Symbol scanners, bluetooth, sockets and serial/IR. Also supports html and full UNICODE range (chinese, japanese, korean, etc).
  
  You can make programs using your favorite Java IDE, debug everything in desktop and when finished just deploy it in the device. There are several libraries added by users that enhance the basic set of classes. The programs are totaly portable between the platforms, and even the database is also portable! SuperWaba has more than 10000 members from 150 countries worldwide. Welcome to the world of easy cross-platform!
  
  SuperWaba 4.1 (December 15, 2003)
  
  .Full Unicode Support! (Japanese, Chinese, Korean, etc) .New xml package .New Html Container .New HtmlBrowser .Support for Gif/Jpeg/Png library .Support for Treo 600, Intermec Norand 600, Zire 21, Mono WinCE devices .Improved Image loading speed .Now you can add a txt file using Warp and read it directly (Vm.getFile) .Lots of bug fixes
  
  3. 開始用SuperWaba編程!
  
  雖然Eclipse要比MobileCreator強(qiáng)大的多,但是剛開始還是先從簡(jiǎn)單的入手吧!安裝完Tauschke MobileCreator 1.72并啟動(dòng)后,點(diǎn)“Project”,“New…”,然后輸入工程的名字,這里就隨便取一個(gè)我最常用的Faint吧 :) 記住要把Create MainWindow Class打上鉤,要不然你還得自己從零開始寫!

  
  點(diǎn)完OK后,你會(huì)發(fā)現(xiàn)左邊的Source欄多了一個(gè)Faint.java文件,這就是我們剛剛創(chuàng)建的MainWindow class。所有的SuperWaba程序都要有一個(gè)并且只能有一個(gè)MainWindow class,否則后果自負(fù)!這個(gè)MainWindow就是主窗口啦……
  
  好,現(xiàn)在就先享受一下一行代碼也沒有打的成果吧!點(diǎn)工具欄最右邊的綠色旗子圖標(biāo)(Save All, Compile and Start)或者按F10(怎么聽起來有點(diǎn)像老美的轟炸機(jī)??),只要你最開始的路徑全都設(shè)對(duì)了,現(xiàn)在就會(huì)看到一個(gè)可愛的Java applet,上面只有一個(gè)menu bar Faint……
  
  用鼠標(biāo)點(diǎn)擊它!瞧,標(biāo)準(zhǔn)的Palm菜單!咦,為什么點(diǎn)了Options沒反應(yīng)??廢話,咱們還沒開始寫event handler呢,要有反應(yīng)的話就見鬼了!
  
  好,先看看代碼:
  
  import waba.ui.*;import waba.fx.*;public class Faint extends MainWindow {String col0[] = {"Options","Cut","Copy","Paste"};String col1[] = {"About Faint","Info"};public Faint() {setDoubleBuffer(true);setBorderStyle(TAB_ONLY_BORDER);setTitle("Faint");setMenuBar(new MenuBar(new String[][]{col0,col1}));}public void onStart() {}public void onEvent(Event event) {}public void onPaint(Graphics g) {} }
  
  最開始的兩行import,把一些最常用的SW classes給導(dǎo)入。其它的還有:
  
  waba.fx Classes related to Graphics, fonts, geometric classes (Rect, Coord), Image, sound. waba.io Input output basic classes, to access PDB files (represented by a Catalog), sockets, serial port, and some utility classes to make easier dealing with IO. waba.sys Classes that contains functions to deal with the underlying Operating System characteristics and configurations, and convertion classes. waba.ui The most important package, with all user interface controls you need to create good and fast programs. waba.utilUtility classes, to deal with date, random number generation, and data strUCtures (Vectors and Hashtables).
  
  除此之外,SW還有Extension Packages,可以附加使用。具體細(xì)節(jié)請(qǐng)看documentat

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 神木县| 蛟河市| 凉城县| 阳曲县| 通化县| 高安市| 钟山县| 梁河县| 佳木斯市| 松滋市| 阳朔县| 钦州市| 济宁市| 托克逊县| 星座| 耿马| 深泽县| 交城县| 板桥市| 五家渠市| 阳朔县| 齐齐哈尔市| 浪卡子县| 福鼎市| 定边县| 库尔勒市| 双辽市| 鄂托克旗| 界首市| 建水县| 临泽县| 巴林右旗| 鹿泉市| 保定市| 乌鲁木齐县| 天台县| 景泰县| 柳州市| 柳州市| 政和县| 桃源县|