Android Programming

Lýsing:
Android Programming: The Big Nerd Ranch Guide is an introductory Android book for programmers with Kotlin experience. Based on Big Nerd Ranch's popular Android Bootcamp, this guide will lead you through the wilderness using hands-on example apps combined with clear explanations of key concepts and APIs. This book focuses on practical techniques for developing apps in Kotlin compatible with Android 7.
0 (Nougat) through Android 12 and beyond. Write and run code every step of the way, using Android Studio to create apps that integrate with other apps, download and display pictures from the web, store data in databases, and more. Learn about the latest patterns and techniques, including Kotlin coroutines and Jetpack Compose, a new way to build Android UIs. Each chapter and app has been designed and tested to provide the knowledge and experience you need to get started in Android development.
Annað
- Höfundar: Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
- Útgáfa:5
- Útgáfudagur: 2022-05-12
- Hægt að prenta út 2 bls.
- Hægt að afrita 2 bls.
- Format:ePub
- ISBN 13: 9780137645732
- Print ISBN: 9780137645541
- ISBN 10: 0137645732
Efnisyfirlit
- Title Page
- Dedication
- Acknowledgments
- Table of Contents
- Learning Android
- Prerequisites
- What’s New in the Fifth Edition?
- Kotlin vs Java
- How to Use This Book
- How This Book Is Organized
- Challenges
- Are you more curious?
- Typographical Conventions
- Using an eBook
- Android Versions
- The Necessary Tools
- Downloading and Installing Android Studio
- Downloading Earlier SDK Versions
- A Hardware Device
- 1. Your First Android Application
- App Basics
- Creating an Android Project
- Navigating in Android Studio
- Laying Out the UI
- The view hierarchy
- View attributes
- android:layout_width and android:layout_height
- android:orientation
- android:text
- Creating string resources
- Previewing the layout
- From Layout XML to View Objects
- Resources and resource IDs
- Wiring Up Views
- Getting references to views
- Setting listeners
- Making Toasts
- Running on the Emulator
- For the More Curious: The Android Build Process
- Android build tools
- Challenges
- Challenge: Switching Your Toast for a Snackbar
- 2. Interactive User Interfaces
- Creating a New Class
- Updating the Layout
- Wiring Up the User Interface
- Adding an Icon
- Referencing resources in XML
- Screen Pixel Densities
- Running on a Device
- Challenge: Add a Listener to the TextView
- Challenge: Add a Previous Button
- 3. The Activity Lifecycle
- Rotating GeoQuiz
- Activity States and Lifecycle Callbacks
- Logging the Activity Lifecycle
- Making log messages
- Using Logcat
- Exploring How the Activity Lifecycle Responds to User Actions
- Temporarily leaving an activity
- Finishing an activity
- Rotating an activity
- Device Configuration Changes and the Activity Lifecycle
- For the More Curious: Creating a Landscape Layout
- For the More Curious: UI Updates and Multi-Window Mode
- For the More Curious: Log Levels
- Challenge: Preventing Repeat Answers
- Challenge: Graded Quiz
- 4. Persisting UI State
- Including the ViewModel Dependency
- Adding a ViewModel
- ViewModel lifecycle
- Add data to your ViewModel
- Saving Data Across Process Death
- For the More Curious: Jetpack, AndroidX, and Architecture Components
- For the More Curious: Avoiding a Half-Baked Solution
- For the More Curious: Activity and Instance State
- 5. Debugging Android Apps
- Exceptions and Stack Traces
- Diagnosing misbehaviors
- Logging stack traces
- Setting breakpoints
- Android-Specific Debugging
- Using Android Lint
- Build issues
- Challenge: Using Conditional Breakpoints
- Challenge: Exploring the Layout Inspector
- Challenge: Exploring the Profiler
- Exceptions and Stack Traces
- 6. Testing
- Two Types of Tests
- JVM Tests
- Instrumented Tests with Espresso and ActivityScenario
- Challenge: Asserting Yourself
- 7. Your Second Activity
- Setting Up a Second Activity
- Creating a new activity
- A new activity subclass
- Declaring activities in the manifest
- Adding a cheat button to MainActivity
- Starting an Activity
- Communicating with intents
- Explicit and implicit intents
- Communicating with intents
- Setting Up a Second Activity
- Passing Data Between Activities
- Using intent extras
- Getting a result back from a child activity
- Setting a result
- Sending back an intent
- Handling a result
- Android SDK Versions
- A sane minimum
- Minimum SDK version
- Target SDK version
- Compile SDK version
- Compatibility and Android Programming
- Jetpack libraries
- Safely adding code from later APIs
- Using the Android Developer Documentation
- Challenge: Reporting the Device’s Android Version
- Challenge: Limited Cheats
- The Need for UI Flexibility
- Introducing Fragments
- Starting CriminalIntent
- Creating a new project
- Creating a Data Class
- Creating a Fragment
- Defining CrimeDetailFragment’s layout
- Creating the CrimeDetailFragment class
- Different types of fragments
- Implementing fragment lifecycle functions
- Wiring up views in a fragment
- Defining a FragmentContainerView
- The FragmentManager
- The fragment lifecycle
- Fragments and memory management
- Adding a New Fragment and ViewModel
- ViewModel lifecycle with fragments
- Adding a RecyclerView
- Implementing a LayoutManager
- Creating an Item View Layout
- Implementing a ViewHolder
- Implementing an Adapter to Populate the RecyclerView
- Setting the RecyclerView’s adapter
- Recycling Views
- Cleaning Up Binding List Items
- Responding to Presses
- Lists and Grids: Past, Present, and Future
- For the More Curious: A Smarter Adapter with ListAdapter
- Challenge: RecyclerView View Types
- Introducing ConstraintLayout
- Introducing the Layout Editor
- Using ConstraintLayout
- Making room
- Adding views
- ConstraintLayout’s inner workings
- Editing properties
- Making list items dynamic
- Styles, Themes, and Theme Attributes
- For the More Curious: Margins vs Padding
- For the More Curious: Advanced Features in ConstraintLayout
- Challenge: Formatting the Date
- An Introduction to Asynchronous Code on Android
- Using coroutines
- Consuming data from coroutines
- Creating a Database
- Room architecture component library
- Defining entities
- Creating a database class
- Creating a type converter
- Defining a Data Access Object
- Accessing the Database Using the Repository Pattern
- Importing Prepopulated Data
- Querying the Database
- Keeping the Changes Flowing
- Challenge: Addressing the Schema Warning
- For the More Curious: Singletons
- Performing Navigation
- Implementing the Navigation component library
- Navigating to the detail screen
- Passing data to a fragment
- Unidirectional Data Flow
- Updating the Database
- For the More Curious: A Better List Preview
- Challenge: No Untitled Crimes
- Creating a DialogFragment
- Showing a DialogFragment
- Passing Data Between Two Fragments
- Passing data to DatePickerFragment
- Returning data to CrimeDetailFragment
- Setting a fragment result
- The Default App Bar
- Menus
- Defining a menu in XML
- The app namespace
- Creating the menu
- Responding to menu selections
- Defining a menu in XML
- For the More Curious: App Bar vs Action Bar vs Toolbar
- For the More Curious: Accessing the AppCompat App Bar
- Challenge: An Empty View for the RecyclerView
- Challenge: Deleting Crimes
- Adding Buttons
- Adding a Suspect Property
- Using a Format String
- Using Implicit Intents
- Parts of an implicit intent
- Sending a crime report
- Asking Android for a contact
- Getting data from the contacts list
- Contacts permissions
- Checking for responding activities
- Disclosing queries
- Querying the PackageManager
- A Place for Your Photo
- File Storage
- Using FileProvider
- Designating a picture location
- Using a Camera Intent
- Scaling and Displaying Bitmaps
- Declaring Features
- Challenge: Detail Display
- Localizing Resources
- Default resources
- Checking string coverage using the Translations Editor
- Targeting a region
- Configuration Qualifiers
- Prioritizing alternative resources
- Multiple qualifiers
- Finding the best-matching resources
- Testing Alternative Resources
- For the More Curious: More on Determining Device Size
- Challenge: Localizing Dates
- TalkBack
- Explore by Touch
- Linear navigation by swiping
- Making Non-Text Elements Readable by TalkBack
- Adding content descriptions
- Making a view focusable
- Creating a Comparable Experience
- For the More Curious: Using TalkBack with an Emulator
- For the More Curious: Using Accessibility Scanner
- Challenge: Improving the List
- Challenge: Providing Enough Context for Data Entry
- Challenge: Announcing Events
- Creating PhotoGallery
- Networking Basics with Retrofit
- Defining an API interface
- Building the Retrofit object and creating an API instance
- Adding a String converter
- Executing a web request
- Asking permission to network
- Moving toward the repository pattern
- Fetching JSON from Flickr
- Deserializing JSON text into model objects
- Handling errors
- Networking Across Configuration Changes
- Displaying Results in RecyclerView
- Displaying images
- For the More Curious: Managing Dependencies
- Challenge: Paging
- Searching Flickr
- Using SearchView
- Responding to SearchView user interactions
- Simple Persistence with DataStore
- Defining UI State
- Challenge: Polishing Your App Some More
- Creating a Worker
- Scheduling Work
- Checking for New Photos
- Notifying the User
- Providing User Control over Polling
- One Last Bit of Flickr Data
- The Easy Way: Implicit Intents
- The Harder Way: WebView
- WebChromeClient
- WebView vs a Custom UI
- For the More Curious: WebView Updates
- For the More Curious: Chrome Custom Tabs (Another Easy Way)
- Challenge: Using the Back Button for Browser History
- Setting Up the DragAndDraw Project
- Creating a Custom View
- Creating BoxDrawingView
- Handling Touch Events
- Tracking across motion events
- Rendering Inside onDraw(Canvas)
- For the More Curious: Detecting Gestures
- Challenge: Saving State
- Challenge: Rotating Boxes
- Challenge: Accessibility Support
- Building the Scene
- Simple Property Animation
- View transformation properties
- Using different interpolators
- Color evaluation
- Playing Animators Together
- For the More Curious: Other Animation APIs
- Legacy animation tools
- Transitions
- Challenges
- Creating a Compose Project
- Composing Your First UI
- Layouts in Compose
- Composable Functions
- Previewing Composables
- Customizing Composables
- Declaring inputs on a composable function
- Resources in Compose
- Control flow in a composable
- Aligning elements in a row
- Specifying text styles
- Declaring inputs on a composable function
- The Compose Modifier
- The padding modifier
- Chaining modifiers and modifier ordering
- The clickable modifier
- Sizing composables
- Specifying a modifier parameter
- Building Screens with Composables
- Scrollable Lists with LazyColumn
- For the More Curious: Live Literals
- Philosophies of State
- Defining Your UI State
- Updating UIs with MutableState
- Recomposition
- remember
- State Hoisting
- State and Configuration Changes
- Parcelable and Parcelize
- For the More Curious: Coroutines, Flow, and Compose
- For the More Curious: Scrolling State
- For the More Curious: Inspecting Compose Layouts
- Your First Dialog in Compose
- Dismissing the Dialog
- Setting the Dialog’s Content
- Sending Results from a Dialog
- Challenge: Pizza Sizes and Drop-Down Menus
- Images
- Image’s contentDescription
- Adding more images
- Customizing the Image composable
- aspectRatio
- contentScale
- Image alignment
- The align modifier
- Adding a header to LazyColumn
- MaterialTheme
- Scaffold and TopAppBar
- CompositionLocal
- Removing AppCompat
- For the More Curious: Accompanist
- For the More Curious: Creating Your Own CompositionLocals
- Challenge: Animations
- The Final Challenge
- Shameless Plugs
- Thank You
UM RAFBÆKUR Á HEIMKAUP.IS
Bókahillan þín er þitt svæði og þar eru bækurnar þínar geymdar. Þú kemst í bókahilluna þína hvar og hvenær sem er í tölvu eða snjalltæki. Einfalt og þægilegt!Rafbók til eignar
Rafbók til eignar þarf að hlaða niður á þau tæki sem þú vilt nota innan eins árs frá því bókin er keypt.
Þú kemst í bækurnar hvar sem er
Þú getur nálgast allar raf(skóla)bækurnar þínar á einu augabragði, hvar og hvenær sem er í bókahillunni þinni. Engin taska, enginn kyndill og ekkert vesen (hvað þá yfirvigt).
Auðvelt að fletta og leita
Þú getur flakkað milli síðna og kafla eins og þér hentar best og farið beint í ákveðna kafla úr efnisyfirlitinu. Í leitinni finnur þú orð, kafla eða síður í einum smelli.
Glósur og yfirstrikanir
Þú getur auðkennt textabrot með mismunandi litum og skrifað glósur að vild í rafbókina. Þú getur jafnvel séð glósur og yfirstrikanir hjá bekkjarsystkinum og kennara ef þeir leyfa það. Allt á einum stað.
Hvað viltu sjá? / Þú ræður hvernig síðan lítur út
Þú lagar síðuna að þínum þörfum. Stækkaðu eða minnkaðu myndir og texta með multi-level zoom til að sjá síðuna eins og þér hentar best í þínu námi.
Fleiri góðir kostir
- Þú getur prentað síður úr bókinni (innan þeirra marka sem útgefandinn setur)
- Möguleiki á tengingu við annað stafrænt og gagnvirkt efni, svo sem myndbönd eða spurningar úr efninu
- Auðvelt að afrita og líma efni/texta fyrir t.d. heimaverkefni eða ritgerðir
- Styður tækni sem hjálpar nemendum með sjón- eða heyrnarskerðingu
- Gerð : 208
- Höfundur : 10093
- Útgáfuár : 2019
- Leyfi : 380