Android 用代理模式处理海量高频数据更新
2010-12-18 08:04:10 来源:WEB开发网业务背景: 海量高频数据(如股票实时报价), 更新的规则: 被更新的对象和更新方法都不一样.
下面是部分实例代码,最后一个是模拟的数据更新。
Java代码
public interface CommonDefn {
public static int HIGHLIGHT_BACKGROUND_COLOR_INDEX = 0xff0033ff;
public class DoThingsReturn{
public Object cmd;
public Object data;
public int errCode;
public DoThingsReturn(Object cmd, Object data, int errorCode) {
super();
this.cmd = cmd;
this.data = data;
this.errCode = errorCode;
}
}
}
public interface CommonDefn {
public static int HIGHLIGHT_BACKGROUND_COLOR_INDEX = 0xff0033ff;
public class DoThingsReturn{
public Object cmd;
public Object data;
public int errCode;
public DoThingsReturn(Object cmd, Object data, int errorCode) {
super();
this.cmd = cmd;
this.data = data;
this.errCode = errorCode;
}
}
}
Java代码
/**
* used for updating the background of the view while the data changed
*
*
*/
public interface RefreshHandlerInterface {
public void updateBackground(Object handlerId, int color); //the proxy updating method
public Handler getHandler(); //the proxy handler
}
/**
* used for updating the background of the view while the data changed
*
*
*/
public interface RefreshHandlerInterface {
public void updateBackground(Object handlerId, int color); //the proxy updating method
public Handler getHandler(); //the proxy handler
}
Java代码
/**
*
* decrease alpha channel value from 255 to 0.
点击下载:php?id=1364" rel="nofollow">源码下载
- ››Android 当修改一些代码时,使用什么编译命令可以最...
- ››Android 如何添加一个apk使模拟器和真机都编译进去...
- ››Android 修改Camera拍照的默认保存路径
- ››Android 如何修改默认输入法
- ››android开发中finish()和System.exit(0)的区别
- ››Android手势识别简单封装类
- ››android中查看项目数字证书的两种方法
- ››Android中获取IMEI码的办法
- ››android 相机报错 setParameters failed
- ››Android重启运用程序的代码
- ››Android为ListView的Item设置不同的布局
- ››android bitmap与base64字符串的互相转换
赞助商链接