Preface

I have always thought of Java as a way of coding and an ecosystem, not just a language and virtual machine. When you code in Java you are part of a mature culture with amazing tools and expertise. When I joined the webOS team nearly two years ago I knew HTML and CSS very well, but very little JavaScript. Over time I have become pretty good at JavaScript but my newfound knowledge still can’t compare to my fifteen years of mad Java skillz. With Java, and the mature Java tools, I can knock out code in half the time. I didn’t want to give up my existing skills to play in the new world of smart devices.

I know I am not the only Java developer facing the job of building cross-platform mobile apps. The Java ecosystem is so big that any solution for using Java in new ways can be immediately used by millions of hard working developers. So I began to research the available options and found GWT and PhoneGap, two brilliant open source projects that let us take Java to new and exciting places. My research turned into a few prototypes, then a few developer talks, a webcast, and finally the book you are reading now.

Even before I began to write I knew I wanted to create a book that was both very hands on and also very short. We are busy people who need tools that work now. We don’t have time to spend learning the framework of the week. That meant I had to leave a lot out. GWT is a mature but still growing technology. To truly cover GWT itself would require an entire 500-page book unto itself. To even cover the mobile parts would be beyond what this text could cover. So I decided to focus just on what you need to get started and be productive right away. After reading this book you will be ready to build your own apps and, if you desire, jump into the rich world of third party libraries and tools. The last chapter lists a few to help you get started.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This icon signifies a tip, suggestion, or general note.

Caution

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Building Mobile Applications with Java by Joshua Marinacci (O’Reilly). Copyright 2012 Joshua Marinacci, 978-1-449-30823-0.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari® Books Online

Note

Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://shop.oreilly.com/product/0636920021063.do

To comment or ask technical questions about this book, send email to:

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

I would like to thank my editor, Shawn, who has kept this project focused, even as the my own schedule slipped many times due to unexpected events. I would also like to thank my two tech reviewers, Chuq and Cooper, who gave me great feedback and verified my approach. And finally I must thank my wife, Jen, who encouraged me to write even as we are raising our new baby son, Jesse. His will be a world full of rich and fascinating mobile devices. I hope this book will fill them with fun and exciting things.

Get Building Mobile Applications with Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.