为了对openbasemovil-core库有一个全面的认识,我翻译了它的开发者指南,翻译得不算太好,但都是我的个人理解,希望大家指正。 OpenBase Movil Core 开发指南 --------------------------------------------------------------- 版本号: 1.0 作者: Narciso Cerezo 翻译: iwinyeah 索引 1. 序言 ..................................................... 3 2. 核心包简介 ............ ...
Action: 规定了与用户交互的View可以触发的动作,在某个View新建之后显示之前,应先为其指定具体的Action,当用户按下了相应的Command按钮之后,View将该Command对应的Action发送到该View的Controller进行处理。 // public class Action{ String name; // 名称 Command command; // 命令 int code; // 代码 (将由该View的传递到其Controller使用) Item item; // 数据项 boolean defau ...
在处理资源文件时,我以前的做法是一次性读入资源文件,然后再进行处理,在处理大文件时,这种方法对由于对机器内存消耗较大而存在隐患,刚想将它改为逐字读入的方式,在OpenBaseMovil中发现了这个类,很符合我的要求。关键代码如下: //... 省略 public static final String WHITESPACE = "\r\n\t "; public String next(final String delimiters, final boolean keepWhitespace, final boolean allowComments, final boole ...
唉,有贴代码骗粮票的嫌疑呢,至少大家可以在这里看到各种设备的规格方法了. public static boolean isBlackBerry() { return checkPlatform( "RIM" ); } public static boolean checkPlatform( final String key ) { final String platform = System.getProperty( "microedition.platform" ); return ...
以下代码由bm.core.tools.DeviceInfo.java抽出,详见该文件 private void testFontListBug() { if( isNokia() ) { // 就算是Nokia的设备也要进行一下测试来确定是否有这个Bug final Font font = Font.getFont( Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, ...
private void doShow() { // This delays minimze the chance that a Nokia 6670 or Nokia S60 3rd // edition device (might apply to other nokias) freez when showing a // view. The total delay of 600ms, with this distribution seems to // make it stable on E70 ...
一个简单的高速对象缓存 public class SimpleCache { private static long wideHits; private static long wideMisses; private Hashtable cache; private Vector stamps; private int maxSize; private long hits; private long misses; // ...部分省略 ...
// 每个实现事件监听器接口的对象都要具有事件处理方法 handleEvent // 该接口最简洁了,传递一个Event对象,该对象则是较为复杂的. public interface EventListener { /** * Handle event. * * @param event event to handle */ void handleEvent( Event event ); }
/** * 对象的反序列化 SerializerInputStream.readObject() */ public Object readObject() throws SerializationException { try { // 与写入方法对象,读回序列化对象类型 final byte type = in.readByte(); // 进行反序列化处理 return parseObject( typ ...
/** * 摘录 serializerOutputStream.writeObject 关键片断 */ public void writeObject( final Object o ) throws SerializationException{ if( o instanceof Serializable ){ // 先写入可序列化对象标识 out.writeByte( CoreConstants.SERIALIZABLE ); final Stri ...
/** * 每一个自定义的可序列化的对象必须实现此接口 */ public interface Serializable { /** * 返回该可序列化对象的名称 * * @return 对象名称 */ String getSerializableClassName(); /** * 将可序列化对象的状态值写入输出流 * * @param 输出流 * @throws SerializationException on errors */ ...
最近发现了一个OpenSource的J2ME项目OpenBaseMovil,感觉还不错,比较全面,准备学习一下。如果有朋友已经在学习的,希望交流一下。
iwinyeah
搜索本博客
我的相册
C8609f76-ccc2-3dbc-a9e8-b5e08077b8c2-thumb
jaccount1.0.7
共 5 张
最近加入圈子
存档
最新评论