零、简介

增强现实是移动计算领域相对较新的发展。尽管它还很年轻,但它已经是这个行业中发展最快的领域之一。公司正在投入大量资金开发使用增强现实的产品,其中最引人注目的是谷歌的谷歌眼镜项目。大多数人认为增强现实很难实现。那是一种误解。像任何好的应用一样,好的增强现实应用需要花费一些精力来编写。你所需要做的就是在潜水前保持开放的心态。

这本书是给谁的

这本书的目标读者是那些想为谷歌的 Android 平台编写应用的人。这本书希望读者熟悉 Java 语言,并了解 Android 的基础知识。然而,已经做出努力来确保即使没有这种经验的人也能理解内容和代码。希望当你看完这本书的时候,你会知道如何使用增强现实的力量编写令人惊叹的丰富的 Android 应用。

这本书的结构

这本书分为九章。我们从增强现实的基本介绍开始,并逐步介绍越来越复杂的功能。在第 5 章中,我们来看看如何处理增强现实应用中可能出现的常见错误。之后,我们有四个示例应用,展示如何使用日益复杂的增强现实应用。这里给出了更详细的结构:

  • Chapter I : This chapter gives you a concept of what augmented reality is. It has several examples of how augmented reality can be used around the world, and a short list of potential future applications.
  • Chapter 2 : This chapter guides you to write a simple augmented reality application, which consists of four main functions commonly used in augmented reality applications. By the end of this chapter, you will have a skeleton structure that can be extended to any augmented reality application.
  • Chapter III : In this chapter, you will learn about some of the most important functions of augmented reality: superposition and marking. In two sample applications, we introduced the use of standard Android widgets as overlays and the use of open source AndAR library to add tag recognition to our applications.
  • Chapter IV : Chapter IV introduces the concept of artificial horizon by using a non-augmented reality app. Then write a second application, and use the artificial horizon in the augmented reality application.
  • Chapter V : This chapter describes the most common mistakes in making augmented reality applications and provides solutions. Besides errors, it also discusses other problems that will not cause errors, but it will still prevent your application from running as expected.
  • Chapter 6 : In this chapter, we wrote the first of four sample applications. This is a very simple AR application, which can provide the basic information of the user's current location and draw it on the map.
  • Chapter 7 : This chapter shows you how to expand the example application in Chapter 6 into an appropriate application that can be used to allow the user to navigate from his/her current location to the location set by the user on the map.
  • Chapter 8 : This chapter shows you how to use AndAR library to write an augmented reality model viewer, which allows you to display 3D models on a tag.
  • Chapter 9 : The last chapter of this book demonstrates how to write the most complicated application: an augmented reality browser that displays data from Wikipedia and Twitter around you.

先决条件

本书包含一些相当高级的代码,并且假设您熟悉以下内容:

  • Java programming language
  • Basic object-oriented concept
  • Android platform (medium knowledge)
  • Fundamentals of Eclipse IDE

虽然具备所有这些先决条件并不是绝对的要求,但强烈建议这样做。你绝对需要一个 Android 设备来测试你的应用,因为应用中使用的许多功能在 Android 模拟器上是不可用的。

下载代码

本书中所示示例的代码可在 Apress 网站[www.apress.com/9781430239451](http://www.apress.com/9781430239451)上获得。在该书的信息页面上的源代码/下载选项卡下可以找到一个链接。该选项卡位于页面相关标题部分的下方。

你也可以在[http://github.com/RaghavSood/ProAndroidAugmentedReality](http://github.com/RaghavSood/ProAndroidAugmentedReality)从这本书的 GitHub 资源库获得源代码。

如果您在我们的代码中发现了一个 bug,请在 GitHub 仓库中提出问题,或者通过下面给出的方式直接联系作者。

联系作者

如果您有任何问题、评论或建议,甚至发现本书中的错误,请随时通过电子邮件或 Twitter @ app aholics 16 与作者联系。