Absolutely Australia's Lowest Prices

We won't be beaten by anyone. Guaranteed

Android: How to Program

Product Details

Table of Contents

Preface xixBefore You Begin xxxi1 Introduction to Android 11.1 Introduction 21.2 Android-The World's Leading Mobile Operating System 31.3 Android Features 31.4 Android Operating System 71.4.1 Android 2.2 (Froyo) 71.4.2 Android 2.3 (Gingerbread) 81.4.3 Android 3.0 through 3.2 (Honeycomb) 81.4.4 Android 4.0 through 4.0.4 (Ice Cream Sandwich) 81.4.5 Android 4.1-4.3 (Jelly Bean) 91.4.6 Android 4.4 (KitKat) 101.5 Downloading Apps from Google Play 111.6 Packages 121.7 Android Software Development Kit (SDK) 131.8 Object-Oriented Programming: A Quick Refresher 161.8.1 The Automobile as an Object 171.8.2 Methods and Classes 171.8.3 Instantiation 171.8.4 Reuse 171.8.5 Messages and Method Calls 171.8.6 Attributes and Instance Variables 181.8.7 Encapsulation 181.8.8 Inheritance 181.8.9 Object-Oriented Analysis and Design (OOAD) 181.9 Test-Driving the Doodlz App in an Android Virtual Device (AVD) 191.9.1 Running the Doodlz App in the Nexus 4 Smartphone AVD 191.9.2 Running the Doodlz App in a Tablet AVD 281.9.3 Running the Doodlz App on an Android Device 301.10 Building Great Android Apps 301.11 Android Development Resources 321.12 Wrap-Up 352 Welcome App 38Dive-Into (R) the Android Developer Tools: Introducing Visual GUI Design, Layouts, Accessibility and Internationalization2.1 Introduction 392.2 Technologies Overview 402.2.1 Android Developer Tools IDE 402.2.2 TextViews and ImageViews 402.2.3 App Resources 402.2.4 Accessibility 402.2.5 Internationalization 402.3 Creating an App 412.3.1 Launching the Android Developer Tools IDE 412.3.2 Creating a New Project 412.3.3 New Android Application Dialog 422.3.4 Configure Project Step 432.3.5 Configure Launcher Icon Step 432.3.6 Create Activity Step 452.3.7 Blank Activity Step 462.4 Android Developer Tools Window 472.4.1 Package Explorer Window 482.4.2 Editor Windows 482.4.3 Outline Window 482.4.4 App Resource Files 482.4.5 Graphical Layout Editor 492.4.6 The Default GUI 492.5 Building the App's GUI with the Graphical Layout Editor 512.5.1 Adding Images to the Project 512.5.2 Changing the Id Property of the RelativeLayout and the TextView 522.5.3 Configuring the TextView 532.5.4 Adding ImageViews to Display the Images 572.6 Running the Welcome App 592.7 Making Your App Accessible 602.8 Internationalizing Your App 622.9 Wrap-Up 663 Tip Calculator App 69Introducing GridLayout, LinearLayout, EditText, SeekBar, Event Handling, NumberFormat and Defining App Functionality with Java3.1 Introduction 703.2 Test-Driving the Tip Calculator App 713.3 Technologies Overview 723.3.1 Class Activity 723.3.2 Activity Lifecycle Methods 723.3.3 Arranging Views with LinearLayout and GridLayout 733.3.4 Creating and Customizing the GUI with the Graphical Layout Editor and the Outline and Properties Windows 733.3.5 Formatting Numbers as Locale-Specific Currency and Percentage Strings 743.3.6 Implementing Interface TextWatcher for Handling EditText Text Changes 743.3.7 Implementing Interface OnSeekBarChangeListener for Handling SeekBar Thumb Position Changes 743.3.8 AndroidManifest.xml 753.4 Building the App's GUI 753.4.1 GridLayout Introduction 753.4.2 Creating the TipCalculator Project 773.4.3 Changing to a GridLayout 773.4.4 Adding the TextViews, EditText, SeekBar and LinearLayouts 783.4.5 Customizing the Views to Complete the Design 803.5 Adding Functionality to the App 843.6 AndroidManifest.xml 923.7 Wrap-Up 934 Twitter (R) Searches App 97SharedPreferences, Collections, ImageButton, ListView, ListActivity, ArrayAdapter, Implicit Intents and AlertDialogs4.1 Introduction 984.2 Test-Driving the App 994.2.1 Importing the App and Running It 994.2.2 Adding a Favorite Search 1004.2.3 Viewing Twitter Search Results 1014.2.4 Editing a Search 1024.2.5 Sharing a Search 1044.2.6 Deleting a Search 1044.2.7 Scrolling Through Saved Searches 1054.3 Technologies Overview 1054.3.1 ListView 1054.3.2 ListActivity 1064.3.3 Customizing a ListActivity's Layout 1064.3.4 ImageButton 1064.3.5 SharedPreferences 1064.3.6 Intents for Launching Other Activities 1074.3.7 AlertDialog 1074.3.8 AndroidManifest.xml 1084.4 Building the App's GUI 1084.4.1 Creating the Project 1084.4.2 activity_main.xml Overview 1094.4.3 Adding the GridLayout and Components 1104.4.4 Graphical Layout Editor Toolbar 1154.4.5 ListView Item's Layout: list_item.xml 1164.5 Building the MainActivity Class 1174.5.1 package and import Statements 1174.5.2 Extending ListActivity 1194.5.3 Fields of Class MainActivity 1194.5.4 Overriding Activity Method onCreate 1204.5.5 Anonymous Inner Class That Implements the saveButton's OnClickListener to Save a New or Updated Search 1224.5.6 addTaggedSearch Method 1244.5.7 Anonymous Inner Class That Implements the ListView's OnItemClickListener to Display Search Results 1254.5.8 Anonymous Inner Class That Implements the ListView's OnItemLongClickListener to Share, Edit or Delete a Search 1274.5.9 shareSearch Method 1294.5.10 deleteSearch Method 1304.6 AndroidManifest.xml 1324.7 Wrap-Up 1325 Flag Quiz App 136Fragments, Menus, Preferences, AssetManager, Tweened Animations, Handler, Toasts, Explicit Intents, Layouts for Multiple Device Orientations5.1 Introduction 1375.2 Test-Driving the Flag Quiz App 1395.2.1 Importing the App and Running It 1395.2.2 Configuring the Quiz 1395.2.3 Taking the Quiz 1415.3 Technologies Overview 1435.3.1 Menus 1435.3.2 Fragments 1435.3.3 Fragment Lifecycle Methods 1445.3.4 Managing Fragments 1445.3.5 Preferences 1445.3.6 assets Folder 1445.3.7 Resource Folders 1455.3.8 Supporting Different Screen Sizes and Resolutions 1455.3.9 Determining the Screen Size 1465.3.10 Toasts for Displaying Messages 1465.3.11 Using a Handler to Execute a Runnable in the Future 1465.3.12 Applying an Animation to a View 1465.3.13 Logging Exception Messages 1475.3.14 Using an Explicit Intent to Launch Another Activity in the Same App 1475.3.15 Java Data Structures 1475.4 Building the GUI and Resource Files 1475.4.1 Creating the Project 1475.4.2 strings.xml and Formatted String Resources 1485.4.3 arrays.xml 1495.4.4 colors.xml 1505.4.5 dimens.xml 1505.4.6 activity_settings.xml Layout 1515.4.7 activity_main.xml Layout for Phone and Tablet Portrait Orientation 1515.4.8 fragment_quiz.xml Layout 1515.4.9 activity_main.xml Layout for Tablet Landscape Orientation 1545.4.10 preferences.xml for Specifying the App's Settings 1555.4.11 Creating the Flag Shake Animation 1565.5 MainActivity Class 1585.5.1 package Statement, import Statements and Fields 1585.5.2 Overridden Activity Method onCreate 1595.5.3 Overridden Activity Method onStart 1615.5.4 Overridden Activity Method onCreateOptionsMenu 1615.5.5 Overridden Activity Method onOptionsItemSelected 1625.5.6 Anonymous Inner Class That Implements OnSharedPreferenceChangeListener 1635.6 QuizFragment Class 1645.6.1 package Statement and import Statements 1645.6.2 Fields 1655.6.3 Overridden Fragment Method onCreateView 1665.6.4 Method updateGuessRows 1685.6.5 Method updateRegions 1695.6.6 Method resetQuiz 1695.6.7 Method loadNextFlag 1715.6.8 Method getCountryName 1735.6.9 Anonymous Inner Class That Implements OnClickListener 1735.6.10 Method disableButtons 1765.7 SettingsFragment Class 1765.8 SettingsActivity Class 1775.9 AndroidManifest.xml 1775.10 Wrap-Up 1786 Cannon Game App 182Listening for Touches, Manual Frame-By-Frame Animation, Graphics, Sound, Threading, SurfaceView and SurfaceHolder6.1 Introduction 1836.2 Test-Driving the Cannon Game App 1856.3 Technologies Overview 1856.3.1 Attaching a Custom View to a Layout 1856.3.2 Using the Resource Folder raw 1856.3.3 Activity and Fragment Lifecycle Methods 1856.3.4 Overriding View Method onTouchEvent 1866.3.5 Adding Sound with SoundPool and AudioManager 1866.3.6 Frame-by-Frame Animation with Threads, SurfaceView and SurfaceHolder 1866.3.7 Simple Collision Detection 1876.3.8 Drawing Graphics Using Paint and Canvas 1876.4 Building the App's GUI and Resource Files 1876.4.1 Creating the Project 1876.4.2 strings.xml 1886.4.3 fragment_game.xml 1886.4.4 activity_main.xml 1896.4.5 Adding the Sounds to the App 1896.5 Class Line Maintains a Line's Endpoints 1896.6 MainActivity Subclass of Activity 1906.7 CannonGameFragment Subclass of Fragment 1906.8 CannonView Subclass of View 1926.8.1 package and import Statements 1926.8.2 Instance Variables and Constants 1936.8.3 Constructor 1946.8.4 Overriding View Method onSizeChanged 1966.8.5 Method newGame 1976.8.6 Method updatePositions 1986.8.7 Method fireCannonball 2016.8.8 Method alignCannon 2026.8.9 Method drawGameElements 2036.8.10 Method showGameOverDialog 2056.8.11 Methods stopGame and releaseResources 2066.8.12 Implementing the SurfaceHolder.Callback Methods 2076.8.13 Overriding View Method onTouchEvent 2086.8.14 CannonThread: Using a Thread to Create a Game Loop 2096.9 Wrap-Up 2107 Doodlz App 215Two-Dimensional Graphics, Canvas, Bitmap, Accelerometer, SensorManager, Multitouch Events, MediaStore, Printing, Immersive Mode7.1 Introduction 2167.2 Technologies Overview 2187.2.1 Using SensorManager to Listen for Accelerometer Events 2187.2.2 Custom DialogFragments 2187.2.3 Drawing with Canvas and Bitmap 2197.2.4 Processing Multiple Touch Events and Storing Lines in Paths 2197.2.5 Android 4.4 Immersive Mode 2197.2.6 GestureDetector and SimpleOnGestureListener 2197.2.7 Saving the Drawing to the Device's Gallery 2197.2.8 Android 4.4 Printing and the Android Support Library's PrintHelper Class 2207.3 Building the App's GUI and Resource Files 2207.3.1 Creating the Project 2207.3.2 strings.xml 2207.3.3 dimens.xml 2217.3.4 Menu for the DoodleFragment 2227.3.5 activity_main.xml Layout for MainActivity 2237.3.6 fragment_doodle.xml Layout for DoodleFragment 2237.3.7 fragment_color.xml Layout for ColorDialogFragment 2247.3.8 fragment_line_width.xml Layout for LineWidthDialogFragment 2267.3.9 Adding Class EraseImageDialogFragment 2277.4 MainActivity Class 2287.5 DoodleFragment Class 2297.6 DoodleView Class 2367.7 ColorDialogFragment Class 2487.8 LineWidthDialogFragment Class 2517.9 EraseImageDialogFragment Class 2557.10 Wrap-Up 2568 Address Book App 260ListFragment, FragmentTransactions and the Fragment Back Stack, Threading and AsyncTasks, CursorAdapter, SQLite and GUI Styles8.1 Introduction 2618.2 Test-Driving the Address Book App 2648.3 Technologies Overview 2648.3.1 Displaying Fragments with FragmentTransactions 2658.3.2 Communicating Data Between a Fragment and a Host Activity 2658.3.3 Method onSaveInstanceState 2658.3.4 Defining Styles and Applying Them to GUI Components 2658.3.5 Specifying a Background for a TextView 2658.3.6 Extending Class ListFragment to Create a Fragment That Contains a ListView 2668.3.7 Manipulating a SQLite Database 2668.3.8 Performing Database Operations Outside the GUI Thread with AsyncTasks 2668.4 Building the GUI and Resource Files 2668.4.1 Creating the Project 2668.4.2 Creating the App's Classes 2678.4.3 strings.xml 2678.4.4 styles.xml 2688.4.5 textview_border.xml 2698.4.6 MainActivity's Layout: activity_main.xml 2708.4.7 DetailsFragment's Layout: fragment_details.xml 2708.4.8 AddEditFragment's Layout: fragment_add_edit.xml 2728.4.9 Defining the Fragments' Menus 2738.5 MainActivity Class 2748.6 ContactListFragment Class 2808.7 AddEditFragment Class 2878.8 DetailsFragment Class 2938.9 DatabaseConnector Utility Class 3018.10 Wrap-Up 3069 Google Play and App Business Issues 3109.1 Introduction 3119.2 Preparing Your Apps for Publication 3119.2.1 Testing Your App 3129.2.2 End User License Agreement 3129.2.3 Icons and Labels 3129.2.4 Versioning Your App 3139.2.5 Licensing to Control Access to Paid Apps 3139.2.6 Obfuscating Your Code 3139.2.7 Getting a Private Key for Digitally Signing Your App 3149.2.8 Screenshots 3149.2.9 Promotional App Video 3159.3 Pricing Your App: Free or Fee 3169.3.1 Paid Apps 3179.3.2 Free Apps 3179.4 Monetizing Apps with In-App Advertising 3189.5 Monetizing Apps: Using In-App Billing to Sell Virtual Goods 3199.6 Registering at Google Play 3209.7 Setting Up a Google Wallet Merchant Account 3219.8 Uploading Your Apps to Google Play 3229.9 Launching the Play Store from Within Your App 3239.10 Managing Your Apps in Google Play 3249.11 Other Android App Marketplaces 3249.12 Other Popular Mobile App Platforms 3249.13 Marketing Your Apps 3259.14 Wrap-Up 329A Introduction to Java Applications 332A.1 Introduction 333A.2 Your First Program in Java: Printing a Line of Text 333A.3 Modifying Your First Java Program 337A.4 Displaying Text with printf 339A.5 Another Application: Adding Integers 339A.6 Memory Concepts 343A.7 Arithmetic 344A.8 Decision Making: Equality and Relational Operators 347A.9 Wrap-Up 351B Introduction to Classes, Objects, Methods and Strings 356B.1 Introduction 357B.2 Declaring a Class with a Method and Instantiating an Object of a Class 357B.3 Declaring a Method with a Parameter 360B.4 Instance Variables, set Methods and get Methods 363B.5 Primitive Types vs. Reference Types 367B.6 Initializing Objects with Constructors 368B.7 Floating-Point Numbers and Type double 370B.8 Wrap-Up 374C Control Statements 378C.1 Introduction 379C.2 Algorithms 379C.3 Pseudocode 380C.4 Control Structures 380C.5 if Single-Selection Statement 381C.6 if...else Double-Selection Statement 381C.7 while Repetition Statement 384C.8 Case Study: Counter-Controlled Repetition 384C.9 Case Study: Sentinel-Controlled Repetition 388C.10 Case Study: Nested Control Statements 393C.11 Compound Assignment Operators 396C.12 Increment and Decrement Operators 396C.13 Primitive Types 398C.14 Essentials of Counter-Controlled Repetition 399C.15 for Repetition Statement 400C.16 Examples Using the for Statement 402C.17 do...while Repetition Statement 404C.18 switch Multiple-Selection Statement 405C.19 break and continue Statements 412C.20 Logical Operators 412C.21 Wrap-Up 415D Methods: A Deeper Look 423D.1 Introduction 424D.2 ProgramModules in Java 424D.3 static Methods, static Fields and Class Math 425D.4 Declaring Methods with Multiple Parameters 427D.5 Notes on Declaring and Using Methods 430D.6 Method-Call Stack and Activation Records 431D.7 Argument Promotion and Casting 431D.8 Java API Packages 432D.9 Introduction to Random-Number Generation 433D.9.1 Scaling and Shifting of Random Numbers 434D.9.2 Random-Number Repeatability for Testing and Debugging 435D.10 Case Study: A Game of Chance; Introducing Enumerations 436D.11 Scope of Declarations 440D.12 Method Overloading 442D.13 Wrap-Up 445E Arrays and ArrayLists 452E.1 Introduction 453E.2 Arrays 453E.3 Declaring and Creating Arrays 454E.4 Examples Using Arrays 455E.5 Case Study: Card Shuffling and Dealing Simulation 464E.6 Enhanced for Statement 468E.7 Passing Arrays to Methods 469E.8 Case Study: Class GradeBook Using an Array to Store Grades 473E.9 Multidimensional Arrays 478E.10 Case Study: Class GradeBook Using a Two-Dimensional Array 482E.11 Class Arrays 488E.12 Introduction to Collections and Class ArrayList 490E.13 Wrap-Up 493F Classes and Objects: A Deeper Look 498F.1 Introduction 499F.2 Time Class Case Study 499F.3 Controlling Access to Members 503F.4 Referring to the Current Object's Members with the this Reference 504F.5 Time Class Case Study: Overloaded Constructors 506F.6 Default and No-Argument Constructors 512F.7 Composition 513F.8 Enumerations 516F.9 Garbage Collection 518F.10 static Class Members 519F.11 final Instance Variables 523F.12 Packages 523F.13 Package Access 524F.14 Wrap-Up 524G Object-Oriented Programming: Inheritance and Polymorphism 527G.1 Introduction to Inheritance 528G.2 Superclasses and Subclasses 529G.3 protected Members 530G.4 Relationship between Superclasses and Subclasses 531G.4.1 Creating and Using a CommissionEmployee Class 531G.4.2 Creating and Using a BasePlusCommissionEmployee Class 536G.4.3 Creating a CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy 541G.4.4 CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables 544G.4.5 CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables 547G.5 Class Object 552G.6 Introduction to Polymorphism 553G.7 Polymorphism: An Example 554G.8 Demonstrating Polymorphic Behavior 555G.9 Abstract Classes and Methods 558G.10 Case Study: Payroll SystemUsing Polymorphism 559G.10.1 Abstract Superclass Employee 560G.10.2 Concrete Subclass SalariedEmployee 563G.10.3 Concrete Subclass HourlyEmployee 565G.10.4 Concrete Subclass CommissionEmployee 566G.10.5 Indirect Concrete Subclass BasePlusCommissionEmployee 568G.10.6 Polymorphic Processing, Operator instanceof and Downcasting 569G.10.7 Summary of the Allowed Assignments Between Superclass and Subclass Variables 574G.11 final Methods and Classes 575G.12 Case Study: Creating and Using Interfaces 576G.12.1 Developing a Payable Hierarchy 577G.12.2 Interface Payable 578G.12.3 Class Invoice 579G.12.4 Modifying Class Employee to Implement Interface Payable 581G.12.5 Modifying Class SalariedEmployee for Use in the Payable Hierarchy 583G.12.6 Using Interface Payable to Process Invoices and Employees Polymorphically 585G.13 Common Interfaces of the Java API 586G.14 Wrap-Up 587H Exception Handling: A Deeper Look 591H.1 Introduction 592H.2 Example: Divide by Zero without Exception Handling 592H.3 Example: Handling ArithmeticExceptions and InputMismatchExceptions 594H.4 When to Use Exception Handling 599H.5 Java Exception Hierarchy 599H.6 finally Block 602H.7 Stack Unwinding and Obtaining Information from an Exception Object 606H.8 Wrap-Up 609I GUI Components and Event Handling 612I.1 Introduction 613I.2 Nimbus Look-and-Feel 613I.3 Text Fields and an Introduction to Event Handling with Nested Classes 614I.4 Common GUI Event Types and Listener Interfaces 620I.5 How Event Handling Works 621I.6 JButton 623I.7 JComboBox; Using an Anonymous Inner Class for Event Handling 627I.8 Adapter Classes 630I.9 Wrap-Up 631J Other Java Topics 632J.1 Introduction 633J.2 Collections Overview 633J.3 Type-Wrapper Classes for Primitive Types 634J.4 Interface Collection and Class Collections 634J.5 Lists 635J.5.1 ArrayList and Iterator 635J.5.2 LinkedList 637J.5.3 Views into Collections and Arrays Method as List 640J.6 Collections Methods 642J.6.1 Method sort 642J.6.2 Method shuffle 644J.7 Interface Queue 645J.8 Sets 645J.9 Maps 646J.10 Introduction to Files and Streams 649J.11 Class File 650J.12 Introduction to Object Serialization 651J.13 Introduction to Multithreading 652J.14 Creating and Executing Threads with the Executor Framework 653J.15 Overview of Thread Synchronization 657J.16 Concurrent Collections Overview 658J.17 Multithreading with GUI 658J.18 Wrap-Up 665K Operator Precedence Chart 668L Primitive Types 670Index 671

