i illustration : Hada Eiji 206 INTERNET magazine 2001/4
jdc.sun.co.jp/wireless/ www.nttdocomo.co.jp/mc-user/i/java/ www.zentek.com/i-jae/ja/download.html INTERNET magazine 2001/4 207
Jump 01 Jump 02 Jump 01 Jump 02 www.sun.co.jp/software/java/ 503i.nttdocomo.co.jp/normal/iappli/ n_iappli.html 208 INTERNET magazine 2001/4
i Jump 01 java.sun.com/products/cldc/ INTERNET magazine 2001/4 209
210 INTERNET magazine 2001/4
i INTERNET magazine 2001/4 211
1 2 3 212 INTERNET magazine 2001/4
i s s s www.zentek.com/ja/ www.g-appli.net 1JK1.3J2ME-CLC1.0i-JAE Lite 5 > javac -g:none -bootclasspath c: i-jade ijade-f.jar;c: j2me_cldc bin api classes -d class *.java 2C: i-jade i-jade-f.jar c: classes 6 > preverify -classpath c: classes; -d 3C: j2me_cldc bin api classes java preverified class c: classes 7 4class >jar cvfm NetMemo.jar -C preverified. preverified INTERNET magazine 2001/4 213
A 1 2 B 3 4 5 6 7 8 9 C 10 11 12 13 14 /** * : (Alone) * : * @version 1.0 */ import java.io.*; 1 import javax.microedition.io.*; 1 import com.nttdocomo.ui.*; 2 // public class MemoAlone extends IApplication 3 // public void start() 3 // MainPanel p = new MainPanel( this ); 4 isplay.setcurrent( p ); 5 // PhoneSystem.setAttribute( PhoneSystem.EV_BACKLIGHT, PhoneSystem.ATTR_ BACKLIGHT_ON ); 6 // class MainPanel extends Panel implements SoftKeyListener 7 // public static final int ROW = 18; public static final int COL = 3; 8 private TextBox textbox; // private Label lbl; // // public MainPanel( IApplication iapp ) // settitle( "(Alone)" ); 10 // setsoftlabel( Frame.SOFT_KEY_1, "" ); 11 setsoftlabel( Frame.SOFT_KEY_2, "" ); // setsoftkeylistener( this ); 12 // textbox = new TextBox( "", ROW, COL, TextBox.ISPLAY_ANY ); 13 lbl = new Label( "" ); add( textbox ); 13 add( lbl ); // ScratchPad readscratch(); 14 A B C 9 214 INTERNET magazine 2001/4
i // public void softkeypressed( int softkey ) // 1() if( Frame.SOFT_KEY_1 == softkey ) // IApplication.getCurrentApp().terminate(); 15 else if( Frame.SOFT_KEY_2 == softkey ) // ScratchPad // writescratch(); 16 readscratch(); // public void softkeyreleased( int softkey ) 17 // ScratchPad F public void writescratch() try // ScratchPad 18 ataoutputstream out = Connector.openataOutputStream( "scratchpad:///0" ); out.writeutf( textbox.gettext() ); 19 out.close(); 20 E E 15 16 17 F 18 19 20 21 22 lbl.settext( "!!" ); 21 catch( IOException e ) lbl.settext( "ScratchPad" ); // ScratchPad public void readscratch() String str = ""; 23 22 G 23 24 25 26 27 try // ScratchPad 24 atainputstream in = Connector.openataInputStream( "scratchpad:///0" ); str = in.readutf(); 25 in.close(); 26 // ScratchPad textbox.settext( str ); 27 catch( IOException e ) lbl.settext( "ScratchPad" ); G INTERNET magazine 2001/4 215
Å 1 import java.io.*; import javax.microedition.io.*; import com.nttdocomo.io.*; import com.nttdocomo.ui.*; 2 3 // class MainPanel extends Panel implements SoftKeyListener, ComponentListener // CGI public static final String UPLOA_CGI = "upload.cgi"; public static final String OWNLOA_CGI = "download.cgi"; // public static final int public static final int // private Button up; // private Button NG = '0'; OK = '1'; down; 5 4 // setcomponentlistener( this ); 6 // textbox = new TextBox( "", ROW, COL, TextBox.ISPLAY_ANY ); up = new Button( "" ); down = new Button( "" ); lbl = new Label( "" ); add( textbox ); add( up ); add( down ); add( lbl ); // public void componentaction( Component c, int type, int param ) if( c.equals( up ) ) // txtupload(); else if( c.equals( down ) ) // txtownload(); 216 INTERNET magazine 2001/4
// public void txtupload() int res; // 1 try lbl.settext( "" ); 2 // HttpConnection conn = ( HttpConnection )Connector.open( IApplication.getCurrentApp().getSourceURL() + UPLOA_CGI, Connector.REA_WRITE, true ); 3 // conn.setrequestmethod( HttpConnection.POST ); 4 conn.setrequestproperty( "Content-Type", "text/plain" ); 5 // OutputStream out = conn.openoutputstream(); 6 // // out.write( textbox.gettext().getbytes() ); 7 // out.close(); 8 A B 1 2 A 3 4 5 B 6 7 getbytes() 8 9 C // conn.connect(); 9 // InputStream in = conn.openinputstream(); 10 res = in.read(); 11 in.close(); 12 // conn.close(); 13 // if( res!= OK ) lbl.settext( "" ); return; lbl.settext( "!!" ); catch(exception e) lbl.settext( "" ); C // public void txtownload() int res; // try lbl.settext( "" ); // HttpConnection conn = ( HttpConnection )Connector.open( IApplication.getCurrentApp().getSourceURL() + OWNLOA_CGI, Connector.REA, true ); 14 // conn.setrequestmethod( HttpConnection.GET ); // conn.connect(); // InputStream in = conn.openinputstream(); // byte [] by = new byte[ in.available() - 1 ]; 15 16 E 10 11 12 13 E 14 15 F 16 17 18 19 // res = in.read(); if( res!= OK ) lbl.settext( "" ); return; // in.read( by ); 17 // // String str = new String( by ); 18 // textbox.settext( str ); // in.close(); // conn.close(); 19 lbl.settext( "!!" ); catch( Exception e ) lbl.settext( "" ); F INTERNET magazine 2001/4 217
<html> <head> <title>netmemo</title> </head> <body> <OBJECT declare id="netmemo" data="netmemo.jam" type="application/x-jam"></object> <A ijam="#netmemo" href="netmemo.html">netmemo</a> </body> </html> AppName = NetMemo AppVer = 1.0 PackageURL = NetMemo.jar AppSize = 2622 KvmVer = CLC-1.0 SPsize = 1024 AppClass = NetMemo LastModified = Mon, 05 Feb 2001 17:48:24 UseNetwork = http 218 INTERNET magazine 2001/4
i www.nttdocomo.co.jp/mc-user/i/java/ YKidera@aol.com www.el-camino-real.net INTERNET magazine 2001/4 219
[ インターネットマガジンバックナンバーアーカイブ ] ご利用上の注意 この PF ファイルは 株式会社インプレス R&( 株式会社インプレスから分割 ) が 1994 年 ~2006 年まで発行した月刊誌 インターネットマガジン の誌面を PF 化し インターネットマガジンバックナンバーアーカイブ として以下のウェブサイト All-in-One INTERNET magazine 2.0 で公開しているものです http://i.impressr.jp/bn このファイルをご利用いただくにあたり 下記の注意事項を必ずお読みください 記載されている内容 ( 技術解説 URL 団体 企業名 商品名 価格 プレゼント募集 アンケートなど) は発行当時のものです 収録されている内容は著作権法上の保護を受けています 著作権はそれぞれの記事の著作者 ( 執筆者 写真の撮影者 イラストの作成者 編集部など ) が保持しています 著作者から許諾が得られなかった著作物は収録されていない場合があります このファイルやその内容を改変したり 商用を目的として再利用することはできません あくまで個人や企業の非商用利用での閲覧 複製 送信に限られます 収録されている内容を何らかの媒体に引用としてご利用する際は 出典として媒体名および月号 該当ページ番号 発行元 ( 株式会社インプレス R&) コピーライトなどの情報をご明記ください オリジナルの雑誌の発行時点では 株式会社インプレス R&( 当時は株式会社インプレス ) と著作権者は内容が正確なものであるように最大限に努めましたが すべての情報が完全に正確であることは保証できません このファイルの内容に起因する直接的および間接的な損害に対して 一切の責任を負いません お客様個人の責任においてご利用ください このファイルに関するお問い合わせ先 All-in-One INTERNET magazine 編集部 im-info@impress.co.jp Copyright 1994-2007 Impress R&, an Impress Group company. All rights reserved.