Learn Java for Android Development, Second Edition teaches programmers of any skill level the essential Java language and foundational Java API skills that must be learned to improve the programmer’s chances of succeeding as an Android app developer. Each of the book’s 14 chapters provides an exercise section that gives you the opportunity to reinforce your understanding of the chapter’s material. Answers to the book’s more than 500 exercises are provided in an appendix. A second appendix provides a significant game-oriented Java application, which you can convert into an Android app.
Once you complete this book, you should be ready to dive into beginning Android app development. Maybe, start that journey with Apress' Beginning Android.
Android development is hot, and many programmers are interested in joining the fun. However, because this technology is based on Java, you should first obtain a solid grasp of the Java language and its APIs in order to improve your chances of succeeding as an effective Android app developer. This book helps you do that.
Each of the book’s 16 chapters provides an exercise section that gives you the opportunity to reinforce your understanding of the chapter’s material. Answers to the book’s more than 700 exercises are provided in an appendix. A second appendix provides a significant game-oriented Java application, which you can convert into an Android app.
Once you complete this one-of-a-kind book written by Jeff Friesen, an expert Java developer and JavaWorld.com columnist, you should be ready to begin your indie or professional Android app development journey.
This book presents the following table of contents:
Chapter 1 introduces you to Java and begins to cover the Java language by focusing on fundamental concepts such as comments, identifiers, variables, expressions, and statements.
Chapter 2 continues to explore this language by presenting all of its features for working with classes and objects. You learn about features related to class declaration and object creation, encapsulation, information hiding, inheritance, polymorphism, interfaces, and garbage collection.
Chapter 3 focuses on the more advanced language features related to nested classes, packages, static imports, exceptions, assertions, annotations, generics, and enums. Additional chapters introduce you to the few features not covered in Chapters 1
Chapter 4 largely moves away from covering language features (although it does introduce class literals and strictfp) while focusing on language-oriented APIs. You learn about Math, StrictMath, Package, Primitive Type Wrapper Classes, Reference, Reflection, String, StringBuffer and StringBuilder, Threading, BigDecimal, and BigInteger in this chapter.
Chapter 5 begins to explore Java's utility APIs by focusing largely on the Collections Framework. However, it also discusses legacy collection-oriented APIs and how to create your own collections.
Chapter 6 continues to focus on utility APIs by presenting the concurrency utilities along with the Objects and Random classes.
Chapter 7 moves you away from the command-line user interfaces that appear in previous chapters and toward graphical user interfaces. You first learn about the Abstract Window Toolkit foundation, and then explore the Java Foundation Classes in
terms of Swing and Java 2D. Appendix C explores Accessibility and Drag and Drop.
Chapter 8 explores filesystem-oriented I/O in terms of the File, RandomAccessFile, stream, and writer/reader classes.
Chapter 9 introduces you to Java's network APIs (e.g., sockets). It also introduces you to the JDBC API for interacting with databases along with the Java DB database product.
Chapter 10 dives into Java's XML support by first presenting an introduction to XML (including DTDs and schemas). It next explores the SAX, DOM, StAX, XPath, and XSLT APIs. It even briefly touches on the Validation API. While exploring XPath, you encounter namespace contexts, extension functions and function resolvers, and variables and variable resolvers.
Chapter 11 introduces you to Java's support for SOAP-based and RESTful web services. As well as providing you with the basics of these web service categories, Chapter 11 presents some advanced topics, such as working with the SAAJ API to communicate
with a SOAP-based web service without having to rely on JAX-WS. You will appreciate having learned about XML in Chapter 10 before diving into this chapter.
Chapter 12 helps you put to use some of the knowledge you've gathered in previous chapters by showing you how to use Java to write an Android app's source code. This chapter introduces you to Android, discusses its architecture, shows you how to
install necessary tools, and develops a simple app.
Appendix A presents the solutions to the programming exercises that appear near the end of Chapters 1 through 12.
Appendix B introduces you to Java's Scripting API along with Java 7's support for dynamically typed languages.
Appendix C introduces you to additional APIs and architecture topics. Examples include Accessibility, classloaders, Console, Drag and Drop, Java Native Interface, and System Tray.
Appendix D presents a gallery of significant applications that demonstrate various aspects of Java.
Unfortunately, there are limits to how much knowledge can be crammed into a print book. For this reason, Appendixes A, B, C, and D are not included in this book's pages. Instead, these appendixes are freely distributed as PDF files. Appendixes A and B are bundled with the book's associated code file at the Apress website (http://www.apress.com/9781430239093). Appendixes C and D are bundled with their respective code files at my TutorTutor.ca website
The remaining nine chapters organize features into the following categories: core libraries, GUI toolkits: AWT, GUI toolkits: Swing, internationalization, Java Database Connectivity, monitoring and management, networking, scripting, and security and web services. While exploring these chapters, you will encounter a variety of useful and interesting topics: introducing a new locale with its own currency, creating a new JConsole plug–in, creating a scripted JEditorPane component, invoking and communicating with JavaFX Script and JRuby scripts from a Java application that interacts with the Scripting API, signing an arbitrary XML document and validating a signed document’s XML signature, and accessing an existing web service are examples.
With a few exceptions, each of chapters 2 through 10 alphabetically organizes its topics for convenient access. Furthermore, all 10 chapters end with a “Test Your Understanding” section that provides questions and exercises to help you reinforce your understanding of what you have read.
Additional features are covered in the first three appendices. The first appendix introduces you to annotation types for annotation processors, Common Annotations 1.0, and several tables that conveniently organize additional annotation types that are new to Java SE 6. The second appendix explores changes made to various Java tools. For example, the Java compiler tool now supports annotation processing—you'll learn how to take advantage of this capability by writing your own annotation processor. Another example: you'll learn how to interact with the command–line script shell. The third appendix looks at a variety of performance enhancements, ranging from a fix for the gray–rect problem to single–threaded rendering.
The second-to-last appendix provides answers and code to all of the questions and exercises in the various “Test Your Understanding” sections. The final appendix anticipates Java SE 7 by looking at features most likely to make the cut, including closures, the Java Module System, and the Swing Application Framework.
By the time you finish this book, you will have mastered most of what’s new and improved in Java SE 6. Although a few features, such as multiple gradient paints and an in–depth look at StAX are not covered, you will find a growing list of articles devoted to these additional topics on the author’s website (JavaJeff.mb.ca). Follow the links at the bottom of the website’s Articles page.
Each chapter ends with select exercises designed to challenge your grasp of the chapter's content. An appendix provides the answers to these exercises.
What You'll LearnMaster the XML language
Learn how to validate XML documents
Learn how to parse XML documents with the SAX, DOM, and StAX APIs
Learn how to create XML documents with the DOM and StAX APIs
Learn how to extract values from XML documents with the XPath API
Learn how to transform XML documents with the XSLT API
Master the JSON format
Learn how to validate JSON documents
Learn how to parse and create JSON documents with the mJson and Gson APIs
Learn how to extract values from JSON documents with the JsonPath API
Who This Book Is For
/divIntermediate or advanced Java programmers/developers.
After reading and using this book, you'll gain the accelerated knowledge and skill level to really build applications with efficient data access, especially for today's cloud computing streaming data needs.
Java's thread APIs and concurrency utilities are among its most powerful and challenging APIs and language features. Java beginners typically find it very difficult to use these features to write correct multithreaded applications. Threads and the Concurrency Utilities helps all Java developers master and use these capabilities effectively.
This book is divided into two parts of four chapters each. Part 1 focuses on the Thread APIs and Part 2 focuses on the concurrency utilities. In Part 1, you learn about Thread API basics and runnables, synchronization and volatility, waiting and notification, and the additional capabilities of thread groups, thread local variables, and the Timer Framework. In Part 2, you learn about concurrency utilities basics and executors, synchronizers, the Locking Framework, and the additional capabilities of concurrent collections, atomic variables, and the Fork/Join Framework.
Each chapter ends with select exercises designed to challenge your grasp of the chapter's content. An appendix provides the answers to these exercises. A second appendix explores how threads are used by various standard class library APIs. Specifically, you learn about threads in the contexts of Swing, JavaFX, and Java 8's Streams API.
What You Will Learn
• How to do thread runnables, synchronization, volatility, waiting and notification, thread groups, thread local variables, and the Timer Framework• How to create multithreaded applications that work correctly.• What are concurrency utilities basics and executors• What are synchronizers, the Locking Framework, concurrent collections, atomic variables, and the Fork/Join Framework and how to use them• How to leverage the concurrency utilities to write more complex multithreaded applications and achieve greater performance• How to apply thread usage in Swing, JavaFX, and Java 8 Streams API contexts
The primary audience is Java beginners and the secondary audience is more advanced Java developers who have worked with the Thread APIs and the Concurrency Utilities.
Android Recipes: A Problem-Solution Approach, Second Edition offers more than 100 down-to-earth code recipes, and guides you step-by-step through a wide range of useful topics using complete and real-world working code examples. It's updated to include the Jelly Bean Android SDK as well as earlier releases.
Instead of abstract descriptions of complex concepts, in Android Recipes, you'll find live code examples. When you start a new project, you can consider copying and pasting the code and configuration files from this book, then modifying them for your own customization needs.
Crammed with insightful instruction and helpful examples, this second edition of Android Recipes is your guide to writing apps for one of today’s hottest mobile platforms. It offers pragmatic advice that will help you get the job done quickly and well. This can save you a great deal of work over creating a project from scratch!
Learn Java for Android Development teaches programmers of any skill level the essential Java language and foundational Java API skills that must be learned to improve the programmer’s chances of succeeding as an Android app developer. Each of the book’s 10 chapters provides an exercise section that gives you the opportunity to reinforce your understanding of the chapter’s material. Answers to the book’s more than 300 exercises are provided in an appendix. Additionally, author Jeff Friesen has created six bonus chapters that you can download from his personal site, located at http://tutortutor.ca/cgi-bin/makepage.cgi?/books/ljfad.
Once you complete this book, you will be ready to dive into Android, and you can start that journey by obtaining a copy of Beginning Android 2.
Android Recipes: A Problem-Solution Approach, Third Edition offers more than 100 down-to-earth code recipes, and guides you step-by-step through a wide range of useful topics using complete and real-world working code examples. It's updated to include the KitKat Android 4.4 SDK as well as earlier releases.
Instead of abstract descriptions of complex concepts, in Android Recipes, you'll find live code examples. When you start a new project you can consider copying and pasting the code and configuration files from this book and then modifying them for your own customization needs.
Crammed with insightful instruction and helpful examples, this third edition of Android Recipes is your guide to writing apps for one of today’s hottest mobile platforms. It offers pragmatic advice that will help you get the job done quickly and well. This can save you a great deal of work over creating a project from scratch!