About the Author

Paul Deitel, CEO and Chief Technical Officer of Deitel & Associates, Inc., is a graduate of MIT, where he studied Information Technology. He holds the Java Certified Programmer and Java Certified Developer certifications, and is an Oracle Java Champion. Through Deitel & Associates, Inc., he has delivered hundreds of programming courses worldwide to clients, including Cisco, IBM, Siemens, Sun Microsystems, Dell, Fidelity, NASA at the Kennedy Space Center, the National Severe Storm Laboratory, White Sands Missile Range, Rogue Wave Software, Boeing, SunGard Higher Education, Nortel Networks, Puma, iRobot, Invensys and many more. He and his co-author, Dr. Harvey M. Deitel, are the world's best-selling programming-language textbook/professional book/ video authors. Dr. Harvey Deitel, Chairman and Chief Strategy Officer of Deitel & Associates, Inc., has 50 years of experience in the computer field. Dr. Deitel earned B.S. and M.S. degrees in Electrical Engineering from MIT and a Ph.D. in Mathematics from Boston University. He has extensive college teaching experience, including earning tenure and serving as the Chairman of the Computer Science Department at Boston College before founding Deitel & Associates, Inc., in 1991 with his son, Paul Deitel. The Deitels' publications have earned international recognition, with translations published in Simplified Chinese, Traditional Chinese, Korean, Japanese, German, Russian, Spanish, French, Polish, Italian, Portuguese, Greek, Urdu and Turkish. Dr. Deitel has delivered hundreds of programming courses to corporate, academic, government and military clients. Abbey Deitel, President of Deitel & Associates, Inc., is a graduate of Carnegie Mellon University's Tepper School of Management where she received a B.S. in Industrial Management. Abbey has been managing the business operations of Deitel & Associates, Inc. for 16 years. She has contributed to numerous Deitel & Associates publications and, together with Paul and Harvey, is the co-author of Android for Programmers: An App-Driven Approach, 2/e, iPhone for Programmers: An App-Driven Approach, Internet & World Wide Web How to Program, 5/e, Visual Basic 2012 How to Program, 6/e and Simply Visual Basic 2010, 5/e.

Ask a Question About this Product More...
Write your question below:
Look for similar items by category
Home » Books » Computers » Programming » Java
This title is unavailable for purchase as none of our regular suppliers have stock available. If you are the publisher, author or distributor for this item, please visit this link.
Back to top