Learning Android, 2nd Edition
معرفی کتاب «Learning Android, 2nd Edition» نوشتهٔ Gargenta, Marko;Nakamura, Masumi;Oram, Andy;Roumeliotis, Rachel، منتشرشده توسط نشر O'Reilly Media در سال 2014. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Learning Android, 2nd Edition» در دستهٔ بدون دستهبندی قرار دارد.
Want to build apps for Android devices? This book is the perfect way to master the fundamentals. Written by experts who have taught this mobile platform to hundreds of developers in large organizations and startups alike, this gentle introduction shows experienced object-oriented programmers how to use Android’s basic building blocks to create user interfaces, store data, connect to the network, and more.Throughout the book, you’ll build a Twitter-like application, adding new features with each chapter. You’ll also create your own toolbox of code patterns to help you program any type of Android application with ease.Become familiar with the Android platform and how it fits into the mobile ecosystemDive into the Android stack, including its application framework and the APK application packageLearn Android’s building blocks: Activities, Intents, Services, Content Providers, and Broadcast ReceiversCreate basic Android user interfaces and organize UI elements in Views and LayoutsBuild a service that uses a background process to update data in your application Copyright 4 Table of Contents 5 Preface 13 What鈥檚 Inside 13 Conventions Used in This Book 15 Using Code Examples 15 Safari庐 Books Online 16 How to Contact Us 16 Acknowledgments 17 Marko Gargenta 17 Masumi Nakamura 17 Chapter聽1.聽Android Overview 19 Android Overview 19 Comprehensive 19 Open Source Platform 20 Designed for Mobile Devices 20 History 21 Google鈥檚 Motivation 22 Android Compatibility 22 Open Handset Alliance 23 Android Versions 23 Android Flavors 25 Android Open Source Project 25 Manufacturer Add-Ons 25 Summary 26 Chapter聽2.聽Java Review 27 Comments 30 Data Types: Primitives and Objects 31 Modifiers 32 Arrays 33 Operators 34 Control Flow Statements 34 Error/Exception Handling 37 Complex Example 40 Interfaces and Inheritance 44 Collections 45 Generics 46 Threads 46 Summary 47 Chapter聽3.聽The Stack 49 Stack Overview 49 Linux 49 Android != Linux 51 Native Layer 51 HAL 52 Native Libraries 52 Native Daemons 53 Native Tools 54 Dalvik 54 Android and Java 55 Application Framework 57 Applications 58 Android Application Package (APK) 58 Application Signing 59 Application Distribution 59 Summary 60 Chapter聽4.聽Installing and Beginning Use of Android Tools 61 Installing Java Development Kit 61 Installing the Android SDK 63 Setting Up a PATH to Tools 63 Installing Eclipse 64 Eclipse Workspace 64 Setting Up Android Development Tools 64 Hello World! 66 Creating a New Project 66 Anatomy of an Android Project 68 Android Manifest File 69 String Resources 72 Layout XML Code 73 Drawable Resources 74 The R File 74 Java Source Code 75 Building the Project 76 Android Emulator 77 An Emulator Versus a Physical Phone 77 Summary 80 Chapter聽5.聽Main Building Blocks 81 A Real-World Example 81 Activities 82 Activity Life Cycle 82 Intents 86 Services 86 Content Providers 88 Broadcast Receivers 90 Application Context 90 Summary 92 Chapter聽6.聽Yamba Project Overview 93 The Yamba Application 93 Design Philosophy 97 Project Design 98 Part 1: Android User Interface 99 Part 2: Intents, ActionBar, and More 100 Part 3: Android Services 100 Part 4: Content Providers 101 Part 5: Lists and Adapters 101 Part 6: Broadcast Receivers 102 Part 7: App Widgets 102 Part 8: Networking and the Web (HTTP) 103 Part 9: Live Wallpaper and Handlers 103 Summary 103 Chapter聽7.聽Android User Interface 105 Two Ways to Create a User Interface 105 Declarative User Interface 105 Programmatic User Interface 106 The Best of Both Worlds 106 Views and Layouts 106 LinearLayout 107 TableLayout 108 FrameLayout 109 RelativeLayout 110 Starting the Yamba Project 111 The StatusActivity Layout 115 Important Widget Properties 119 Strings Resource 121 The StatusActivity Java Class 122 Inflating XML to Java 122 Initializing Objects 124 Handling User Events 125 Logging Messages in Android 126 LogCat 126 Compiling Code and Building Your Projects: Saving Files 127 Adding the Twitter API Library 130 Updating the Manifest File for Internet Permission 131 Threading in Android 132 Single Thread 132 Multithreaded Execution 133 AsyncTask 134 Other UI Events 137 Alternative Resources 142 Summary 145 Chapter聽8.聽Fragments 147 Fragment Example 147 Fragment Life Cyle 154 Dynamically Adding Fragments 155 Summary 157 Chapter聽9.聽Intents, Action Bar, and More 159 Preferences 159 Preference Resource 160 SettingsActivity 163 Update the Manifest File 165 The Action Bar 166 Creating a Blank Main Activity 167 The Menu Resource 168 Android System Resources 170 Loading the Menu 171 Updating StatusActivity to Handle Menu Events 172 Shared Preferences and Updating Status Fragment 173 The Filesystem Explained 175 Exploring the Filesystem 176 Filesystem Partitions 176 System Partition 176 SDCard Partition 176 The User Data Partition 178 Filesystem Security 179 Summary 179 Chapter聽10.聽Services 181 Our Example Service: RefreshService 182 Creating the RefreshService Java Class 182 Introducing IntentService 184 Update the Manifest File 185 Add Menu Items 186 Update the Options Menu Handling 186 Testing the Service 187 Pulling Data from Yamba 187 Testing the Service 190 Summary 190 Chapter聽11.聽Content Providers 193 Databases on Android 193 About SQLite 194 DbHelper 194 The Database Schema and Its Creation 195 Four Major Operations 195 Cursors 196 Status Contract Class 197 Update RefreshService 199 Testing the Service 202 Content Providers 204 Creating a Content Provider 205 Defining the URI 205 Getting the Data Type 207 Inserting Data 209 Updating Data 210 Deleting Data 211 Querying Data 212 Updating the Android Manifest File 217 Updating RefreshService 218 Summary 219 Chapter聽12.聽Lists and Adapters 221 MainActivity 221 Basic MainActivity 221 Timeline Fragment 223 Creating a List Item Layout 224 About Adapters 225 Loading the Data 226 Custom Logic via ViewBinder 229 Details View 231 Details Fragment 232 Details Activity 234 Register with the Manifest File 235 Main Activity, Landscape View 235 Updating TimelineFragment 236 Summary 239 Chapter聽13.聽Broadcast Receivers 241 About Broadcast Receivers 241 BootReceiver 242 Registering the BootReceiver with the Android Manifest File 243 Testing the Boot Receiver 243 Alarms and System Services 243 Broadcasting Intents 245 Notification Receiver 248 Summary 249 Chapter聽14.聽App Widgets 251 Using Content Providers Through Widgets 251 Implementing the YambaWidget Class 252 Creating the XML Layout 255 Creating the AppWidgetProviderInfo File 256 Updating the Manifest File 256 Testing the Widget 257 Summary 257 Chapter聽15.聽Networking and Web Overview 259 Quick Example 259 Networking Basics 260 HTTP API 262 Apache HTTP Client 263 HttpUrlConnection 266 Networking in the Background using AsyncTask and AsyncTaskLoader 269 Summary 269 Chapter聽16.聽Interaction and Animation: Live Wallpaper and Handlers 271 Live Wallpaper 271 Handler 278 Summary 280 Index 281 About the Authors 288
دانلود کتاب Learning Android, 2nd Edition