Programming Android. Java Programming for the New Generation of Mobile Devices. 2nd Edition - Helion
ISBN: 978-14-493-5847-1
stron: 566, Format: ebook
Data wydania: 2012-09-28
Księgarnia: Helion
Cena książki: 152,15 zł (poprzednio: 176,92 zł)
Oszczędzasz: 14% (-24,77 zł)
Get thoroughly up to speed on Android programming, and learn how to create up-to-date user experiences for both handsets and tablets. With this book's extensively revised second edition, you'll focus on Android tools and programming essentials, including best practices for using Android 4 APIs. If you're experienced with Java or Objective-C, you'll gain the knowledge necessary for building well-engineered applications.
Programming Android is organized into four parts:
- Part One helps programmers with some Java or iOS experience get off to a fast start with the Android SDK and Android programming basics.
- Part Two delves into the Android framework, focusing on user interface and graphics class hierarchies, concurrency, and databases. It's a solid foundation for understanding of how the most important parts of an Android application work.
- Part Three features code skeletons and patterns for accelerating the development of apps that use web data and Android 4 user interface conventions and APIs.
- Part Four delivers practical coverage of Android's multimedia, search, location, sensor, and account APIs, plus the Native Development Kit, enabling developers to add advanced capabilities.
This updated edition of Programming Android focuses on the knowledge and developer priorities that are essential for successful Android development projects.
Osoby które kupowały "Programming Android. Java Programming for the New Generation of Mobile Devices. 2nd Edition", wybierały także:
- Kotlin w praktyce. Kurs video. Tworzenie aplikacji webowych za pomocą Spring Boota 79,00 zł, (31,60 zł -60%)
- Platforma Xamarin. Kurs video. Poziom drugi. Zaawansowane techniki tworzenia aplikacji cross-platform 99,00 zł, (39,60 zł -60%)
- Android Studio. Kurs video. Narzędzia Android developera 69,00 zł, (31,05 zł -55%)
- Android. Techniki efektywnej pracy. Kurs video. Poziom pierwszy. Skróty klawiszowe i biblioteki 59,00 zł, (26,55 zł -55%)
- Testowanie aplikacji mobilnych na platformę Android. Kurs video. Poziom pierwszy. Testy jednostkowe i UI 59,00 zł, (26,55 zł -55%)
Spis treści
Programming Android. Java Programming for the New Generation of Mobile Devices. 2nd Edition eBook -- spis treści
- Programming Android
- Preface
- How This Book Is Organized
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- I. Tools and Basics
- 1. Installing the Android SDK and Prerequisites
- Installing the Android SDK and Prerequisites
- The Java Development Kit (JDK)
- The Eclipse Integrated Development Environment (IDE)
- The Android SDK
- Adding Build Targets to the SDK
- The Android Developer Tools (ADT) Plug-in for Eclipse
- Using the Install New Software Wizard to download and install the ADT plug-in
- Configuring the ADT plug-in
- Test Drive: Confirm That Your Installation Works
- Making an Android Project
- Making an Android Virtual Device (AVD)
- Running a Program on an AVD
- Running a Program on an Android Device
- Troubleshooting SDK Problems: No Build Targets
- Components of the SDK
- The Android Debug Bridge (adb)
- The Dalvik Debug Monitor Server (DDMS)
- Components of the ADT Eclipse Plug-in
- The Android Layout Editor
- The Android Manifest Editor
- XML editors for other Android XML files
- Building Android apps
- Running and debugging Android apps
- The DDMS
- Android Virtual Devices
- QEMU
- The SDK and AVD Manager
- Other SDK Tools
- Hierarchy Viewer
- Layoutopt
- Monkey
- sqlite3
- keytool
- Zipalign
- Draw 9-patch
- android
- Keeping Up-to-Date
- Keeping the Android SDK Up-to-Date
- Keeping Eclipse and the ADT Plug-in Up-to-Date
- Keeping the JDK Up-to-Date
- Example Code
- SDK Example Code
- Example Code from This Book
- On Reading Code
- Installing the Android SDK and Prerequisites
- 2. Java for Android
- Android Is Reshaping Client-Side Java
- The Java Type System
- Primitive Types
- Objects and Classes
- Object Creation
- The Object Class and Its Methods
- Objects, Inheritance, and Polymorphism
- Final and Static Declarations
- Abstract Classes
- Interfaces
- Exceptions
- The Java Collections Framework
- Collection interface types
- Collection implementation types
- Java generics
- Garbage Collection
- Scope
- Java Packages
- Access Modifiers and Encapsulation
- Idioms of Java Programming
- Type Safety in Java
- Encapsulation
- Getters and setters
- Using Anonymous Classes
- Modular Programming in Java
- Basic Multithreaded Concurrent Programming in Java
- Synchronization and Thread Safety
- Thread Control with wait() and notify() Methods
- Synchronization and Data Structures
- Type Safety in Java
- 3. The Ingredients of an Android Application
- Traditional Programming Models Compared to Android
- Activities, Intents, and Tasks
- Other Android Components
- Service
- Content Providers
- Using a content provider
- Content providers and the Internet
- BroadcastReceiver
- Component Life Cycles
- The Activity Life Cycle
- On Porting Software to Android
- Static Application Resources and Context
- Organizing Java Source
- Resources
- Application Manifests
- Initialization Parameters in AndroidManifest.xml
- Packaging an Android Application: The .apk File
- The Android Application Runtime Environment
- The Dalvik VM
- Zygote: Forking a New Process
- Sandboxing: Processes and Users
- The Android Libraries
- Extending Android
- The Android Application Template
- Overrides and Callbacks
- Polymorphism and Composition
- Extending Android Classes
- Concurrency in Android
- AsyncTask and the UI Thread
- Threads in an Android Process
- Serialization
- Java Serialization
- Parcelable
- Classes That Support Serialization
- Serialization and the Application Life Cycle
- 4. Getting Your Application into Users Hands
- Application Signing
- Public Key Encryption and Cryptographic Signing
- How Signatures Protect Software Users, Publishers, and Secure Communications
- Self-signed certificates for Android software
- Signing an Application
- Debug certificates
- Creating a self-signed certificate
- Dont lose it!
- Using a self-signed certificate to sign an application
- Placing an Application for Distribution in the Android Market
- Becoming an Official Android Developer
- Uploading Applications in the Market
- Getting Paid
- Alternative Distribution
- Verizon Applications for Android
- How to submit to the Verizon Apps store for Android
- Technical tips for Verizon Android development
- Related links
- Amazon Applications for Android
- Verizon Applications for Android
- Google Maps API Keys
- Specifying API-Level Compatibility
- Compatibility with Many Kinds of Screens
- Testing for Screen Size Compatibility
- Resource Qualifiers and Screen Sizes
- Application Signing
- 5. Eclipse for Android Software Development
- Eclipse Concepts and Terminology
- Plug-ins
- Workspaces
- Java Environments
- Eclipses Java Runtime Environment
- The Java compiler
- The application runtime
- Projects
- Builders and Artifacts
- Extensions
- Associations
- Eclipse Views and Perspectives
- The Package Explorer View
- The Task List View
- The Outline View
- The Problems View
- Java Coding in Eclipse
- Editing Java Code and Code Completion
- Refactoring
- Eclipse and Android
- Preventing Bugs and Keeping Your Code Clean
- Static Analyzers
- FindBugs
- Applying Static Analysis to Android Code
- Limitations of Static Analysis
- Static Analyzers
- Eclipse Idiosyncrasies and Alternatives
- Eclipse Concepts and Terminology
- 1. Installing the Android SDK and Prerequisites
- II. About the Android Framework
- 6. Building a View
- Android GUI Architecture
- The Model
- The View
- The Controller
- Putting It Together
- Assembling a Graphical Interface
- Wiring Up the Controller
- Listening to the Model
- Listening for Touch Events
- Multiple Pointers and Gestures
- Listening for Key Events
- Choosing an Event Handler
- Advanced Wiring: Focus and Threading
- The Menu and the Action Bar
- View Debugging and Optimization
- Android GUI Architecture
- 7. Fragments and Multiplatform Support
- Creating a Fragment
- Fragment Life Cycle
- The Fragment Manager
- Fragment Transactions
- The Support Package
- Fragments and Layout
- 8. Drawing 2D and 3D Graphics
- Rolling Your Own Widgets
- Layout
- Measurement
- Arrangement
- Canvas Drawing
- Drawing text
- Matrix transformations
- Drawables
- Bitmaps
- Layout
- Bling
- Shadows, Gradients, Filters, and Hardware Acceleration
- Animation
- Transition animation
- Background animation
- Surface view animation
- OpenGL Graphics
- Rolling Your Own Widgets
- 9. Handling and Persisting Data
- Relational Database Overview
- SQLite
- The SQL Language
- SQL Data Definition Commands
- SQLite types
- Database constraints
- SQL Data Manipulation Commands
- Additional Database Concepts
- Database Transactions
- Example Database Manipulation Using sqlite3
- SQL Data Definition Commands
- SQL and the Database-Centric Data Model for Android Applications
- The Android Database Classes
- Database Design for Android Applications
- Basic Structure of the SimpleVideoDbHelper Class
- Using the Database API: MJAndroid
- Android and Social Networking
- The Source Folder (src)
- Loading and Starting the Application
- Database Queries and Reading Data from the Database
- Using the query method
- Modifying the Database
- Inserting data into the database
- Using the insert method
- Using the execSQL method
- Updating data already in the database
- Using the update method
- Using the execSQL method
- Deleting data in the database
- Using the delete method
- Using the execSQL method
- Inserting data into the database
- 6. Building a View
- III. A Skeleton Application for Android
- 10. A Framework for a Well-Behaved Application
- Visualizing Life Cycles
- Visualizing the Activity Life Cycle
- Memory recovery and life cycles
- Life cycle methods of the Activity class
- Saving and restoring instance state
- Configuration changes and the activity life cycle
- Minor life cycle methods of the Activity class
- Visualizing the Activity Life Cycle
- Visualizing the Fragment Life Cycle
- The Activity Class and Well-Behaved Applications
- The Activity Life Cycle and the User Experience
- Life Cycle Methods of the Application Class
- Visualizing Life Cycles
- 11. Building a User Interface
- Top-Level Design
- Fragment, Activity, and Scalable Design
- Visual Editing of User Interfaces
- Starting with a Blank Slate
- Laying Out the Fragments
- Lay Out Fragments Using the Visual Editor
- Multiple Layouts
- Folding and Unfolding a Scalable UI
- Decisions about Screen Size and Resolution
- Delegating to Fragment Classes
- Making Activity, Fragment, Action Bar, and Multiple Layouts Work Together
- Action Bar
- Tabs and Fragments
- The Other Activity
- Top-Level Design
- 12. Using Content Providers
- Understanding Content Providers
- Implementing a Content Provider
- Browsing Video with Finch
- The simple video database
- Structure of the simple version of the code
- Defining a Provider Public API
- Defining the CONTENT_URI
- Creating the Column Names
- Declaring Column Specification Strings
- Writing and Integrating a Content Provider
- Common Content Provider Tasks
- Extending ContentProvider
- Common Content Provider Tasks
- File Management and Binary Data
- Android MVC and Content Observation
- A Complete Content Provider: The SimpleFinchVideoContentProvider Code
- The SimpleFinchVideoContentProvider Class and Instance Variables
- Implementing the onCreate Method
- Implementing the getType Method
- Implementing the Provider API
- The query method
- The insert method
- The update method
- The delete method
- Determining How Often to Notify Observers
- Declaring Your Content Provider
- Understanding Content Providers
- 13. A Content Provider as a Facade for a RESTful Web Service
- Developing RESTful Android Applications
- A Network MVC
- Summary of Benefits
- Code Example: Dynamically Listing and Caching YouTube Video Content
- Structure of the Source Code for the Finch YouTube Video Example
- Stepping Through the Search Application
- Step 1: Our UI Collects User Input
- Step 2: Our Controller Listens for Events
- Step 3: The Controller Queries the Content Provider with a managedQuery on the Content Provider/Model
- Step 4: Implementing the RESTful Request
- Constants and Initialization
- Creating the Database
- A Networked Query Method
- RESTfulContentProvider: A REST helper
- UriRequestTask
- YouTubeHandler
- RESTfulContentProvider: A REST helper
- insert and ResponseHandlers
- File Management: Storing Thumbnails
- 10. A Framework for a Well-Behaved Application
- IV. Advanced Topics
- 14. Search
- Search Interface
- Search Basics
- Search logic
- Index-based search logic
- Database-backed search logic
- Searchable configuration
- Searchable activity
- Search logic
- Search Dialog
- Search Widget
- Search Basics
- Query Suggestions
- Recent Query Suggestions
- Custom Query Suggestions
- Search Interface
- 15. Location and Mapping
- Location-Based Services
- Mapping
- The Google Maps Activity
- The MapView and MapActivity
- Working with MapViews
- MapView and MyLocationOverlay Initialization
- Pausing and Resuming a MapActivity
- Controlling the Map with Menu Buttons
- Controlling the Map with the Keypad
- Location Without Maps
- The Manifest and Layout Files
- Connecting to a Location Provider and Getting Location Updates
- Updating the Emulated Location
- Using geo to update location
- Using DDMS to update location
- StreetView
- 16. Multimedia
- Audio and Video
- Playing Audio and Video
- Audio Playback
- MediaPlayer audio playback
- AudioTrack audio playback
- Video Playback
- Audio Playback
- Recording Audio and Video
- Audio Recording
- MediaRecorder audio recording
- Intent audio recording
- AudioRecorder audio recording
- Video Recording
- MediaRecorder video recording
- Intent video recording
- Audio Recording
- Stored Media Content
- 17. Sensors, NFC, Speech, Gestures, and Accessibility
- Sensors
- Position
- Accelerometer
- Gyroscope
- Rotation vector
- Linear acceleration
- Gravity
- Other Sensors
- Position
- Near Field Communication (NFC)
- Reading a Tag
- Writing to a Tag
- P2P Mode and Beam
- API levels 1013
- Beam: API level 14+
- Gesture Input
- Accessibility
- Sensors
- 18. Communication, Identity, Sync, and Social Media
- Account Contacts
- Authentication and Synchronization
- Authentication
- Synchronization
- Bluetooth
- The Bluetooth Protocol Stack
- Bluetooth-specific protocols and adopted protocols
- BlueZ: The Linux Bluetooth Implementation
- Using Bluetooth in Android Applications
- Bluetooth and related I/O classes
- The DeviceListActivity class
- The BtConsoleActivity class
- The Bluetooth Protocol Stack
- 19. The Android Native Development Kit (NDK)
- Native Methods and JNI Calls
- Conventions in Native Method Calls
- Conventions on the Java Side
- The Android NDK
- Setting Up the NDK Environment
- Editing C/C++ Code in Eclipse
- Compiling with the NDK
- JNI, NDK, and SDK: A Sample App
- Native Libraries and Headers Provided by the NDK
- Building Your Own Custom Library Modules
- Native Activities
- Native Methods and JNI Calls
- 14. Search
- Index
- About the Authors
- Colophon
- Copyright