Home Page Icon
Home Page
Table of Contents for
Code Snippets
Close
Code Snippets
by Carmen Delessio, Lauren Darcey, Shane Conder
Sams Teach Yourself: Android Application Development in 24 Hours, Fourth Edition
About This eBook
Title Page
Copyright Page
Praise for Sams Teach Yourself Androidâ„¢ Application Development in 24 Hours, Fourth Edition
Contents at a Glance
Table of Contents
Preface
New in the Fourth Edition
Who This Book Is For
How This Book Is Organized
Source Code for the Book
About the Authors
Dedication
Acknowledgments
We Want to Hear from You
Reader Services
Part I: Android Fundamentals
Hour 1. Introducing Android
Defining Android
Operating System
Development Environment
Mobile Platform
Understanding Android Development
Getting the Big Picture
Beginning Android Studio
Installation
Creating a Project
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 2. Understanding Intents
Using Intents to Start an Activity
Creating the User Interface in Android Studio
Creating a Second Activity
Adding Code to Start an Activity
Running the App
Passing Data Between Activities
Explicit and Implicit Intents
Using Implicit Intents
Opening a Map to a Specific Location
Displaying a Web Page
More Actions
Handling an Implicit Intent
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 3. Understanding Resources
Resources in Your Project
Understanding Common Resources
Using Resources
Working with Simple Resources
Working with Drawable Resources
Using Style
Providing Alternative Resources
Internationalization: Using Alternative Languages Resources
Handling Locales with Android
Specifying Default Resources
Specifying Language-Specific Resources
Summary
Q&A
Workshop
Quiz
Answers
Exercises
Hour 4. Activities and Fragments
Working with Activities
A Quick Review
Using Layouts
Returning a Result: Using StartActivityForResult
Handling Configuration Changes
Understanding the Activity Lifecycle
Create, Start, Resume, Pause, Stop, and Destroy
Common Tasks in Callback Methods
Introducing Fragments
Creating an Activity and Fragment
Using a Layout for Fragment Display
Summary
Q&A
Workshop
Quiz
Answers
Exercises
Hour 5. Responsive Apps: Running in the Background
Working in the Background
The UI Thread
Using a Thread and View.post()
Using an AsyncTask
Service and IntentService
Using an IntentService
Defining an IntentService
Adding a BroadcastReceiver
Using Android Studio for IntentServices
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Part II: Creating the User Interface
Hour 6. Using Basic UI Controls
Using the Android Studio Palette
Handling User Input
Adding a TextView
Using EditText
Using Buttons for User Actions
Button Properties
Handling a Button Click
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 7. Using Layouts
Getting Started with Layouts
Designing Layouts Using the Android Studio
Editing Layouts Using XML
Using Layout Resources Programmatically
Becoming a RelativeLayout Expert
Aligning to Parent
Aligning Views Relative to Each Other
Common Attributes
Layout Margins
Padding
More Layout Types
Using LinearLayout
Summary
Q&A
Workshop
Quiz
Answers
Exercises
Hour 8. ListViews and Adapters
Getting Started with ListViews
Using ArrayAdapters
Extending Base Adapters
Creating a BaseAdapter
Adding a Complex Child View to a ListView
Introducing the View Holder Pattern
Summary
Q&A
Workshop
Quiz
Answers
Exercises
Hour 9. Material Design
The Evolution of App Design
Skeuomorphism
Flat Design
Introducing Material Design
3D Space and Shadows
Graphics
Typography
Animation
Cards
Implementing Material Design
Setting Theme and Elevation
CardView and RecyclerView
Floating Action Button (FAB)
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 10. More Views and Controls
Controls for Collecting Information
Using a Spinner Control
Using an AutoCompleteTextView
CheckBoxes and RadioButtons
Indicating Progress
Displaying Data
Using a GridView
Using an AdapterViewFlipper
Page Flipping and Horizontal Scrolling
More Views
WebView
When to Use a ScrollView
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 11. ImageViews and Bitmaps
Examining ImageView
Displaying an Image
Using ScaleTypes in ImageView
Rotating an Image
Setting Alpha
Using Bitmaps and Canvas
Handling Large Images
Using BitmapFactory.Options
Drawing Directly on a Canvas
Introducing Picasso
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 12. Using VideoViews and Media
Playing Video
Using an Intent
Using a VideoView
Adding a MediaController to a VideoView
Starting, Pausing, and Positioning a Video
Handling VideoView Events
Listening for the States of a VideoView
Playing Audio with MediaPlayer
More Media
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 13. Adding Navigation
Using the ActionBar
Displaying the Options Menu
Responding to the Options Menu
Adding Up Navigation
Introducing the Toolbar
A Basic Toolbar
Adding a Child View to a Toolbar
Sliding Drawer Navigation
The Importance of Layouts
Setting Up the Sliding Drawer
Populating ListView and Handling Selection
Odds and Ends for the Sliding Drawer
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Part III: Working with Data
Hour 14. Using the File System
File System Overview
Understanding Internal and External Storage
Understanding Public and Private Storage
Understanding Cached Storage
Saving Data Privately in Your App
Saving Data in Public Folders
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 15. Using SharedPreferences
Using SharedPreferences to Store Data
Setting Preferences
Reading from SharedPreferences
Data Types and Methods in SharedPreferences
Setting User Preferences
Creating a PreferencesFragment
Generating a PreferenceActivity
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 16. Using SQLite and File Storage
Organizing a Database with Tables
Managing Data with SQLiteOpenHelper
Adding, Deleting, and Updating Data
Querying Data and Using Cursors
Defining a Query
Getting an Object from a Cursor
Using a Database in the App
Using PieDbAdapter
Using a SimpleCursorAdapter to Display Data
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 17. Accessing the Cloud: Working with a Remote API
Fetching Remote Data
Making an API Call
Retrieving Data with HttpUrlConnection
The Structure of This App
Using and Parsing JSON-Formatted Data
Creating a JSONObject
Using a JSONArray
Parsing JSON
Putting the Pieces Together
Downloading in the Background with AsyncTask
Displaying the List in a Fragment
Checking Connectivity
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 18. Introducing Content Providers
Introducing Content Providers
All About the Calendar
Calendar Data on Android
Calendar Data via the Calendar Content Provider
Listing Calendar Events
Drilling Further into Calendar Data
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 19. Creating a Content Provider
Specifying a URI for Data Retrieval
Using PieDbAdapter
Building a Content Provider
Methods Required in a Content Provider
Declaring the Content Provider
Updating the Android Manifest
Content Provider Query Method
Implementing the GetType() Method
Implementing Insert, Update, and Delete Methods
Using MyContentProvider in the App
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 20. Loaders and CursorAdapters
How Loaders Work
Loader Classes
Understanding Loader States
Initializing a Loader
Creating a Loader
Taking Action When Data Is Available
Resetting a Loader
Using a CursorLoader with a CursorAdapter
Creating Cursor Adapters
Implementing newView()
Implementing BindView
The Rest of the App
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Part IV: Next Steps
Hour 21. Using Notifications
Introducing Notifications
Components of a Notification
Classes Used for a Notification
Creating and Managing Notifications
Building a Basic Notification
Adding a Destination
Updating a Notification
More Notification Options
Customizing Notifications
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 22. Android TV and Wear Apps
Android as a Platform
Developing Android Wear Apps
Designing for Android Wear Differences
Setting Up for Wear Development
Testing a Wear App
Adding a Notification
Developing Android TV Apps
Designing for Android TV Differences
Android TV Development
Testing an Android TV App
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 23. More Features to Explore
Using Google Play Services
Setting Up Google Play Services
Checking for Google Play Services
Using Google Play Services for Location
Determining Location
Implementing Location Tracking
Using Open Source and External SDKs
Picasso
Realm
Fabric and Crashlytics
Digging Deeper into Android
Using Sensors
Handling User Gestures
Customizing Styles and Themes
Designing Custom View and ViewGroup Controls
Camera
Using the OpenGL ES Graphics API
Bluetooth
NFC and Beam
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Hour 24. Publishing Your Apps
Preparing for Release
Preparing the Android Manifest File for Release
Signing Your Apps
Sharing Your App with the World
Publishing on Google Play
Publishing on Amazon
Monetizing Your App
Free Apps
Ad Supported
Paid
In-App Payments
Summary
Q&A
Workshop
Quiz
Answers
Exercise
Index
Code Snippets
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Sams TeachYourself Androidâ„¢ Application Development in 24 Hours, Fourth Edition
Next
Next Chapter
Images
Code Snippets
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset