Learn Java for Android Development (eBook)

(Autor)

eBook Download: PDF
2010 | 1st ed.
XV, 656 Seiten
Apress (Verlag)
978-1-4302-3157-8 (ISBN)

Lese- und Medienproben

Learn Java for Android Development - Jeff Friesen
Systemvoraussetzungen
34,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
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 foundational APIs to improve your chances of succeeding as an Android app developer. After all, you will be busy learning the architecture of an Android app, the various Android-specific APIs, and Android-specific tools. If you do not already know Java fundamentals, you will probably end up with a massive headache from also having to quickly cram those fundamentals into your knowledge base.  

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.  



Jeff Friesen is a freelance tutor and software developer with an emphasis on Java (and now Android). In addition to authoring Learn Java for Android Development and co-authoring Android Recipes -- Jeff has written numerous articles on Java and other technologies for JavaWorld (a href='http://www.JavaWorld.com'JavaWorld.com/a), informIT (a href='http://www.InformIT.com'InformIT.com/a), a href='http://www.java.net'Java.net/a, and DevSource (a href='http://www.DevSource.com'DevSource.com/a). Jeff can be contacted via his website at a href='http://www.tutortutor.ca'TutorTutor.ca/a.


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 foundational APIs to improve your chances of succeeding as an Android app developer. After all, you will be busy learning the architecture of an Android app, the various Android-specific APIs, and Android-specific tools. If you do not already know Java fundamentals, you will probably end up with a massive headache from also having to quickly cram those fundamentals into your knowledge base. 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.

Jeff Friesen is a freelance tutor and software developer with an emphasis on Java (and now Android). In addition to authoring Learn Java for Android Development and co-authoring Android Recipes -- Jeff has written numerous articles on Java and other technologies for JavaWorld (a href="http://www.JavaWorld.com"JavaWorld.com/a), informIT (a href="http://www.InformIT.com"InformIT.com/a), a href="http://www.java.net"Java.net/a, and DevSource (a href="http://www.DevSource.com"DevSource.com/a). Jeff can be contacted via his website at a href="http://www.tutortutor.ca"TutorTutor.ca/a.

Title Page 1
Copyright Page 2
Contents at a Glance 4
Table of contents 5
About the Author 10
About the Technical Reviewer 11
Acknowledgments 12
Introduction 13
Chapter 1 Getting Started with Java 16
What Is Java? 16
Java Is a Language 17
Java Is a Platform 18
Java SE, Java EE, Java ME, and Android 20
Installing and Exploring the JDK 21
Installing and Exploring Two Popular IDEs 27
NetBeans IDE 28
Eclipse IDE 32
Four of a Kind 35
Understanding Four of a Kind 36
Modeling Four of a Kind in Pseudocode 36
Converting Pseudocode to Java Code 38
Compiling, Running, and Distributing FourOfAKind 52
Summary 56
Chapter 2 Learning Language Fundamentals 57
Classes 57
Declaring Classes 58
Introducing Fields 59
Declaring Fields 59
Initializing Fields 62
Simple Expressions 62
Compound Expressions 65
Read-only Fields 71
Introducing Methods 72
Declaring Methods 72
Implementing Methods 74
Empty Statements, Local Variable Declarations, Assignments, and Method Calls 75
Decisions 76
Loops 80
Break and Continue 84
Method Return 87
Overloaded Methods 88
Introducing Constructors 89
Introducing Other Initializers 90
Class Initializers 91
Instance Initializers 91
Initialization Order 92
Interface Versus Implementation 96
Objects 99
Creating Objects and Arrays 99
Accessing Fields 101
Calling Methods 103
Method-Call Stack 104
Recursive Calls 104
Argument Passing 105
Chained Instance Method Calls 106
Garbage Collection 106
Summary 108
Chapter 3 Learning Object-Oriented Language Features 111
Inheritance 111
Extending Classes 112
The Ultimate Superclass 117
Cloning 118
Equality 120
Finalization 123
Hash Codes 124
String Representation 125
Composition 126
The Trouble with Implementation Inheritance 126
Polymorphism 130
Upcasting and Late Binding 131
Abstract Classes and Abstract Methods 134
Downcasting and Runtime Type Identification 135
Covariant Return Types 137
Interfaces 139
Declaring Interfaces 139
Implementing Interfaces 141
Extending Interfaces 144
Why Use Interfaces? 145
Summary 151
Chapter 4 Mastering Advanced Language Features Part 1 152
Nested Types 152
Static Member Classes 152
Nonstatic Member Classes 155
Anonymous Classes 159
Local Classes 161
Interfaces Within Classes 163
Packages 164
What Are Packages? 164
Package Names Must Be Unique 165
The Package Statement 165
The Import Statement 166
Searching for Packages and Types 167
Compile-Time Search 167
Runtime Search 168
Playing with Packages 168
Packages and JAR Files 172
Static Imports 173
Exceptions 174
What Are Exceptions? 175
Representing Exceptions in Source Code 175
Error Codes Versus Objects 175
The Throwable Class Hierarchy 176
Checked Exceptions Versus Runtime Exceptions 177
Custom Exception Classes 178
Throwing Exceptions 179
Handling Exceptions 181
Performing Cleanup 185
Summary 191
Chapter 5 Mastering Advanced Language Features Part 2 193
Assertions 193
Declaring Assertions 194
Using Assertions 195
Internal Invariants 195
Control-Flow Invariants 196
Design-by-Contract 197
Preconditions 197
Postconditions 199
Class Invariants 200
Avoiding Assertions 200
Enabling and Disabling Assertions 201
Annotations 202
Discovering Annotations 202
Declaring Annotation Types and Annotating Source Code 205
Using Meta-Annotations in Annotation Type Declarations 208
Processing Annotations 210
Generics 212
Collections and the Need for Type Safety 212
Generic Types 214
Declaring and Using Your Own Generic Types 215
Type Parameter Bounds 217
Type Parameter Scope 220
The Need for Wildcards 220
Reification and Erasure 223
Generic Methods 224
Enums 226
The Trouble with Traditional Enumerated Types 226
The Enum Alternative 227
Enhancing an Enum 228
The Enum Class 232
Extending the Enum Class 233
Summary 237
Chapter 6 Exploring the Basic APIs Part 1 239
Math APIs 239
Math and StrictMath 239
BigDecimal 246
BigInteger 251
Package Information 255
Primitive Wrapper Classes 259
Boolean 260
Character 262
Float and Double 263
Integer, Long, Short, and Byte 267
Number 269
References API 269
Basic Terminology 269
Reference and ReferenceQueue 271
SoftReference 272
WeakReference 275
PhantomReference 275
Summary 280
Chapter 7 Exploring the Basic APIs Part 2 281
Reflection API 281
String Management 289
String 290
StringBuffer 293
System 296
Threading API 299
Runnable and Thread 300
Thread Synchronization 308
Summary 325
Chapter 8 Discovering the Collections Framework 326
Framework Overview 326
Comparable Versus Comparator 327
Iterable and Collection 329
Iterator and the Enhanced For Loop Statement 332
Autoboxing and Unboxing 334
List 336
ArrayList 340
LinkedList 341
Set 343
TreeSet 343
HashSet 344
EnumSet 348
SortedSet 350
Queue 357
PriorityQueue 359
Map 362
TreeMap 366
HashMap 367
IdentityHashMap 373
WeakHashMap 375
EnumMap 377
SortedMap 378
Utilities 380
Classic Collections Classes 383
Summary 390
Chapter 9 Discovering Additional Utility APIs 392
Concurrency Utilities 392
Executors 392
Synchronizers 401
Concurrent Collections 403
Locks 405
Atomic Variables 408
Internationalization APIs 408
Locales 409
Resource Bundles 411
Property Resource Bundles 414
List Resource Bundles 416
Break Iterators 420
Collators 424
Dates, Time Zones, and Calendars 426
Formatters 432
Number Formatters 432
Date Formatters 435
Message Formatters 437
Preferences API 439
Random Number Generation 443
Regular Expressions API 445
Summary 458
Chapter 10 Performing I/O 460
File 460
RandomAccessFile 473
Streams 484
Stream Classes Overview 484
OutputStream and InputStream 486
ByteArrayOutputStream and ByteArrayInputStream 488
FileOutputStream and FileInputStream 490
PipedOutputStream and PipedInputStream 492
FilterOutputStream and FilterInputStream 496
BufferedOutputStream and BufferedInputStream 503
DataOutputStream and DataInputStream 504
Object Serialization and Deserialization 507
Default Serialization and Deserialization 507
Custom Serialization and Deserialization 512
Externalization 517
PrintStream 519
Writers and Readers 522
Writer and Reader Classes Overview 523
Writer and Reader 524
OutputStreamWriter and InputStreamReader 525
FileWriter and FileReader 529
Summary 541
The Road Goes Ever On 541
Appendix Solutions to Exercises 543
Chapter 1: Getting Started with Java 543
Chapter 2: Learning Language Fundamentals 549
Chapter 3: Learning Object-Oriented Language Features 552
Chapter 4: Mastering Advanced Language Features Part 1 559
Chapter 5: Mastering Advanced Language Features Part 2 565
Chapter 6: Exploring the Basic APIs Part 1 570
Chapter 7: Exploring the Basic APIs Part 2 573
Chapter 8: Discovering the Collections Framework 579
Chapter 9: Discovering Additional Utility APIs 585
Chapter 10: Performing I/O 591
Index 604

Erscheint lt. Verlag 28.12.2010
Zusatzinfo XV, 656 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Betriebssysteme / Server Android
Mathematik / Informatik Informatik Netzwerke
Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung Mobile- / App-Entwicklung
Schlagworte Android • app development • Apple iPad • Apple iphone • Java • Technology
ISBN-10 1-4302-3157-2 / 1430231572
ISBN-13 978-1-4302-3157-8 / 9781430231578
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 3,6 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich