Android网络开发从入门到精通.pdf

收藏

编号:20200522091644827134    类型:共享资源    大小:12.87MB    格式:PDF    上传时间:2020-05-22
  
1
文币
关 键 词:
Android 网络 开发 入门 精通
资源描述:
移动平台开发书库 Android 网络开发从入门到精通 代林峰 等编著 机 械 工 业 出 版 社 在 Android 系统从诞生到现在的短短几年时间里,它凭借操作的易用性 和开发的简洁性,已牢牢占据智能手机操作系统市场占有率榜首的位置。而 在 Android 应用开发领域中,网络开发一直是贯穿 Android 知识体系的核心 内容之一。本书全部内容分为四篇,共计 17 章,循序渐进地讲解了 Android 网络开发方面的知识。本书从搭建开发环境和核心框架分析讲起,依次讲解 了 Android 系统概述,Android 网络开发基础,Java 中的网络通信基础,下 载、上传数据,Socket 数据通信,处理 XML 数据,WebKit 浏览网页,开发 移动网页,开发蓝牙应用程序,开发 Wi-Fi 应用程序,NFC 近场通信技术详 解,开发电子邮件应用程序,Android 典型网络应用实践,开发移动微博应 用程序,开发 Web 版的电话本管理系统,开发移动微信系统,开发仿陌陌 交友系统等高级知识。 本书几乎涵盖了Android网络开发中的所有主要内容, 并且全书内容言简意赅,讲解方法通俗易懂、详细,不但适合应用开发高手 们的学习,也特别适合初学者的系统学习。 本书适合 Android 初学者、Android 爱好者、Android 网络开发人员和移动 浏览器开发人员,也可以作为相关培训学校和大专院校相关专业的教学用书。 图书在版编目(CIP)数据 Android 网络开发从入门到精通/代林峰等编著.—北京:机械工业出版社, 2015.10 (移动平台开发书库) ISBN 978-7-111-52203-4 Ⅰ.①A… Ⅱ.①代… Ⅲ.①移动终端―应用程序―程序设计 Ⅳ.①TN929.53 中国版本图书馆 CIP 数据核字(2015)第 271402 号 机械工业出版社(北京市百万庄大街 22 号 邮政编码 100037) 策划编辑:丁 诚 责任校对:张艳霞 责任编辑:丁 诚 张 恒 责任印制:李 洋 保定市中画美凯印刷有限公司印刷 2016 年 1? 月第 1 版·第 1 次印刷 184mm×260mm·34 印张·841 千字 3001―???? 册 标准书号:ISBN 978-7-111-52203-4 定价: ?????元(含 1CD) 凡购本书,如有缺页、倒页、脱页,由本社发行部调换 电话服务网络服务 服务咨询热线: (010)88361066 机 工 官 网: 读者购书热线: (010)68326294 机 工 官 博: 读者购书热线: (010)88379203 教育服务网: 封面无防伪标均为盗版金 书 网:www.golden- III 前 言 Android 是一款于 2007 年 11 月 5 日发布的基于 Linux 平台的开源手机操作系统, 该平台 由操作系统、中间件、用户界面和应用软件组成,是首个专为移动终端而打造的移动软件。 根据国际数据公司(IDC)公布的统计数据,在 2014 年第一季度,Android 系统和 iOS 系统 所占的装机量已达到所有智能手机出货量的 92.3%。在 2014 年头三个月,安装 Android 系统 的智能手机数量升至 1.821 亿部。我们有理由相信,在未来一段时间内,Android 将依旧牢牢 地占据着智能手机操作系统第一的位置。 市场需求分析 较高的市场占有率造就了更多开发人员关注这款操作系统,当然也不乏很多初学者,所 以也就很自然地成就了相关书籍的畅销。但是在市面中已有的书籍中,大多数是入门级的教 材,而关于 Android 网络开发领域书籍屈指可数,Android 网络开发领域的专业级书籍更是寥 寥无几。 只有更加专业才能造就 Android 开发的殿堂级高手!为了让广大初学者可以对 Android 网络开发有一个更加深入的认识,而不是停留在入门级而止步不前。本书对 Android 网络开 发方面的知识进行了细致的分析, “提炼”出了 Android 系统开发的本质,并依此为基础,学 以致用地讲解了在现实中开发典型网络项目的实现流程。 本书的内容 本书全部内容共分为 4 篇,共计 17 章,循序渐进地讲解了 Android 网络应用开发方面的 知识。本书从搭建开发环境和核心框架分析讲起,依次讲解了 Android 技术概述,Android 技 术核心框架分析,Java 中的网络通信基础,WebKit 浏览网页,开发移动网页,开发蓝牙应用 程序,开发 Wi-Fi 应用程序,NFC 近场通信技术详解,开发电子邮件应用程序,Android 网络 典型应用实践,开发移动微博应用程序,开发 Web 版的电话本管理系统,移动微信系统,仿 陌陌交友系统,下载、上传数据,Socket 数据通信,处理 XML 数据等高级知识。本书几乎涵 盖了 Android 网络应用开发中的所有主要内容,并且全书内容言简意赅,讲解方法通俗易懂、 详细,不但适合应用开发高手们的学习,也特别有利于初学者学习并消化。 本书的版本 Android 系统自 2008 年 9 月发布第一个版本 1.1 以来,截至 2015 年 10 月发布的最新版 本 6.0,一共存在十多个版本。由此可见,Android 系统升级频率较快,一年之中至少有两个 新版本诞生。 但是如果过于追求新版本, 会造成力不从心的后果。 所以在此建议广大读者: “不 必追求最新的版本,我们只需关注最流行的版本即可” 。据官方统计,截至 2015 年 10 月,占 据前三位的版本分别是 Android 4.2,Android 4.4 和 Android 5.0。 IV 2014 年 10 月,谷歌 I/O 大会在旧金山开幕。会上谷歌发布了 Android 5.0 系统,其正式 版本于 2014 年 10 月 16 日推出。本书的内容以编者撰稿时的最新版本 Android 5.0 为基础, 并且兼容了 Android 4.4 及其以前的版本,详细讲解了 Android 网络应用开发的相关知识。 本书特色 本书内容丰富、细致、全面。我们的目标是通过本书,提供多本图书的价值,读者可以 根据自己的需求有选择地阅读。在内容的编写上,本书具有以下特色。 (1)结构合理 从用户的实际需求出发,科学安排知识结构,内容由浅入深,叙述清楚。全书详细地讲 解了和 Android 网络应用开发有关的知识,内容循序渐进,由浅入深。 (2)遵循“理论介绍—演示实例—综合演练”这一主线 为了使广大读者彻底弄清楚 Android 网络应用开发的每一个知识点,在讲解时依次剖析 了基本理论、演示实例分析、综合实战演练等内容。遵循了从理论到实践这一学习过程,实 现了实践教学这一目标。 (3)易学易懂 本书内容条理清晰、语言简洁,可以帮助读者快速掌握每个知识点。使读者既可以按照 本书编排的章节顺序进行学习,也可以根据自己的需求对某一章节进行针对性的学习。 (4)实用性强 本书彻底摒弃枯燥的理论和简单的操作,注重实用性和可操作性,通过简洁的语言和细 致的描述,详细讲解了各个知识点的基本知识。 (5)内容全面 本书是市面上内容较全面的一本 Android 网络应用开发书,无论是开发环境搭建,还是 各个常用、常见的网络系统,在本书中都有讲述。 读者对象 ● Android 编程的初学者。 ● 大中专院校的教师和学生。 ● Android 编程爱好者。 ● 相关培训机构的教师和学员。 ● 从事 Android 网络开发的程序员。 致谢 本书的编写人员有代林峰、管西京、周秀、张余、李佐彬、王梦、王书鹏、唐凯、关立 勋、张建敏、杨靖宇、谭贞军、杨絮、刘英田、高秀云、任杰、张子帝、黄河、孟娜、杨国 华、王南荻、翟明、焦甜甜、张储、刘继虎。在本书的编写过程中,始终本着科学、严谨的 态度,力求精益求精,但错误、疏漏之处在所难免,敬请广大读者批评指正。 编 者 V 目 录 前言 第一篇 基础知识篇 第 1 章 Android 系统概述 ············································································································ 1 1.1 智能手机系统介绍 ··········································································································· 1 1.1.1 何谓智能手机············································································································· 1 1.1.2 当前主流的智能手机操作系统 ····················································································· 1 1.2 Android 5.0 的新功能 ······································································································ 2 1.3 Android 的巨大优势 ········································································································ 3 1.3.1 优点一——系出名门 ·································································································· 3 1.3.2 优点二——强大的开发团队 ························································································ 3 1.3.3 优点三——诱人的奖励机制 ························································································ 4 1.3.4 优点四——开源 ········································································································· 4 1.4 搭建 Android 应用开发环境 ···························································································· 4 1.4.1 安装 Android SDK 的系统要求 ····················································································· 5 1.4.2 安装 JDK ··················································································································· 5 1.4.3 获取并安装 Eclipse 和 Android SDK ············································································· 9 1.4.4 安装 ADT ················································································································ 12 1.4.5 设定 Android SDK Home ··························································································· 14 1.4.6 验证开发环境··········································································································· 15 1.4.7 创建 Android 虚拟设备(AVD) ····················································································· 16 1.4.8 启动 AVD 模拟器 ····································································································· 19 1.5 第一段 Android 程序 ····································································································· 20 1.5.1 新建 Android 工程 ···································································································· 21 1.5.2 编写代码 ················································································································· 21 1.5.3 调试 ························································································································ 22 1.5.4 运行项目 ················································································································· 24 第 2 章 Android 网络开发基础 ·································································································· 26 2.1 Android SDK 帮助文档介绍 ·························································································· 26 2.2 Android 工程文件结构介绍 ··························································································· 28 2.2.1 src 目录 ··················································································································· 29 2.2.2 文件 AndroidManfest.xml ··························································································· 29 2.2.3 定义常量的文件 ······································································································· 30 2.3 Android 中的数据存储方式 ··························································································· 31 2.3.1 SharedPreferences 存储 ······························································································ 32 VI 2.3.2 文件存储 ················································································································· 34 2.3.3 SQLite 存储 ············································································································· 35 2.3.4 Content Provider 存储 ································································································ 42 2.3.5 网络存储 ················································································································· 45 2.4 访问操作 SD 卡(手机中的存储卡) ·········································································· 48 2.4.1 解决思路 ················································································································· 49 2.4.2 具体实现 ················································································································· 49 2.5 总结和网络开发有关的包 ····························································································· 57 第二篇 核心技术篇 第 3 章 Java 中的网络通信基础 ································································································· 58 3.1 Java 中的网络包 ············································································································ 58 3.1.1 InetAddress 类详解 ···································································································· 58 3.1.2 URLDecoder 类和 URLEncoder 类 ·············································································· 59 3.1.3 URL 和 URLConnection ····························································································· 59 3.1.4 HttpURLConnection··································································································· 64 3.2 Android 网络接口 ·········································································································· 66 3.2.1 .http 中的类 ······························································································· 67 3.2.2 实战演练——在手机屏幕中传递 HTTP 参数 ······························································· 67 第 4 章 下载、上传数据 ·············································································································· 73 4.1 下载网络中的图片数据 ································································································· 73 4.2 下载网络中的 JSON 数据 ····························································································· 75 4.2.1 JSON 基础 ··············································································································· 76 4.2.2 远程下载服务器中的 JSON 数据 ················································································ 77 4.3 下载某个网页的源码 ····································································································· 82 4.4 多线程下载 ···················································································································· 85 4.4.1 多线程下载文件的过程 ····························································································· 85 4.4.2 在 Android 系统中实现多线程下载 ············································································· 85 4.5 上传文件到远程服务器 ······························································································· 102 4.6 GET 上传数据 ·············································································································· 106 4.6.1 使用 GET 方式上传数据的流程 ················································································ 106 4.6.2 实战演练——采用 GET 方法向服务器传递数据 ························································ 107 4.7 POST 上传数据 ············································································································· 111 第 5 章 Socket 数据通信 ············································································································ 117 5.1 Socket 编程初步 ············································································································ 117 5.1.1 TCP/IP 基础 ············································································································ 117 5.1.2 UDP ······················································································································· 118 5.1.3 基于 Socket 的 Java 网络编程 ···················································································· 118 5.2 TCP 编程详解 ··············································································································· 119 VII 5.2.1 使用 ServletSocket··································································································· 120 5.2.2 使用 Socket ············································································································ 120 5.2.3 TCP 中的多线程 ····································································································· 123 5.2.4 实现非阻塞 Socket 通信 ·························································································· 127 5.3 UDP 编程 ····················································································································· 133 5.3.1 使用 DatagramSocket ······························································································· 133 5.3.2 使用 MulticastSocket ······························································································· 138 5.4 在 Android 中使用 Socket 实现数据传输 ··································································· 141 第 6 章 处理 XML 数据 ············································································································ 145 6.1 XML 技术基础············································································································· 145 6.1.1 XML 概述 ·············································································································· 145 6.1.2 XML 的语法 ·········································································································· 145 6.1.3 获取 XML 文档 ······································································································ 146 6.2 使用 SAX 解析 XML 数据 ·························································································· 148 6.2.1 SAX 的原理 ··········································································································· 148 6.2.2 基于对象和基于事件的接口 ···················································································· 149 6.2.3 常用的接口和类 ····································································································· 150 6.2.4 实战演练——在 Android 系统中使用 SAX 解析 XML 数据 ········································· 153 6.3 使用 DOM 解析 XML ································································································· 156 6.3.1 DOM 概述 ············································································································· 156 6.3.2 DOM 的结构 ·········································································································· 157 6.3.3 实战演练——在 Android 系统中使用 DOM 解析 XML 数据 ······································· 158 6.4 PULL 解析技术 ··········································································································· 161 6.4.1 PULL 解析原理 ······································································································ 161 6.4.2 实战演练——在 Android 系统中使用 PULL 解析 XML 数据 ······································· 161 6.5 实战演练——三种解析方式的综合演练 ··································································· 164 第 7 章 WebKit 浏览网页 ········································································································· 174 7.1 WebKit 类库介绍 ························································································
展开阅读全文
  文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
0条评论

还可以输入200字符

暂无评论,赶快抢占沙发吧。

关于本文
本文标题:Android网络开发从入门到精通.pdf
链接地址:http://www.wenkunet.com/p-2185382.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

文库网用户QQ群:731843829    百度熊掌号:文库网精选     微信公众号:WENKUNET

copyright© 2018-2020 文库网 wenkunet.com 网站版权所有

经营许可证编号:粤ICP备19143267号-1 


1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10.png