(keitai-l) questions about scratchpad usage

From: Zhonglin Hu <zhu_at_teralogic.com>
Date: 09/12/01
Message-ID: <93CBF9C89A88D31196000008C7EBB28701CF6862@tlexmail.teralogic-inc.com>
I am a programmer, running java code on i-jade phone emulator, N503i.  I
tried to use scratchpad, but it doesn't work, it seemed that I need to do
some configuration ???  
 
I can connect to a URL starts with  http://
 
I can connect to  resource:///   also  
 
but  NOT  the    scratchpad:///0
 
Could someone give me a hint ???
 
 
BTW,  the  System.out.println(" string.......");       doesn't work either,
so I cannot do the debug :-(
 
 
 
 
here is my code: (doesn't work on my emulator, I use showDisplay  to debug
:-)
 
 
 
 
import com.nttdocomo.ui.*;
import java.io.*;
import javax.microedition.io.*;
 
public class ScratchPadDemo extends IApplication {
 String message = "scratchpad demo!"; 
 
 public void start() {
  
 try {
 //  showDisplay(message);
   OutputStream out = Connector.openOutputStream("scratchpad:///0");
   showDisplay(message); 
   out.write(message.getBytes());
   out.close();
  
  } catch(IOException e) {}
 
 
  try {
 //  showDisplay(message);
   InputStream in = Connector.openInputStream("scratchpad:///0");
   byte buf[] = new byte[message.getBytes().length];
   in.read(buf);
   in.close();
 
 //  showDisplay(new String(buf));
  } catch(IOException e) {}
 }
 
 public void showDisplay(String data) {
  Panel panel = new Panel();
  TextBox textBox = new TextBox(data, 18, 5, TextBox.DISPLAY_ANY);
  panel.add(textBox);
  Display.setCurrent(panel);
 }
}
 

-Zhonglin
 
 
 

[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Wed Sep 12 20:25:13 2001