libs工具包结构:
activity activity基类封装
net 网络底层封装
cache 数据缓存,图片缓存
ui 自定义控件
主项目包结构:
activity (activity下面可以按照模块进行划分)
adapter 所有适配器
entity 所有实体类
db sqlite逻辑封装类
engine 业务相关类
utils 公用的方法
interfaces 接口
listener listener接口,以on开头
使用fastjson注意点:
加了符号Annotation的实体属性,使用崩溃;
当有泛型属性,使用崩溃。
混淆文件添加如下内容解决:
-keepattributes Signature //避免混淆泛型
-keepattributes *Annotation* //不混淆注解
<a href="http://www.xamasoft.com/json-class-generator/">http://www.xamasoft.com/json-class-generator/</a>
作者在github有放出代码:
https://github.com/icodeu/AppProgrammingSource/blob/master/1.6%20%E7%B1%BB%E5%9E%8B%E5%AE%89%E5%85%A8%E8%BD%AC%E6%8D%A2%E5%87%BD%E6%95%B0/YoungHeart/src/com/youngheart/utils/Utils.java