一、下载配置node.js,并集成weex
1、下载node.js,配置nodejs时以管理员权限打开,不然可能出错。
2、参考http://blog.csdn.net/dfskhgalshgkajghljgh/article/details/52712293配置node.js,以及weex。
3、当weex -version显示正确版本号时weex配置完成。
二、下载sublime text3编译器,编写 .we 文件
三、集成weex到android
1、添加相关依赖
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.alibaba:fastjson:1.1.46.android'
compile 'com.taobao.android:weex_sdk:0.5.1@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
2、WeexApplication 初始化weex
InitConfig.Builder builder = new InitConfig.Builder();
builder.setImgAdapter(new ImageAdapter());
InitConfig config = builder.build();
WXSDKEngine.initialize(this,config);
注释:ImageAdapter()为自己编写,主要为了解决weex解析图片
3、拷贝.JS文件到项目,加载JS。
所有步骤参考文档: http://blog.csdn.net/mengzuixilou/article/details/52710488
http://blog.csdn.net/dfskhgalshgkajghljgh/article/details/52757849
三、weex详细文档
http://www.shouce.ren/api/view/a/11590