00 Days 00 hours 00 minutes 00 seconds

Your last chance! Enjoy 30% off with promo code 'Lituz'!

Android Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides) by Bill Phillips, Chris Stewart, Kristin Marsicano, Brian Gardner

139990 UZS

-Do'stlaringizga tafsiya etish!

Description

Summary:

«Android Programming: The Big Nerd Ranch Guide» is a comprehensive guide to mastering Android development. With hands-on examples, practical advice, and a deep dive into Android’s features, this book is tailored for both beginners and seasoned developers looking to enhance their Android expertise.

What You’ll Learn:

This guide takes you through the foundational elements of Android development, teaching you to craft intuitive and efficient apps. From understanding Android’s architecture and design patterns to mastering UI elements, data persistence, and integrating with web services, you’ll gain expertise in every facet of the platform.

Why You Should Read It:

The Big Nerd Ranch Guide is revered for its practical approach to teaching, and this Android Programming edition is no exception. With real-world examples and a structured learning path, this book will guide you from being an Android novice to an adept programmer, ready to tackle sophisticated projects.

Quote From The Book:

«Programming is, at its heart, a creative endeavor. It’s about making something. And what we are making is a product that is intended for people to use.»

Additional information

Number of pages:

640

Mundarija

Table of Contents
Learning Android ……………………………………………………………………………………………. xvii
Prerequisites …………………………………………………………………………………………… xvii
What's New in the Second Edition? ……………………………………………………………….. xvii
How to Use This Book ……………………………………………………………………………… xviii
How This Book is Organized ………………………………………………………………………. xviii
Challenges ……………………………………………………………………………………….. xix
Are you more curious? ………………………………………………………………………… xix
Code Style ………………………………………………………………………………………………. xix
Typographical Conventions ……………………………………………………………………………. xx
Android Versions ……………………………………………………………………………………….. xx
The Necessary Tools …………………………………………………………………………………………. xxi
Downloading and Installing Android Studio ………………………………………………………. xxi
Downloading Earlier SDK Versions ………………………………………………………………… xxi
An Alternative Emulator …………………………………………………………………………….. xxii
A Hardware Device …………………………………………………………………………………… xxii
1. Your First Android Application ……………………………………………………………………………. 1
App Basics ………………………………………………………………………………………………… 2
Creating an Android Project ……………………………………………………………………………. 2
Navigating in Android Studio ………………………………………………………………………….. 8
Laying Out the User Interface …………………………………………………………………………. 9
The view hierarchy ……………………………………………………………………………… 13
Widget attributes ………………………………………………………………………………… 14
Creating string resources ……………………………………………………………………….. 15
Previewing the layout …………………………………………………………………………… 15
From Layout XML to View Objects ………………………………………………………………… 16
Resources and resource IDs ……………………………………………………………………. 18
Wiring Up Widgets …………………………………………………………………………………….. 20
Getting references to widgets ………………………………………………………………….. 21
Setting listeners ………………………………………………………………………………….. 22
Making Toasts …………………………………………………………………………………………… 23
Using code completion …………………………………………………………………………. 25
Running on the Emulator ……………………………………………………………………………… 26
For the More Curious: Android Build Process …………………………………………………….. 29
Android build tools ……………………………………………………………………………… 31
2. Android and Model-View-Controller ……………………………………………………………………. 33
Creating a New Class ………………………………………………………………………………….. 34
Generating getters and setters …………………………………………………………………. 34
Model-View-Controller and Android ………………………………………………………………… 37
Benefits of MVC ………………………………………………………………………………… 38
Updating the View Layer ……………………………………………………………………………… 39
Updating the Controller Layer ……………………………………………………………………….. 41
Running on a Device ………………………………………………………………………………….. 46
Connecting your device ………………………………………………………………………… 46
Configuring your device for development …………………………………………………… 47
Adding an Icon …………………………………………………………………………………………. 48
Adding resources to a project …………………………………………………………………. 49
Referencing resources in XML ……………………………………………………………….. 52
Challenges ……………………………………………………………………………………………….. 53
Challenge: Add a Listener to the TextView ………………………………………………………… 53
Challenge: Add a Previous Button …………………………………………………………………… 54
Challenge: From Button to ImageButton ……………………………………………………………. 55
3. The Activity Lifecycle …………………………………………………………………………………….. 57
Logging the Activity Lifecycle ………………………………………………………………………. 58
Making log messages …………………………………………………………………………… 58
Using LogCat ……………………………………………………………………………………. 60
Rotation and the Activity Lifecycle …………………………………………………………………. 63
Device configurations and alternative resources …………………………………………….. 64
Saving Data Across Rotation …………………………………………………………………………. 68
Overriding onSaveInstanceState(Bundle) …………………………………………………….. 69
The Activity Lifecycle, Revisited ……………………………………………………………………. 70
For the More Curious: Testing onSaveInstanceState(Bundle) ……………………………………. 72
For the More Curious: Logging Levels and Methods ……………………………………………… 73
4. Debugging Android Apps …………………………………………………………………………………. 75
Exceptions and Stack Traces …………………………………………………………………………. 76
Diagnosing misbehaviors ………………………………………………………………………. 77
Logging stack traces ……………………………………………………………………………. 78
Setting breakpoints ……………………………………………………………………………… 79
Using exception breakpoints …………………………………………………………………… 82
Android-Specific Debugging ………………………………………………………………………….. 84
Using Android Lint ……………………………………………………………………………… 84
Issues with the R class …………………………………………………………………………. 85
5. Your Second Activity ……………………………………………………………………………………… 87
Setting Up a Second Activity ………………………………………………………………………… 88
Creating a new activity …………………………………………………………………………. 89
A new activity subclass ………………………………………………………………………… 92
Declaring activities in the manifest …………………………………………………………… 92
Adding a Cheat! button to QuizActivity ……………………………………………………… 93
Starting an Activity …………………………………………………………………………………….. 95
Communicating with intents …………………………………………………………………… 96
Passing Data Between Activities …………………………………………………………………….. 97
Using intent extras ………………………………………………………………………………. 98
Getting a result back from a child activity …………………………………………………. 101
How Android Sees Your Activities …………………………………………………………………. 106
Challenge ………………………………………………………………………………………………. 109
6. Android SDK Versions and Compatibility …………………………………………………………….. 111
Android SDK Versions ………………………………………………………………………………. 111
Compatibility and Android Programming …………………………………………………………. 112
A sane minimum ………………………………………………………………………………. 112
Minimum SDK version ……………………………………………………………………….. 114
Target SDK version ……………………………………………………………………………. 114
Compile SDK version …………………………………………………………………………. 114
Adding code from later APIs safely ………………………………………………………… 114
Using the Android Developer Documentation ……………………………………………………. 117
Challenge: Reporting the Build Version …………………………………………………………… 119
7. UI Fragments and the Fragment Manager …………………………………………………………….. 121
The Need for UI Flexibility …………………………………………………………………………. 122
Introducing Fragments ……………………………………………………………………………….. 123
Starting CriminalIntent ……………………………………………………………………………….. 124
Creating a new project ………………………………………………………………………… 126
Fragments and the support library …………………………………………………………… 128
Adding dependencies in Android Studio …………………………………………………… 129
Creating the Crime class ……………………………………………………………………… 132
Hosting a UI Fragment ………………………………………………………………………………. 133
The fragment lifecycle ………………………………………………………………………… 133
Two approaches to hosting …………………………………………………………………… 134
Defining a container view ……………………………………………………………………. 135
Creating a UI Fragment ……………………………………………………………………………… 136
Defining CrimeFragment’s layout …………………………………………………………… 136
Creating the CrimeFragment class …………………………………………………………… 138
Adding a UI Fragment to the FragmentManager …………………………………………………. 142
Fragment transactions …………………………………………………………………………. 143
The FragmentManager and the fragment lifecycle ………………………………………… 145
Application Architecture with Fragments …………………………………………………………. 146
The reason all our activities will use fragments …………………………………………… 147
For the More Curious: Why Support Fragments are Superior ………………………………….. 148
For the More Curious: Using Built-In Fragments ………………………………………………… 148
8. Creating User Interfaces with Layouts and Widgets …………………………………………………. 149
Upgrading Crime ……………………………………………………………………………………… 149
Updating the Layout ………………………………………………………………………………….. 150
Wiring Widgets ……………………………………………………………………………………….. 153
More on XML Layout Attributes …………………………………………………………………… 154
Styles, themes, and theme attributes ………………………………………………………… 154
Screen pixel densities and dp and sp ……………………………………………………….. 155
Android’s design guidelines ………………………………………………………………….. 156
Layout parameters ……………………………………………………………………………… 157
Margins vs. padding …………………………………………………………………………… 157
Using the Graphical Layout Tool …………………………………………………………………… 158
Creating a landscape layout ………………………………………………………………….. 160
Adding a new widget …………………………………………………………………………. 161
Editing attributes in properties view ………………………………………………………… 161
Reorganizing widgets in the component tree ………………………………………………. 162
Updating child layout parameters ……………………………………………………………. 163
How android:layout_weight works ………………………………………………………….. 164
The graphical layout tool and you …………………………………………………………… 165
Widget IDs and multiple layouts ……………………………………………………………. 166
Challenge: Formatting the Date …………………………………………………………………….. 166
9. Displaying Lists with RecyclerView …………………………………………………………………… 167
Updating CriminalIntent’s Model Layer …………………………………………………………… 168
Singletons and centralized data storage …………………………………………………….. 168
An Abstract Activity for Hosting a Fragment …………………………………………………….. 171
A generic fragment-hosting layout ………………………………………………………….. 171
An abstract Activity class …………………………………………………………………….. 172
RecyclerView, Adapter, and ViewHolder ………………………………………………………….. 176
ViewHolders and Adapters …………………………………………………………………… 177
Using a RecyclerView ………………………………………………………………………… 180
Implementing an Adapter and ViewHolder ………………………………………………… 182
Customizing List Items ………………………………………………………………………………. 185
Creating the list item layout ………………………………………………………………….. 185
Using a custom item view ……………………………………………………………………. 188
Responding to Presses ……………………………………………………………………………….. 190
For the More Curious: ListView and GridView ………………………………………………….. 191
For the More Curious: Singletons ………………………………………………………………….. 192
10. Using Fragment Arguments ……………………………………………………………………………. 193
Starting an Activity from a Fragment ……………………………………………………………… 193
Putting an extra ………………………………………………………………………………… 194
Retrieving an extra …………………………………………………………………………….. 195
Updating CrimeFragment’s view with Crime data ………………………………………… 196
The downside to direct retrieval ……………………………………………………………… 197
Fragment Arguments …………………………………………………………………………………. 197
Attaching arguments to a fragment ………………………………………………………….. 198
Retrieving arguments ………………………………………………………………………….. 199
Reloading the List …………………………………………………………………………………….. 200
Getting Results with Fragments …………………………………………………………………….. 202
Challenge: Efficient RecyclerView Reloading ……………………………………………………. 203
For the More Curious: Why Use Fragment Arguments? ………………………………………… 204
11. Using ViewPager ………………………………………………………………………………………… 205
Creating CrimePagerActivity ………………………………………………………………………… 206
ViewPager and PagerAdapter ………………………………………………………………… 207
Integrating CrimePagerActivity ………………………………………………………………. 208
FragmentStatePagerAdapter vs. FragmentPagerAdapter ………………………………………… 211
For the More Curious: How ViewPager Really Works ………………………………………….. 212
For the More Curious: Laying Out Views in Code ………………………………………………. 213
12. Dialogs ……………………………………………………………………………………………………. 215
The AppCompat Library …………………………………………………………………………….. 216
Creating a DialogFragment ………………………………………………………………………….. 217
Showing a DialogFragment …………………………………………………………………… 220
Setting a dialog’s contents ……………………………………………………………………. 221
Passing Data Between Two Fragments …………………………………………………………….. 224
Passing data to DatePickerFragment ………………………………………………………… 225
Returning data to CrimeFragment …………………………………………………………… 226
Challenge: More Dialogs …………………………………………………………………………….. 233
Challenge: A Responsive DialogFragment ………………………………………………………… 233
13. The Toolbar ………………………………………………………………………………………………. 235
AppCompat …………………………………………………………………………………………….. 235
Using the AppCompat library ……………………………………………………………….. 236
Menus …………………………………………………………………………………………………… 238
Defining a menu in XML …………………………………………………………………….. 239
Creating the menu ……………………………………………………………………………… 244
Responding to menu selections ………………………………………………………………. 246
Enabling Hierarchical Navigation ………………………………………………………………….. 248
How hierarchical navigation works …………………………………………………………. 249
An Alternative Action Item …………………………………………………………………………. 249
Toggling the action item title ………………………………………………………………… 251
“Just one more thing…” ……………………………………………………………………….. 252
For the More Curious: Toolbar vs Action Bar ……………………………………………………. 254
Challenge: Deleting Crimes …………………………………………………………………………. 255
Challenge: Plural String Resources ………………………………………………………………… 255
Challenge: An Empty View for the RecyclerView ……………………………………………….. 255
14. SQLite Databases ……………………………………………………………………………………….. 257
Defining a Schema ……………………………………………………………………………………. 257
Building Your Initial Database ……………………………………………………………………… 258
Debugging database issues …………………………………………………………………… 261
Gutting CrimeLab …………………………………………………………………………………….. 262
Writing to the Database ……………………………………………………………………………… 263
Using ContentValues ………………………………………………………………………….. 263
Inserting and updating rows ………………………………………………………………….. 264
Reading from the Database ………………………………………………………………………….. 266
Using a CursorWrapper ………………………………………………………………………. 267
Converting to model objects …………………………………………………………………. 269
For the More Curious: More Databases …………………………………………………………… 271
For the More Curious: The Application Context …………………………………………………. 272
Challenge: Deleting Crimes …………………………………………………………………………. 272
15. Implicit Intents …………………………………………………………………………………………… 273
Adding Buttons ……………………………………………………………………………………….. 274
Adding a Suspect to the Model Layer …………………………………………………………….. 276
Using a Format String ……………………………………………………………………………….. 278
Using Implicit Intents ………………………………………………………………………………… 279
Parts of an implicit intent …………………………………………………………………….. 280
Sending a crime report ………………………………………………………………………… 281
Asking Android for a contact ………………………………………………………………… 283
Checking for responding activities ………………………………………………………….. 287
Challenge: ShareCompat …………………………………………………………………………….. 289
Challenge: Another Implicit Intent …………………………………………………………………. 289
16. Taking Pictures with Intents …………………………………………………………………………… 291
A Place for Your Photo ………………………………………………………………………………. 291
Including layout files ………………………………………………………………………….. 292
External Storage ………………………………………………………………………………………. 294
Designating a picture location ……………………………………………………………….. 296
Using a Camera Intent ……………………………………………………………………………….. 297
External storage permission ………………………………………………………………….. 298
Firing the intent ………………………………………………………………………………… 299
Scaling and Displaying Bitmaps ……………………………………………………………………. 301
Declaring Features ……………………………………………………………………………………. 304
For the More Curious: Using Includes …………………………………………………………….. 304
Challenge: Detail Display ……………………………………………………………………………. 305
Challenge: Efficient Thumbnail Load ……………………………………………………………… 305
17. Two-Pane Master-Detail Interfaces ……………………………………………………………………. 307
Adding Layout Flexibility …………………………………………………………………………… 308
Modifying SingleFragmentActivity …………………………………………………………. 309
Creating a layout with two fragment containers …………………………………………… 309
Using an alias resource ……………………………………………………………………….. 311
Creating tablet alternatives ……………………………………………………………………. 312
Activity: Fragment Boss ……………………………………………………………………………… 314
Fragment callback interfaces …………………………………………………………………. 314
For the More Curious: More on Determining Device Size ……………………………………… 323
18. Assets ……………………………………………………………………………………………………… 325
Why Assets, Not Resources …………………………………………………………………………. 326
Creating BeatBox ……………………………………………………………………………………… 326
Importing Assets ………………………………………………………………………………………. 329
Getting at Assets ……………………………………………………………………………………… 331
Wiring Up Assets for Use …………………………………………………………………………… 333
Accessing Assets ……………………………………………………………………………………… 336
For the More Curious: Non-Assets? ……………………………………………………………….. 337
19. Audio Playback with SoundPool ……………………………………………………………………… 339
Creating a SoundPool ………………………………………………………………………………… 339
Loading Sounds ……………………………………………………………………………………….. 340
Playing Sounds ………………………………………………………………………………………… 341
Unloading Sounds …………………………………………………………………………………….. 343
Rotation and Object Continuity …………………………………………………………………….. 344
Retaining a fragment ………………………………………………………………………….. 345
Rotation and retained fragments …………………………………………………………….. 346
For the More Curious: Whether to Retain ………………………………………………………… 348
For the More Curious: More on Rotation Handling ……………………………………………… 349
20. Styles and Themes ………………………………………………………………………………………. 353
Color Resources ………………………………………………………………………………………. 353
Styles ……………………………………………………………………………………………………. 354
Style inheritance ……………………………………………………………………………….. 355
Themes …………………………………………………………………………………………………. 357
Modifying the theme ………………………………………………………………………….. 357
Adding Theme Colors ……………………………………………………………………………….. 359
Overriding Theme Attributes ………………………………………………………………………… 360
Theme spelunking ……………………………………………………………………………… 361
Modifying Button Attributes ………………………………………………………………………… 365
For the More Curious: More on Style Inheritance ……………………………………………….. 367
For the More Curious: Accessing Theme Attributes …………………………………………….. 368
Challenge: An Appropriate Base Theme ………………………………………………………….. 368
21. XML Drawables …………………………………………………………………………………………. 369
Making Uniform Buttons ……………………………………………………………………………. 369
Shape Drawables ……………………………………………………………………………………… 371
State List Drawables ………………………………………………………………………………….. 372
Layer List Drawables ………………………………………………………………………………… 374
For the More Curious: Why Bother with XML Drawables? ……………………………………. 376
For the More Curious: 9-Patch Images ……………………………………………………………. 376
For the More Curious: Mipmap Images …………………………………………………………… 381
22. More About Intents and Tasks ………………………………………………………………………… 383
Setting Up NerdLauncher ……………………………………………………………………………. 384
Resolving an Implicit Intent …………………………………………………………………………. 386
Creating Explicit Intents at Runtime ……………………………………………………………….. 391
Tasks and the Back Stack ……………………………………………………………………………. 393
Switching between tasks ……………………………………………………………………… 393
Starting a new task …………………………………………………………………………….. 395
Using NerdLauncher as a Home Screen …………………………………………………………… 397
Challenge: Icons ………………………………………………………………………………………. 398
For the More Curious: Processes vs. Tasks ……………………………………………………….. 398
For the More Curious: Concurrent Documents …………………………………………………… 401
23. HTTP & Background Tasks ……………………………………………………………………………. 405
Creating PhotoGallery ……………………………………………………………………………….. 406
Networking Basics ……………………………………………………………………………………. 409
Asking permission to network ……………………………………………………………….. 411
Using AsyncTask to Run on a Background Thread ……………………………………………… 411
You and Your Main Thread …………………………………………………………………………. 413
Beyond the main thread ………………………………………………………………………. 414
Fetching JSON from Flickr …………………………………………………………………………. 415
Parsing JSON text ……………………………………………………………………………… 419
From AsyncTask Back to the Main Thread ……………………………………………………….. 422
Cleaning Up AsyncTasks ……………………………………………………………………………. 425
For the More Curious: More on AsyncTask ………………………………………………………. 426
For the More Curious: Alternatives to AsyncTask ……………………………………………….. 427
Challenge: Gson ………………………………………………………………………………………. 428
Challenge: Paging …………………………………………………………………………………….. 428
Challenge: Dynamically Adjusting the Number of Columns …………………………………… 428
24. Loopers, Handlers, and HandlerThread ………………………………………………………………. 429
Preparing RecyclerView to Display Images ………………………………………………………. 429
Downloading Lots of Small Things ………………………………………………………………… 432
Communicating with the Main Thread …………………………………………………………….. 432
Assembling a Background Thread …………………………………………………………………. 433
Messages and Message Handlers …………………………………………………………………… 435
Message anatomy ………………………………………………………………………………. 435
Handler anatomy ……………………………………………………………………………….. 436
Using handlers …………………………………………………………………………………. 437
Passing handlers ……………………………………………………………………………….. 441
For the More Curious: AsyncTask vs. Threads …………………………………………………… 447
Challenge: Preloading and Caching ………………………………………………………………… 447
For the More Curious: Solving the Image Downloading Problem ……………………………… 448
25. Search …………………………………………………………………………………………………….. 449
Searching Flickr ………………………………………………………………………………………. 449
Using SearchView …………………………………………………………………………………….. 455
Responding to SearchView user interactions ………………………………………………. 458
Simple Persistence with Shared Preferences ………………………………………………………. 460
Polishing Your App …………………………………………………………………………………… 464
Challenge: Polishing Your App Some More ………………………………………………………. 465
26. Background Services ……………………………………………………………………………………. 467
Creating an IntentService ……………………………………………………………………………. 467
What Services are For ……………………………………………………………………………….. 469
Safe background networking …………………………………………………………………. 470
Looking for New Results ……………………………………………………………………………. 471
Delayed Execution with AlarmManager …………………………………………………………… 473
Being a good citizen: using alarms the right way …………………………………………. 475
PendingIntent …………………………………………………………………………………… 477
Managing alarms with PendingIntent ……………………………………………………….. 477
Controlling Your Alarm ……………………………………………………………………………… 478
Notifications ……………………………………………………………………………………………. 481
Challenge: Notifications on Android Wear ………………………………………………………… 483
For the More Curious: Service Details …………………………………………………………….. 483
What a service does (and does not) do ……………………………………………………… 483
A service’s lifecycle …………………………………………………………………………… 484
Non-sticky services ……………………………………………………………………………. 484
Sticky services ………………………………………………………………………………….. 484
Bound services …………………………………………………………………………………. 485
For the More Curious: JobScheduler and JobServices …………………………………………… 486
For the More Curious: Sync Adapters …………………………………………………………….. 488
Challenge: Using JobService on Lollipop …………………………………………………………. 490
27. Broadcast Intents ………………………………………………………………………………………… 491
Regular Intents vs. Broadcast Intents ………………………………………………………………. 491
Receiving a System Broadcast: Waking Up on Boot …………………………………………….. 492
Creating and registering a standalone receiver …………………………………………….. 492
Using receivers …………………………………………………………………………………. 495
Filtering Foreground Notifications …………………………………………………………………. 496
Sending broadcast intents …………………………………………………………………….. 497
Creating and registering a dynamic receiver ……………………………………………….. 497
Limiting broadcasts to your app using private permissions ………………………………. 500
Passing and receiving data with ordered broadcasts ………………………………………. 502
Receivers and Long-Running Tasks ………………………………………………………………… 507
For the More Curious: Local Events ……………………………………………………………….. 507
Using EventBus ………………………………………………………………………………… 507
Using RxJava …………………………………………………………………………………… 508
For the More Curious: Detecting the Visibility of Your Fragment ……………………………… 509
28. Browsing the Web and WebView ……………………………………………………………………… 511
One Last Bit of Flickr Data …………………………………………………………………………. 511
The Easy Way: Implicit Intents …………………………………………………………………….. 514
The Harder Way: WebView …………………………………………………………………………. 516
Using WebChromeClient to spruce things up ……………………………………………… 520
Proper Rotation with WebView …………………………………………………………………….. 522
Dangers of handling configuration changes ………………………………………………… 523
For the More Curious: Injecting JavaScript Objects ……………………………………………… 523
For the More Curious: KitKat’s WebView Overhaul …………………………………………….. 524
Challenge: Using the Back Button for Browser History ………………………………………… 524
Challenge: Supporting Non-HTTP Links ………………………………………………………….. 525
29. Custom Views and Touch Events ……………………………………………………………………… 527
Setting Up the DragAndDraw Project ……………………………………………………………… 527
Setting up DragAndDrawActivity …………………………………………………………… 528
Setting up DragAndDrawFragment …………………………………………………………. 528
Creating a Custom View …………………………………………………………………………….. 530
Creating BoxDrawingView …………………………………………………………………… 530
Handling Touch Events ………………………………………………………………………………. 532
Tracking across motion events ……………………………………………………………….. 534
Rendering Inside onDraw(…) ………………………………………………………………………. 536
Challenge: Saving State ……………………………………………………………………………… 538
Challenge: Rotating Boxes ………………………………………………………………………….. 538
30. Property Animation ……………………………………………………………………………………… 539
Building the Scene ……………………………………………………………………………………. 539
Simple Property Animation …………………………………………………………………………. 542
View transformation properties ………………………………………………………………. 544
Using different interpolators …………………………………………………………………. 546
Color evaluation ……………………………………………………………………………….. 546
Playing Animators Together …………………………………………………………………………. 548
For the More Curious: Other Animation APIs ……………………………………………………. 550
Legacy animation tools ……………………………………………………………………….. 550
Transitions ………………………………………………………………………………………. 550
Challenges ……………………………………………………………………………………………… 550
31. Locations and Play Services …………………………………………………………………………… 551
Locations and Libraries ………………………………………………………………………………. 551
Google Play Services ………………………………………………………………………….. 552
Creating Locatr ………………………………………………………………………………………… 552
Play Services and Location Testing on Emulators ……………………………………………….. 553
Mock location data …………………………………………………………………………….. 554
Building out Locatr …………………………………………………………………………………… 556
Setting Up Google Play Services …………………………………………………………………… 559
Location permissions ………………………………………………………………………….. 560
Using Google Play Services …………………………………………………………………………. 561
Flickr Geosearch ………………………………………………………………………………………. 563
Getting a Location Fix ……………………………………………………………………………….. 564
Find and Display an Image ………………………………………………………………………….. 566
Challenge: Progress …………………………………………………………………………………… 569
32. Maps ………………………………………………………………………………………………………. 571
Importing Play Services Maps ………………………………………………………………………. 571
Mapping on Android …………………………………………………………………………………. 571
Maps API Setup ………………………………………………………………………………………. 572
Getting a Maps API Key ……………………………………………………………………… 572
Setting Up Your Map ………………………………………………………………………………… 574
Getting More Location Data ………………………………………………………………………… 576
Working with Your Map …………………………………………………………………………….. 579
Drawing on the map …………………………………………………………………………… 582
For the More Curious: Teams and API Keys ……………………………………………………… 584
33. Material Design ………………………………………………………………………………………….. 587
Material Surfaces ……………………………………………………………………………………… 587
Elevation and Z values ………………………………………………………………………… 589
State list animators …………………………………………………………………………….. 590
Animation Tools ………………………………………………………………………………………. 591
Circular reveal ………………………………………………………………………………….. 591
Shared element transitions ……………………………………………………………………. 593
View Components …………………………………………………………………………………….. 597
Cards …………………………………………………………………………………………….. 597
Floating action buttons ………………………………………………………………………… 598
Snackbars ……………………………………………………………………………………….. 600
More on Material Design ……………………………………………………………………………. 601
34. Afterword …………………………………………………………………………………………………. 603
The Final Challenge ………………………………………………………………………………….. 603
Shameless Plugs ………………………………………………………………………………………. 603
Thank You ……………………………………………………………………………………………… 604
Index …………………………………………………………………………………………………………… 605

Reviews

There are no reviews yet.

Be the first to review “Android Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides) by Bill Phillips, Chris Stewart, Kristin Marsicano, Brian Gardner”

Your email address will not be published. Required fields are marked *

Similar books

Home
Ebooks
0
Cart
My Account