##1、详细文档
React Native开发环境配置可参见根目录下的《React Native for Android实践.doc》
##2、新建项目
react-native init ReactNativeSample
用ReactNativeSample源码覆盖建好的项目
##3、安装Tab-navigator
https://github.com/exponentjs/react-native-tab-navigator
npm install react-native-tab-navigator --save
##4、安装simple-store
https://github.com/jasonmerino/react-native-simple-store
npm install react-native-simple-store -save
##5、安装barcode-scanner
https://github.com/ideacreation/react-native-barcodescanner
npm install rnpm -g
npm install react-native-barcodescanner -save
rnpm link react-native-barcodescanner
##6、FileWatch参数修改
修改node_modules\react-native\node_modules\node-haste\lib\FileWatcher\index.js
MAX_WAIT_TIME的值增加一个零
否则修改完js后手机上的应用不刷新
##7、启动js服务器
npm start
##8、发布到手机
最好用真机,如果用模拟器,要用genymotion搭配VirtualBox-4.3.10
react-native run-android
在有的android5.1手机上,会在安装到98%时报com.android.ddmlib.InstallException: Unable to upload some APKs的错误,原因是gradle version 1.3.1的问题
http://www.hacksparrow.com/react-native-android-unable-to-upload-some-apks.html
##9、修改调试地址参数
真机上需要改,首先打开Wifi,按手机菜单键,选Dev Sdettings最好一项,地址填js服务器IP:8081
##10、打包成APK
参照
http://www.lcode.org/%E3%80%90react-native%E5%BC%80%E5%8F%91%E3%80%91react-native%E8%BF%9B%E8%A1%8C%E7%AD%BE%E5%90%8D%E6%89%93%E5%8C%85%E6%88%90apk/
##需要注意的问题
1、keytool是jdk带的工具
2、修改一个超时设置
node_modules\react-native\packager\react-packager\src\SocketInterface\index.js第22行的CREATE_SERVER_TIMEOUT,后面加个零
3、缩小Release APK的大小
(1)修改app\build.gradle第90行,将abiFilters "armeabi-v7a", "x86"的, "x86"去掉,只保留arm平台的
(2)修改app\build.gradle第77行,将def enableProguardInReleaseBuilds 的值改成true
##参考项目
http://www.1ke.co/course/269
https://github.com/vczero/React-Native-App
https://www.google.com/design/icons/
https://design.google.com/icons/
http://www.jianshu.com/p/ec4069314395