I was wondering how the Java for Android book differs from other introductory Java texts. For instance, are there any particular language features or APIs that you cover that aren't typically covered in other books, because they will be important later for developing Android apps?
Kurt Van Etten
Joined: Sep 07, 2010
Oh, and please excuse my bad manners... Welcome to the Ranch, Jeff, and thanks for taking the time to answer questions here!
My book attempts to cover every language feature, including features that might be overlooked in other books. For example, did you know that you can access private fields and call private methods without using reflection? Also, why is the Enum class declared as Enum<E extends Enum<E>>? My book looks at these items and more.
Chapter 2 begins my coverage of language features. I've organized this chapter differently from similar chapters in other books because I wanted to emphasize object-based programming in terms of classes and objects. The first part, classes, looks at architecting classes, and this is where I cover fields, methods, statements, expressions, and other basic language features. The second part, objects, looks at instantiating objects from classes. I cover additional topics such as accessing fields, calling methods, chaining methods, and other topics in this section. By the time you finish this chapter, you will hopefully have a solid understanding of object-based programming.
Chapter 3 investigates object-oriented programming by focusing on inheritance, polymorphism, and interfaces. You learn about instanceof, abstract classes, the Object class, covariant methods, the real reason for the inclusion of interfaces in the language, and more from this chapter.
Chapter 4 begins a two-part series on advanced language features. This chapter focuses on nested types, packages, static imports, and exceptions. Its Chapter 5 companion focuses on assertions, annotations, generics, and enums.
These chapters have been heavily influenced by Joshua Bloch's advice in Effective Java. I wanted to stay true to the proper way of doing things as Bloch points out.
Although there is a little bit of API coverage (notably the exceptions API) in Chapter 4, my coverage of APIs doesn't really begin until Chapter 6. Also, I still cover additional miscellaneous language features in Chapter 6 and future chapters.
Chapter 6 provides a deeper treatment of Java mathematics than I've ever provided elsewhere. In addition to covering the Math, StrictMath, BigDecimal, and BigInteger classes, this chapter focuses on the strictfp reserved word. Chapter 6 also looks at the Package class, primitive wrapper classes (such as Integer and Double), and the References API.
Chapter 7 continues my basic API exploration by focusing on the Reflection API, string management (including the topic of internment and explaining why string literals are bonafide objects), the System class, and the Threading API -- including synchronization, volatile variables, and thread-local variables.
Chapter 8 focuses exclusively on the Collections Framework in terms of core interfaces, implementation classes, and utility classes. In this chapter, you will also learn about the autoboxing and enhanced for loop language features. You will also learn about legacy classes. I went nuts on this chapter and hope that I've succeeded in providing a thorough treatment of this framework.
Chapter 9 covers additional utility APIs, including the concurrency utilities, the Internationalization APIs, the Preferences API, the Random class, and the Regular Expressions API.
Finally, Chapter 10 looks at classic I/O in terms of the File class, the RandomAccessFile class, and the various stream and reader/writer classes that are found in the java.io package. You'll find extensive coverage of object serialization and deserialization (and externalization) in this chapter. You'll also learn how to create your own filter stream classes.
Each chapter ends with an extensive exercises section (before the summary). Although most exercises are long answer or true/false (to reinforce your understanding of chapter material), there are also many programming exercises to accomplish. In total, there are nearly 400 exercises in this book. You'll find the solutions in the appendix.
This book's 600 pages could not possibly cover everything that I need to say about Java. For that reason, I'm writing six PDF-based chapters to supplement this book (on topics such as modern I/O, networking, JDBC, XML, and security), and which you will be able to freely download from my http://javajeff.mb.ca website over the next few months.
I hope this brief review of LJFAD's content will give you some insight into how this book differs from others.
Wow, there are quite a few things in that list that I am not familiar with at all...looks like I've got a lot of learning ahead of me!
How important do you think it is to be well-grounded in Java before starting on Android development? Would it make more sense to work through your book more or less completely before diving into Android programming, or would it be practical to study both at the same time?
Joined: Sep 19, 2010
Depending on your current level of Java knowledge, you might want to focus on only those Java areas that are new to you, which would shorten the learning curve before getting into Android. Also depending on your schedule, you might want to start learning about general Android concepts, such as apps (which can be thought of as collections of components), activities, content providers, services, and broadcast receivers (the four kinds of components that can be used by an Android app), intents (messages that tell activities (generally the stuff that appears on the screen) to start and perform other tasks), and so on.
Unfortunately, I could not cover networking, SQLite/JDBC, security, XML, and some other important topics because of book-length and time limitations. Because these topics are also important to the aspiring Android developer, I'm working on six PDF-based chapters, an extra appendix that supplements these chapters, and a code.zip file containing the code for these chapters and the appendix. My goal is to deploy these PDF files on my website over the next few months; they will be free to download.
I heard that Android will be having classes from java as well as from googles own classes. am i correct? if such is a case then will your book put some light on it? kindly enlighten me. thanks.
"SCJP5 | SCWCD5| DEVELOPER"
Joined: Sep 19, 2010
I wish you success with Android. I hope you'll find my book helpful in providing the language/Java API foundation. Keep in mind that this book's Java material is also applicable in nonAndroid Java contexts (such as a Java ME or Java EE context).
All the best.
Google's Android API reference page identifies all of the Java packages that are accessible to Android developers. Packages prefixed by "android" are Android/Google-specific, whereas packages prefixed by "java" and most packages prefixed by "javax" are mostly compatible with Java SE APIs in those packages -- there may be minor changes, some classes/interfaces may be missing, and so on. And then there are several packages relevant to JUnit and Apache.
My book, which is not a book about Android programming, but is a book about providing thorough coverage of the Java language and foundational APIs (such as the collections framework), only focuses on "java" package APIs.
Hi, I have just bought Polish ebook edition of Jeff's book "Learn Java for Android Development" in www.helion.pl store. There is written in 10 section that he published in PDF file format 6 additionals sections. But his page is gone... May I ask you send me or post here property link to download that files? Regards.