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.
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 Android SDK offers powerful features, and this book is the fastest path to mastering them—and the rest of the Andorid SDK—for programmers with some experience who are new to Android smartphone and tablet apps development. Many books introduce the Android SDK, but very few explain how to develop apps optimally. This book teaches both core Java language concepts and how to wisely but rapidly employ the design patterns and logic using the Android SDK, which is based on Java APIs.
You'll also learn best practices that ensure your code will be efficient and perform well.
Get an accelerated but complete enough treatment of the fundamentals of Java necessary to get you started. Design your first app using prototyping and other design methods. Build your first Android app using the code given over the course of the book. Finally, debug and distribute your first app on Google Play or other Android app store. After reading this book, you'll have your first app ready and on the app store, earning you the prestige and the money you seek.
Android game app development continues to be one of the hottest areas where indies and existing game app developers seem to be most active. Android is the second best mobile apps eco and arguably even a hotter game apps eco than iOS. 3D makes your games come alive; so in this book you'll find that we go in depth on creating 3D games for the Android platform with OpenGL ES 2.0 using an original case study game called Drone Grid.
Moreover, this book offers an extensive case study with code that will be modular and re-useable helping you create your own games using advanced vertex and fragment shaders. Drone Grid is a game app case study that is somewhat similar to the best selling Geometry Wars game series utilizing a gravity grid and colorful abstract graphics and particles.
After reading and using this book, you'll be able to build your first 3D Android game app for smartphones and tablets. You may even be able to upload and sell from popular Android app stores like Google Play and Amazon Appstore.
Are you trying to start a career in programming, but haven't found the right way in? Do you have a great idea for an app, but don't know how to make it a reality? Or maybe you're just frustrated that “to learn Android, you must know java.” If so, Android Programming for Beginners is for you. You don't need any programming experience to follow along with this book, just a computer and a sense of adventure.What You Will LearnMaster the fundamentals of coding Java for AndroidInstall and set up your Android development environmentBuild functional user interfaces with the Android Studio visual designerAdd user interaction, data captures, sound, and animation to your appsManage your apps' data using the built-in Android SQLite databaseFind out about the design patterns used by professionals to make top-grade applicationsBuild, deploy, and publish real Android applications to the Google Play marketplaceIn Detail
Android is the most popular OS in the world. There are millions of devices accessing tens of thousands of applications. It is many people's entry point into the world of technology; it is an operating system for everyone. Despite this, the entry-fee to actually make Android applications is usually a computer science degree, or five years' worth of Java experience.
Android Programming for Beginners will be your companion to create Android applications from scratch—whether you're looking to start your programming career, make an application for work, be reintroduced to mobile development, or are just looking to program for fun. We will introduce you to all the fundamental concepts of programming in an Android context, from the Java basics to working with the Android API. All examples are created from within Android Studio, the official Android development environment that helps supercharge your application development process.
After this crash-course, we'll dive deeper into Android programming and you'll learn how to create applications with a professional-standard UI through fragments, make location-aware apps with Google Maps integration, and store your user's data with SQLite. In addition, you'll see how to make your apps multilingual, capture images from a device's camera, and work with graphics, sound, and animations too.
By the end of this book, you'll be ready to start building your own custom applications in Android and Java.Style and approach
With more than 40 mini apps to code and run, Android Programming for Beginners is a hands-on guide to learning Android and Java. Each example application demonstrates a different aspect of Android programming. Alongside these mini apps, we push your abilities by building three larger applications to demonstrate Android application development in context.
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.