{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

React Native跨平台移动应用开发

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

React Native跨平台移动应用开发

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

本书配套的GitHub文档持续更新中,保证书中知识在zui新版本RN中可用。

★ 迄今为止,真正意义上的React Native跨平台开发原创图书。

★ 本书架构是作者精心设计的,适合初学者入门。

★ 本书所有例程均是原创的,并且在代码旁有注释解说。

★ 本书中的6.5节、第11章、14.5节都是笔者精心整理调研出来的技术,能让更多的开发者享受到React Native开发的便利性。


Content Description

React Native师出名门,于2015年11月初成为真正的跨平台移动应用开发框架。本书从零开始切入React Native开发,逐一讲解各个组件,包括页面导航、弹出框、OS平台Object c语言混合开发、flexbox布局、Image、View与可触摸组件等,适用 Android和苹果两系统手机开发,是移动开发者学习React Native不可多得的入门宝典。React Native是Facebook公司*新推出的,强大的、开源的跨平台移动应用开发框架,它能大幅减少跨平台移动应用开发的工作量,并且代码结构清晰、简单易懂。同时React Native框架采用模块化结构,使应用版本的更新迭代非常简单。随着它的日趋成熟,React Native必然会成为移动应用开发的主流技术。 本书由浅入深、系统地介绍了使用React Native框架跨平台开发所需要用到的知识。本书每一章都专注于阐述某一方面的知识,配合若干个原创的、精小的例程,能让读者系统、快速地掌握该方面知识。 本书是按照有基本的编程基础知识,刚学习JavaScript基本语法的读者*佳学习路径来编写的。有一定基础的开发人员也可以将本书作为React Native开发的“字典”来使用,在开发时可以快速查找相关知识点的细节。

Author Description

阙喜涛,湖南省吉首市人,北京邮电大学研究生,专注智能手机应用开发十一年,任职于东信北邮信息技术有限公司,先后参与开发过中国移动POC系统、贵州移动一卡多号系统、浙江移动应用商店系统开发等等。开发移动应用下载量超过25万。

Catalogue

目录

第1章React Native 1
1.1 React Native开发特点 2
1.1.1 一次学习,随处编写 2
1.1.2 混合开发 2
1.1.3 高效的UI开发 3
1.1.4 高效的UI调试 4
1.1.5 学习门槛低、开发难度低 4
1.1.6 开发软硬件要求低 5
1.1.7 使用React Native开发的代价 5
1.1.8 为什么React Native尚未流行 7
1.2 React Native开发环境搭建 7
1.2.1 开发环境搭建起点 7
1.2.2 Windows操作系统下React Native开发环境搭建 8
1.2.3 苹果操作系统下React Native开发环境搭建 9
1.2.4 查看与删除使用npm命令安装的软件 11
1.3 代码编辑环境搭建 11
1.3.1 Sublime Text 3 11
1.3.2 开发用插件 11
1.3.3 Sublime界面风格选择 13
1.3.4 键盘使用习惯 13
1.4 React Native Dev tool安装 14
第2章状态机思维与状态机变量 16
2.1 初始化项目 16
2.2 运行项目 17
2.2.1 使用Android手机进行调测 18
2.2.2 使用iPhone手机或模拟器进行调测 21
2.2.3 修改JSX代码 22
2.2.4 ES 6语法与ES 5语法 24
2.2.5 启动调试工具 25
2.3 构建注册页面 28
2.4 React Native代码执行逻辑 32
2.5 状态机思维与状态机变量 33
2.5.1 状态机思维 33
2.5.2 “冒充常量”的状态机变量 35
2.5.3 “无处安放”的状态机变量 36
2.5.4 “努力瘦身”的状态机变量 36
2.6 React Native组件间通信 37
2.7 深入理解UI重新渲染的过程 37
2.7.1 合并状态机变量 37
2.7.2 判断是否渲染 40
2.7.3 替换状态机变量 40
2.7.4 强制启动渲染 41
2.7.5 渲染过程 41
2.7.6 合并状态机变量的最简语法 42
2.8 React Native组件的成员变量 42
2.9 React Native组件的静态变量、静态函数 43
第3章页面导航、弹出框及深入理解属性 44
3.1 分离注册组件、组件平台自适配 44
3.1.1 分离注册组件 44
3.1.2 组件平台自适配 44
3.1.3 平台检测 45
3.2 导航组件、挂接注册组件 45
3.3 挂接注册等待组件 47
3.4 Navigator组件工作机制 49
3.4.1 push与pop 50
3.4.2 replace函数 50
3.5 自定义组件 51
3.5.1 “弹出一切框”的实现 51
3.5.2 React Native中颜色类型的值 53
3.5.3 挂接自定义组件 54
3.6 BackAndroid API的bug与解决办法 56
3.7 属性确认 58
3.8 指定属性默认值 60
3.9 Alert应用程序编程接口 60
3.9.1 弹出确认框 60
3.9.2 弹出选择框 61
3.10 带导航栏的页面导航 62
第4章混合开发基础篇 63
4.1 iOS平台混合开发 63
4.1.1 与iOS 侧原生代码消息互通 64
4.1.2 React Native代码到iOS原生代码的消息 65
4.1.3 iOS 原生代码到React Native代码的消息 68
4.1.4 与iOS OC原生代码界面切换 69
4.1.5 应用初始界面设定 69
4.1.6 iOS混合开发中传递的参数类型 70
4.1.7 混合开发中的多线程使用 70
4.1.8 原生代码实现Promise机制 71
4.1.9 跨语言常量 72
4.2 Android平台混合开发 73
4.2.1 与Android原生代码消息互通 74
4.2.2 React Native代码到Android原生代码的消息 75
4.2.3 与Android原生代码界面的切换 78
4.2.4 Android原生代码到React Native代码的消息 82
4.2.5 应用初始界面设定 86
4.2.6 传递的参数类型 86
4.2.7 回调函数与Promise机制 86
4.2.8 监听ActivityResult与Android生命周期事件 88
4.2.9 混合开发中的多线程机制 89
4.2.10 跨语言常量 89
第5章flexbox布局、View、Image与可触摸组件 90
5.1 flexbox布局 90
5.1.1 位置及宽、高相关样式键 91
5.1.2 决定子组件排列规则的键 92
5.1.3 决定组件显示规则的键 94
5.1.4 边框、空隙与填充 95
5.1.5 组件多样式声明与动态样式声明 96
5.2 View组件 97
5.2.1 View组件的颜色与边框 97
5.2.2 View组件的阴影与其它他视觉效果 99
5.2.3 View组件的变形 101
5.2.4 View组件的回调函数 104
5.2.5 View组件的其他属性 106
5.2.6 设备放置状态、根View与onLayout回调函数 106
5.2.7 pointerEvents属性 109
5.3 Image组件 111
5.3.1 加载网络图片 111
5.3.2 加载静态图片资源 112
5.3.3 加载资源文件中的图片 112
5.3.4 动态加载手机中的图片资源 112
5.3.5 Image组件的样式 113
5.3.6 Image组件显示特性 114
5.3.7 Image组件的其它他属性 117
5.4 可触摸组件 117
5.4.1 可触摸组件类型 118
5.4.2 TouchableOpacity组件 118
5.4.3 TouchableHighlight组件 118
5.4.4 其他属性 120
5.5 加深理解三大组件 120
5.5.1 使用导航栏的导航框架 121
5.5.2 等比放大无丢失显示图片 125
5.5.3 宽、高动态变化的组件呈现 128
第6章Text、TextInput等相关知识 129
6.1 Text组件 129
6.1.1 样式键设置 129
6.1.2 其他属性 131
6.1.3 Text组件的嵌套 131
6.1.4 文本显示的阴影效果 132
6.1.5 Text居中显示 133
6.1.6 在字符串中插入图像 135
6.2 Text组件在两个平台上的不同表现 136
6.2.1 只指定fontSize,不指定height 137
6.2.2 只指定height,不指定fontSize 137
6.2.3 fontSize等于height 137
6.2.4 height大于fontSize 138
6.2.5 边框在两个平台上的不同表现 138
6.3 TextInput组件 140
6.3.1 TextInput组件样式键 140
6.3.2 TextInput组件的属性 140
6.3.3 TextInput组件iOS平台专有属性 141
6.3.4 TextInput组件Android平台专有属性 142
6.3.5 TextInput组件的成员函数 142
6.4 TextInput组件在两个平台上的不同表现 143
6.4.1 Android平台的输入下画线 143
6.4.2 父组件的alignItems键失效 144
6.4.3 只指定fontSize,不指定height 145
6.4.4 height等于fontSize 145
6.4.5 height大于fontSize 146
6.4.6 边框在两个平台上的不同表现 146
6.5 TextInput组件的生命周期 147
6.5.1 获得焦点 147
6.5.2 用户输入 147
6.5.3 用户按下提交键 147
6.5.4 失去焦点 148
6.6 软键盘与键盘事件 148
6.7 组件的引用 151
6.7.1 定义组件引用 151
6.7.2 得到系统定义的组件引用 151
6.7.3 调用组件的公开成员函数 152
6.7.4 重新设定组件的属性 152
6.7.5 获得组件的位置 154
6.8 跨平台状态栏组件 155
6.8.1 StatusBar组件属性 155
6.8.2 StatusBar组件使用示例 156
6.8.3 手机状态栏在开发中的处理 157
6.8.4 StatusBarIOS API 158
6.9 高度自增长的扩展TextInput组件 159
6.10 访问操作系统剪贴板 160
第7章组件生命周期、数据存储及React Native应用实现步骤 163
7.1 组件生命周期 163
7.1.1 getInitialState 163
7.1.2 getDefaultProps 163
7.1.3 componentWillMount 164
7.1.4 componentDidMount 164
7.1.5 componentWillReceiveProps 164
7.1.6 shouldComponentUpdate 165
7.1.7 componentWillUpdate 165
7.1.8 componentDidUpdate 165
7.1.9 componentWillUnmount 166
7.2 读取JSON文件 166
7.3 数据持久化操作 167
7.3.1 flow语法检查器 167
7.3.2 写入数据、错误捕捉 168
7.3.3 读取数据 170
7.3.4 AsyncStorage API存储数据的无序性 173
7.3.5 删除数据 173
7.3.6 修改数据 175
7.3.7 JSON对象存储 175
7.3.8 读取JSON对象 176
7.4 数据表操作 176
7.5 React Native应用实现步骤、日记例程(上) 176
7.5.1 应用原型 177
7.5.2 基础组件结构设计 178
7.5.3 使用React Native组件搭建静态界面 180
7.5.4 React Native组件分层 188
7.5.5 实现各组件业务逻辑 189
7.5.6 日记例程(上)总结 190
第8章ScrollView和ListView 200
8.1 ScrollView组件 200
8.1.1 ScrollView组件属性 200
8.1.2 ScrollView组件iOS平台专有属性 201
8.1.3 ScrollView组件Android平台专有属性 202
8.1.4 ScrollView组件的公开成员函数 203
8.1.5 RefreshControl组件 203
8.1.6 ScrollView组件基本用法 204
8.2 ListView组件 206
8.2.1 ListView组件的属性 207
8.3 简单的列表 208
8.3.1 准备列表的数据源 209
8.3.2 声明状态机变量 209
8.3.3 将数据源中的数据拷贝到DataSource中 210
8.3.4 定义如何渲染列表中的每一行 210
8.3.5 实现简单的列表 211
8.3.6 列表栏的高级处理 217
8.4 带分段标志的列表 217
8.4.1 准备数据源 218
8.4.2 声明状态机变量 218
8.4.3 将数据源中的数据拷贝到DataSource中 219
8.4.4 定义如何渲染每个分栏 220
8.4.5 定义如何渲染首、尾栏 220
8.4.6 列表间隔渲染 220
8.4.7 实现带分段标志的列表 221
8.4.8 总结 221
8.5 日记例程(下)总结 221
第9章等待提示条、进度条和Switch 222
9.1 ProgressBarAndroid组件 222
9.1.1 ProgressBarAndroid组件样式设置 222
9.1.2 ProgressBarAndroid其他属性 222
9.1.3 Android平台等待提示条 222
9.1.4 React Native框架中定时器的使用 224
9.1.5 Android平台进度条 225
9.2 iOS进度条组件 226
9.2.1 ProgressViewIOS组件样式设置 226
9.2.2 ProgressViewIOS其他属性 226
9.2.3 iOS平台进度条 226
9.3 iOS平台等待提示条 227
9.3.1 ActivityIndicatorIOS组件样式设置 227
9.3.2 ActivityIndicatorIOS其他属性 227
9.3.3 iOS平台等待提示条 227
9.4 Switch组件 229
9.4.1 Switch组件样式设置 229
9.4.2 Switch其他属性 229
9.4.3 Switch组件的使用 229
第10章导航组件 231
10.1 导航组件的属性 231
10.1.1 回调函数 231
10.1.2 其他属性 232
10.2 导航器 232
10.3 NavigationBar 233
第11章手势识别 240
11.1 PanResponder API 240
11.2 监视器 240
11.2.1 指定监视区域 241
11.2.2 定义监视器相关变量 241
11.2.3 准备监视器的事件处理函数 241
11.2.4 建立监视器 242
11.2.5 将监视器与监视区域挂接 242
11.3 监视事件的生命周期 242
11.3.1 单次点击事件的生命周期 243
11.3.2 单次点击事件处理 245
11.3.3 移动手势事件的生命周期 245
11.3.4 监视器异常事件 247
11.4 手势识别处理例程 247
11.4.1 单点手势――点击、拖动选择百分比参数 247
11.4.2 单点手势――带导槽的滑动来电接听或拒接界面 249
11.4.3 单点手势――滑动解锁屏幕界面 252
11.4.4 单点手势――单点任意方向拉动选择界面 254
11.4.5 两点手势 257
第12章网络 258
12.1 获取网络状态 258
12.1.1 得到当前网络状态 258
12.1.2 监听网络状态改变事件 259
12.1.3 简单判断是否有网络连接 260
12.1.4 判断当前连接是否收费 260
12.2 通过HTTP、HTTPS与网络侧交换数据 260
12.2.1 发送请求 260
12.2.2 接收响应 263
12.3 在React Native开发中使用AJAX技术 264
第13章网页浏览器、音视频媒体播放 266
13.1 WebView组件样式设置 266
13.2 WebView组件其他属性 266
13.2.1 非回调函数属性 266
13.2.2 回调函数属性 267
13.2.3 平台独有属性 267
13.2.4 WebView组件成员函数 268
13.3 网页浏览器使用例程 268
13.3.1 浏览网页例程 268
13.3.2 加载本地网页例程 271
13.4 音视频媒体播放 273
第14章图像的遍历、存取与显示 274
14.1React Native开发中iOS平台链接库的使用 274
14.2 获取手机中所有的图片信息 276
14.3 图片信息详解 278
14.3.1 Android平台图片信息 278
14.3.2 iOS平台图片信息 278
14.4 显示从CameraRoll API得到的图片 279
14.5 为用户提供图片选择界面 280
14.6 图片的保存与读取显示 282
14.6.1 保存图像数据 282
14.6.2 读取并显示图片 283
第15章选择器、位置相关和应用状态 284
15.1 日期、时间选择器 284
15.1.1 DatePickerAndroid API 284
15.1.2 TimePickerAndroid API 286
15.1.3 DatePickerIOS组件 287
15.2 Picker组件 289
15.2.1 Picker组件的样式设置 289
15.2.2 Picker组件的属性 289
15.2.3 Picker.Item组件属性 290
15.2.4 Picker组件例程 290
15.3 PickerIOS 294
15.4 MapView组件 295
15.4.1 MapView组件样式设置 296
15.4.2 MapView组件特有的跨平台属性 296
15.4.3 MapView组件例程 297
15.5 AppState API 299
15.5.1 AppState API用途与用法 299
15.5.2 AppState API例程 299
15.6 获取地理位置 300
15.7 VibrationIOS API 302
第16章使用ES 6语法开发 303
16.1 React Native组件导入 303
16.2 属性声明 304
16.3 成员变量声明 304
16.4 状态机变量声明 305
16.5 回调函数绑定 306
16.6 类的静态成员变量与静态成员函数 307
第17章混合开发高级篇 309
17.1 使用Objective-C语言创建私有的React Native组件 309
17.1.1 增加FLAnimatedImage链接库 309
17.1.2 创建视图管理类 311
17.1.3 封装开源代码中的视图类 312
17.1.4 在React Native侧调用私有组件 314
17.1.5 例程运行效果 315
17.2 使用Swift语言创建私有的React Native组件 316
17.2.1 整合开源项目 316
17.2.2 建立组件管理者和桥接文件 319
17.2.3 Objective-C与React Native接口部分 321
17.2.4 使用Swift语言实现组件控制 322
17.2.5 在React Native侧调用私有组件 324
17.2.6 例程运行效果 325
17.3 使用Android SDK创建私有的React Native组件 325
17.3.1 准备原生代码UI组件 326
17.3.2 实现原生UI管理类 327
17.3.3 创建原生UI实例 328
17.3.4 实现对属性的支持 328
17.3.5 建立原生UI包 328
17.3.6 注册原生UI管理类 329
17.3.7 对应的React Native侧实现 329
17.3.8 运行俯视视图例程 331
第18章项目配置、生成发布版本安装包及其他 332
18.1 iOS平台项目配置 332
18.2 iOS平台应用发布 336
18.3 Android平台项目配置 336
18.4 Android平台应用生成发布版本安装包 338
18.4.1 生成发布密钥 338
18.4.2 修改gradle配置文件 338
18.4.3 生成发布版本安装包 339
18.5 其他组件与API 339
18.5.1 动画相关 339
18.5.2 其他组件与API 340
附录AECMAScript 2015语法参考 341
A.1 解构赋值 341
A.2 箭头函数 342
A.3 for in循环语句 343
A.4 JSX的延展属性(Spread Attributes) 343
A.5 Promise机制 344
A.6 数组的map成员函数 345
A.7 ES 6语法中的类与继承 345
A.8 三元运算符 346
Introduction

我对移动应用开发大势的粗浅理解


我必须向大家坦白:我现在是个没有良心的人。因为写这本书不仅把我的良心用完了,还透支了很多。本书共34万字,其中代码只占了16万字。在计算机语言编程类书籍中,这是一个比较低的比例了。本书所有的示例代码都是原创,并且在代码旁有注释解说,绝没有扔一大段代码给读者自己慢慢看的情况。


仔细想来,所有主流手机平台应用开发我都涉足过,它们是J2ME、Symbian、Series 60开发平台、Windows Mobile、Android、iOS、Windows Phone。许多年前我写过一本Series 60平台移动应用开发的书。当我写到一大半时,Symbian手机操作系统、Nokia手机、Series 60开发平台这片森林从地球表面消失了……


如果问这么多年我对移动应用开发最深的感触是什么,那就是移动应用开发太特么的难了!难就难在应用需要能运行在不同的手机上。开发者的代码要适配不同的手机操作系统(这意味着要使用不同的编程语言编写)、不同的手机硬件能力(比如开发者的应用需要使用GPS定位,然后发现某型号手机没有GPS定位功能)、不同的手机屏幕分辨率(想象一下当开发者发现应用程序在另一种屏幕分辨率下显示得乱七八糟时的惊喜)。


随着科技的发展,手机开发也在向好的方向不停地转变。Android与iOS两大手机操作系统称霸江湖(这种稳定对开发者是一件好事儿,相互竞争也让两大操作系统都在不断地提升完善)。手机硬件配置越来越强大,能力越来越强大,价格越来越平易近人。手机现在已经成为了普通老百姓无时无刻不随身携带的电脑。伴随着这种趋势,市场对移动应用开发的需求也越来越多,并且要求越来越高。


这么多年来,移动应用开发者做梦都希望有一个能跨平台的开发工具,让他们不要把同一个移动应用使用不同的开发语言写两遍(或者三四遍)。但跨平台开发工具的实现很难,很多先驱者倒在了这条路上。直到Facebook给大家带来了React Native。


让我以一个预言结束我的唠叨吧。在西方传说故事里那些没良心的巫师的预言忒准了,所以请读者对我的预言稍微有些信心。嗯,我的水晶球呢?啊,在这里。(装模作样好长一段时间)预言:我看到了一个新的伏地魔正在崛起,他会统治这个世界,他那高高的巫师帽上React Native这个名字不时地散发着邪恶的光芒!


写作本书的目的


React Native项目代码是开源的,项目代码中的例程也是开源的,项目文档也是在网上公开的,所有人都可以非常方便地获取浏览。但目前React Native的文档假设它的读者有相当深厚的开发方面的知识与经验,并且有React.js开发基础。也就是说,React Native的公开文档对初学者并不是非常友好的。React Native项目中的例程代码对初学者而言同样有些高深。在各个React Native论坛上,React Native的文档不够好是大家的共识。


笔者非常努力地把这本书写好,让它从简入深,通俗易懂。本书绝对不是粗制滥造、简单翻译的书籍。书中讲述的知识点结构、例程设计都倾注了笔者大量的心血,与网上公开文档的差别非常大。本书对读者最大的价值是:把读者通过阅读网上公开文档、项目例程学习RN开发技术所需要的800小时左右的时间(视个人基础有所不同)缩短为300小时左右。


本书中的6.5节、第11章、14.5节都是笔者精心整理调研出来的技术,在官方文档中没有提及,希望能让更多的开发者享受到React Native开发的便利性。


希望通过本书,能将React Native开发技术介绍给国内广大开发者,让国内移动应用开发进入一个新的时代,让开发者用比较少的精力就能高效、美观地完成移动应用开发。


读者对象


本书的读者对象如下:


 Android平台移动应用研发工程师


 iOS平台移动应用研发工程师


 JavaScript软件研发工程师


 计算机相关专业的学生


如何阅读本书


React、React.js、React Native


对于初学者常见的困惑是弄不清React、React.js、React Native三者之间的关系。这是情有可原的。初学者经常发现在很多讨论React Native技术的资料中,怎么突然说到React.js上去了?过一会儿怎么又好象说到React基础框架上去了?因此在讨论如何阅读本书之前,有必要先说明一下这三者的关系。React是基础框架,是一套基础设计实现理念,开发者不能直接使用它来开发移动应用或者网页。在它之上发展出了React.js框架用来开发网页,发展出来React Native用来开发移动应用。因为React基础框架与React.js框架是同时出现、同时进化发展的,这就造成了React基础框架的基本概念、设计思想都是在React.js的相关文档中描述的。后来,Facebook推出React Native后,也没有把React的相关概念文档从React.js文档中分离出来。这就导致出现了学React Native要去看React.js文档,说React Native不时会说到React.js的情况。如果开发者只想关注移动应用开发,那么在React.js的如何开发网页的文档中整理出来React基础框架知识是个不轻松的活儿。现在,本书推出了,有了这本书,读者可以不用再去看React.js文档了。


预备知识


学习React Native开发需要基础的JavaScript编程知识。我估计有一部分读者可以在某个手机平台使用该平台原生语言进行移动应用开发,但对JavaScript只是有所耳闻。如果是这种情况,不用担心。读者只需要随便找一本JavaScript入门级的书籍(甚至是网上的教学性网页),阅读关于基础语法的章节,花上一天时间(包括找资料的时间)学习相关知识点,接下来就可以通过本书学习React Native开发了。所需要的知识点有:


(1)JavaScript语法。包括语句、注释、变量、数据类型、数组(注意关联数组,Java、C++的数组中没有这个概念)、对象的基本知识。


(2)操作运算符。这个与Java、C++基本上是一样的,读者快速过一下就行了。


(3)条件语句、循环语句、switch语句。这个与Java、C++基本上是一样的,读者快速过一下就行了。


(4)函数。JavaScript中函数也是一种变量,知道了这一点,其他与Java、C++基本上是一样的,读者快速过一下就行了。


(5)对象。JavaScript的对象定义、实现比Java、C++宽松很多。读者得稍微适应一下。


这些基本的知识点,大多与Java或者Objective-C的相关知识点很类似。如果读者有基础,阅读这些知识点最多只需要一天的时间(半天看完也不是难事儿)。读者不需要搭建JavaScript的开发环境来练习、巩固这些知识点。因为在React Native的开发环境中编写代码就可以练习这些基本的JavaScript知识点,在React Native学习中就会巩固这些JavaScript基本知识。


React Native在开发中用到了其他JavaScript的高级知识点与ES 6的一些新特性。但读者不需要马上去学习这些内容。在通过本书学习React Native开发过程中需要使用到的JavaScript高级知识点时,会指出在附录A的什么位置讲解了这些高级知识点,便于读者快速查看。附录A不是JavaScript知识点的全面讲解,只是让读者对React Native开发中需要使用到的JavaScript知识点的理解足够进行React Native开发。


相关下载地址


笔者希望读者在阅读本书时,能在理解的基础上将例程代码输入到电脑中。输入的过程是一个消化吸收的过程。输入完成后,运行代码,并且按照提示或者针对自己有疑虑的地方进行修改,以便深入理解各个知识点。


正因为如此,本书前面章节中那些短小精悍的例程并没有附在一张光盘上,或者在网上提供下载地址,而是需要读者自己手动输入进电脑。


本书还有一些不需要读者手动输入的代码,笔者在GitHub上提供了一个网址供读者自行下载。网址是:https://github.com/xitaoque。


本书结构


本书讨论的React Native开发特性覆盖了2016年3月2日发布的React Native 0.21.0版本的绝大部分特性。没有讨论的部分在书末有提及。


首先需要说明的是,本书讨论的知识以跨平台(Android平台与iOS平台)开发为主,书中各章节的绝大部分知识点都是跨平台实现的。只有极小部分是分平台实现的,这一小部分在讨论前都会说明该部分知识适用于哪个平台。


本书的结构是按一个有基本的编程基础知识,刚学习JavaScript基本语法的读者最佳学习路径来编写的。通过一个个精简的例程,阐述清楚一个个基本思想。例程尽可能地精简,并且所有例程都是笔者花了大量时间为初学者构思而成的。


本书体例说明


代码与代码说明


本书例程中有大量的代码说明,通过注释的方式与代码同时展示出来。例如:


var IncomingCall = React.createClass({


watcher: null, //用来记录监视器


startFromLeft:true, //用来判断用户最先按下的是最左侧还是最右侧


moveNeedhandle:false, //用来判断监测到的移动事件是否需要处理


注释以黑体字显示以提醒读者注意。读者在自己的开发环境中输入例程时不需要输入注释。


React Native代码中的JSX部分代码不能使用这种注释方式,本书为了统一注释风格还是使用了这种注释方式。读者明白了这一点后,在自己输入代码实验时,将代码中的注释自行去掉。


注意和提示


注意和提示,是需要提醒读者特别注意的内容。在本书中使用带背景色的字体显示。


致谢


感谢我的父亲阙光金老师与我的母亲袁雪英老师从小到大给我的无私的爱。很抱歉无论我如何努力,也无法回报二老深恩的万分之一。


感谢我的姐姐阙喜戎与姐夫王纯,没有你们的鼎力支持,就没有今天的我。


感谢王汝馨伯父与曾钰伯母,谢谢你们对我的关怀与照顾。


感谢廖建新教授、饶牧老师在我学习工作期间对我的关怀与指导。感谢在我七年北京邮电大学学习期间为我授业解惑的所有老师,谢谢你们!


感谢React Native开发团队,感谢所有参与React Native开发的贡献者。无数移动开发者因为你们无私的奉献而受益。


感谢电子工业出版社郭立总经理、孙学瑛编辑等审校此书的辛勤工作,以及为此书能快速出版而付出的巨大努力。你们辛苦了!


感谢在工作和生活中帮助过我的所有人,感谢你们,正是因为有了你们,才有了本书的面世。


关于勘误


虽然花了很多时间和精力去核对书中的文字、代码和图片,但因为时间仓促和水平有限,书中仍难免会有一些错误和纰漏,如果大家发现什么问题,请反馈给我,相关信息可在下载本书代码的GitHub页面反馈。



Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book