Android Application Development All-in-One For Dummies
Häftad, Engelska, 2020
Av Barry Burd, John Paul Mueller, NJ) Burd, Barry (Drew University, Madison
379 kr
Beställningsvara. Skickas inom 5-8 vardagar
Fri frakt för medlemmar vid köp för minst 249 kr.Conquer the world of Android app development Android has taken over the mobile and TV markets and become unstoppable! Android offers a vast stage for developers to serve millions—and rake in the profits—with diverse and wide-ranging app ideas. Whether you're a raw recruit or a veteran programmer, you can get in on the action and become a master of the Android programming universe with the new edition of Android Application Development For Dummies All-in-One. In addition to receiving guidance on mobile and TV development, you'll find overviews of native code, watch, car, Android wear, and other device development.This friendly, easy-to-follow book kicks off by offering a fundamental understanding of Android's major technical ideas, including functional programming techniques. It moves on to show you how to work effectively in Studio, program cool new features, and test your app to make sure it's ready to release to a waiting world. You'll also have an opportunity to brush up on your Kotlin and develop your marketing savvy. There are millions of potential customers out there, and you want to stand out from the crowd! Understand new features and enhancementsGet development best-practicesKnow your Android hardwareAccess online materialsWith a market share like Android's, the stakes couldn't be higher. Android Application Development For Dummies All-in-One levels the field and gives you the tools you need to take on the world.
Produktinformation
- Utgivningsdatum2020-09-21
- Mått185 x 234 x 43 mm
- Vikt1 043 g
- FormatHäftad
- SpråkEngelska
- Antal sidor800
- Upplaga3
- FörlagJohn Wiley & Sons Inc
- ISBN9781119660453
Tillhör följande kategorier
Barry Burd, PhD, is a veteran author and educator. At the University of Illinois, he was five times elected to the university-wide List of Teachers Ranked as Excellent by their Students. He has written several books on Java and Android development. John Paul Mueller has produced 115 books and more than 600 articles on topics ranging from functional programming techniques to application development using C++.
- Introduction 1How to Use This Book 1Conventions Used in This Book 2Foolish Assumptions 2Icons Used in This Book 3Beyond the Book 4Where to Go from Here 4Book 1: Getting Started with Android Application Development 5Chapter 1: All about Android 7The Consumer Perspective 8The Versions of Android 9The Developer Perspective 12Java and Kotlin 12XML 14Linux 16The Business Perspective 18Chapter 2: Installing the Software Tools 19Setting Up the Software 20Considering the requirements 20Downloading the software 21Installing Android Studio 23Installing offline tools 25Launching the Android Studio IDE 28In Windows 29On a Mac 29In Linux 30In Chrome OS 30Using the Android Studio Setup Wizard 30Fattening Up the Android SDK 32The more things stay the same, the more they change 32Installing new versions (and older versions) of Android 33Creating an Android virtual device 35A third-party emulator 39Chapter 3: Creating an Android App 43Creating Your First App 43Starting the IDE and creating your first app 45Launching your first app 50Running Your App 52You Can Download All the Code 55Troubleshooting Common IDE Errors 58Error message: Failed to find target 58Error running ‘app’: No target device found 58Error message: Android Virtual Device may be incompatible with your configuration 58You lose contact with the Android Debug Bridge (ADB) 59You don’t like whatever AVD opens automatically 59The emulator stalls during startup 60Error message: The user data image is used by another emulator 61Error message: Unknown virtual device name 63The emulator displays a “process isn’t responding” dialog box 63Changes to your app don’t appear in the emulator 64Testing Apps on a Real Device 64Chapter 4: Examining a Basic Android App 67A Project’s Files 68The MainActivity.kt file 71The onCreate() method 72Using other templates 73The res Branch 76The res/drawable branch 77The res/layout branch 77The res/menu branch 78The res/mipmap branch 79The res/values branch 80Other Files in an Android Project 82The build.gradle file 82The AndroidManifest.xml file 85The R.java file 87The assets folder 89The android.jar archive 90The APK file 91What Did I Agree To? 93What’s in a name? 93Choosing a language 95Your app’s API levels 95Chapter 5: Conjuring and Embellishing an Android App 101Dragging, Dropping, and Otherwise Tweaking an App 102Creating the “look” 102Coding the behavior 112A Bit of Debugging 118Try it! 118Discovering the secrets of Logcat 123Using the debugger 126Chapter 6: Improving Your App 131Improving the Layout 131Changing the layout 132Creating a reusable layout 139Reusing a layout 142Starting Another Activity 145Localizing Your App 151Responding to Check Box Events 155Displaying Images 157Sending in Your Order 162Book 2: Android Background Material 167Chapter 1: Using Android Studio 169Good to Know versus Need to Know 170Getting a Feel for the Big Picture 171The main window 173Viewing modes 179The Designer tool 181Discovering What You Can Do 184Finding things 185Fixing code 190Refactoring 199Chapter 2: Kotlin for Java Programmers 203Using Kotlin or Java for Development 204Defining the Java Issues That Kotlin Fixes 207Improving control over null references 207Removing raw data types 210Using invariant arrays 210Working with proper function types 212Getting rid of the checked exceptions 213Nothing’s Perfect: Kotlin is Missing Features, Too 214Considering primitive types that are not classes 214Losing static members 214Eliminating non-private fields 215Reducing confusion by eliminating wildcard-types 216Abandoning the ternary-operator a ? b : c 217Looking at What Kotlin Adds to the Picture 218Considering higher order functions and lambdas 218Refining object orientation using extension functions 218Relying on smart casts 219Employing string templates 220Understanding primary constructors 221Implementing first-class delegation 221Using ranges of values 223Creating data classes 224Overloading operators 224Developing asynchronous code using coroutines 225Chapter 3: Kotlin for Everyone 227Moving from Development to Execution with Kotlin 228What is a compiler? 228Understanding native code compiler or interpreter issues 230Considering the Android Runtime (ART) 231Grasping Kotlin Code 235Nearly everything begins with an expression 236The Kotlin class 238Classes and objects 239Kotlin types 240Performing casts 245The Kotlin function 249Objects and their constructors 252Classes grow on trees 254The Kotlin package 255Considering Kotlin visibility rules 257Defying your parent 258Kotlin comments 259Chapter 4: What Kotlin Does (and When) 261Making Decisions (Kotlin if Statements) 261Testing for equality 264Choosing among many alternatives (Kotlin when statements) 266Repeating Instructions Over and Over Again 269Kotlin while statements 269Kotlin do statements 271Arrays in Kotlin 273Kotlin’s for statements 277Looping using Kotlin recursion 281Working with break and continue 283Jumping Away from Trouble 284Working with Kotlin Collections 286Considering the collection types 287Differentiating between read-only and mutable collections 289Chapter 5: Object-Oriented Programming in Kotlin 291Static Fields and Methods 291Interfaces and Callbacks 294Event handling and callbacks 299An object remembers who created it 302A less wordy way to implement an interface 303Classes That Must (and Must Not) Be Extended 305The need to override 306Java’s final classes 306Kotlin’s open classes 307Kotlin extensions 307Abstract classes 308Inner Classes 310Named inner classes 310Anonymous inner classes 312Chapter 6: Functional Programming in Kotlin 315Defining Functional Programming 316Differences from other programming paradigms 316Understanding its goals 317Understanding Pure and Impure Languages 318Using the pure approach 318Using the impure approach 320Comparing the Functional Paradigm 320Using Kotlin for Functional Programming Needs 322Defining the Role of State 323Using Recursion to Perform Calculations 324Relying on standard recursion 324Relying on tail recursion 326Using Function Types 327Understanding Function Literals 329Lambda expressions 329Anonymous functions 330Defining the Function Types 331Comprehensions 331Receivers 332Inline 334Utility 335Using Functional Programming for Android Apps 336Chapter 7: A Look at XML 339XML Isn’t Ordinary Text 340Of tags and elements 340Other things you find in an XML document 348What’s in a Namespace? 350The package attribute 353The style attribute 354Book 3: The Building Blocks 357Chapter 1: Getting an Overview of Jetpack 359Understanding the Benefits of Jetpack 360Eliminating boilerplate code 360Managing background tasks 361Navigating between activities and fragments 362Managing memory 364Performing configuration changes 365Considering the Jetpack Components 366Foundation 367Architecture 368Behavior 370UI 372Getting an Overview of the AndroidX Package 373Working with Lifecycle-Aware Components 374Focusing on activities 375Understanding events and states 376Chapter 2: Building a Foundation for Your App 377Working with Android KTX 378Getting a feel for KTX features 378Using KTX in your project 381Considering the modules 382Addressing Security Issues 389Benchmarking Your Application 392Removing barriers to correct results 393Creating a test app 394Profiling your app 397Tracing your app 398Checking for benchmarking module support 400Benchmarking the app 401Testing Application Functionality 403Chapter 3: Creating an Architecture 405Managing Application Activities 405Defining an activity 406Getting an overview of intent filters 407Considering the activity lifecycle 407Understanding the backstack 409Working with fragments 412Considering the fragment lifecycle 416Seeing activities and fragments in action 417Providing for Navigational Needs 433Creating the navigational graph 434Adding a NavHostFragment to your activity 437Adding destinations 438Creating links between destinations 440Creating the required linkages 442Performing Background Tasks Using WorkManager 446Chapter 4: Defining an App’s Behavior 451Working with Notifications 452Understanding what notifications do 452Anatomy of a notification 454Assigning a channel to your notification 456Setting the notification importance 457Considering the notification types 458Relying on notification updates 459Do Not Disturb mode 460Creating a notification 460Getting Permission 466Considering permission use 467Configuring permissions in AndroidManifest.xml 468Complying with User Preferences 469Deciding on a preference set 470Setting preferences using the Preference Library 472Working with MediaPlayer 481Adding Camera Support Using CameraX 484Sharing with Others 487Performing simple share actions with other apps 487Using Slices 488Chapter 5: Interacting with the Users 491Creating a Great Layout 492Defining the View and ViewGroup elements 492Creating a layout using XML 493Modifying a layout at runtime 497Considering the common layouts 498Working with adapters 499Debugging your layout 500Employing Color and Texture 502Working with styles and themes 503Creating a palette 509Using swatches to create color schemes 510Using Animations and Transitions 510Understanding the need for animations 511Animating graphics 511Communicating with Emoji 514Keyboard emoji support 515Using the cut-and-paste method on standard controls 516Using the AndroidX approach 517Book 4: Programming Cool Phone Features 521Chapter 1: Hungry Burds: A Simple Android Game 523Introducing the Hungry Burds Game 523The Hungry Burds Project’s Files 526The Main Activity 528The Code, All the Code, and Nothing But the Code 530Setting Up the Game 535Declaring properties 535The onCreate Method 537Displaying a Burd 538Creating random values 538Creating a Burd 539Placing a Burd on the constraint layout 540Animating a Burd 542Handling a Touch Event 544Finishing Up 546Chapter 2: An Android Social Media App 547Setting Things Up on Facebook’s Developer Site 548A Minimal Facebook App 549The build.gradle file 550The manifest file 550A Bare-Bones Main Activity 551Enriching the Minimal App 555Working with a radio group 559Controlling the web view 562Who tests your Facebook app? 563Chapter 3: Going Native 567The Native Development Kit 567Understanding why you need the NDK 568Knowing what you get 569Getting the NDK 570Creating an Application 573Starting with the template 573Seeing the essential project differences 575Considering the build.gradle (Module: app) differences 577Understanding the default template differences 580Getting an overview of the C++ file 582Seeing the result 583Book 5: Apps for Tablets, Watches, TV Sets, and Cars 585Chapter 1: Apps for Tablets 587Gaining Perspective 588Creating the right devices 589Running code on multiple devices 593Copying the project 594Seeing presentation differences 596Developing a Nested Navigational Graph 603Understanding the uses for nested navigational graphs 603Developing an app design 604Considering the content needs 608Creating a Responsive App 612Chapter 2: Developing for Android Wear 615Seeing Where Wearables Are Used 615Setting Up Your Testing Environment 617Creating the project 617Configuring a wearable device emulator 620Other testing configurations 624Wearable Apps: What’s the Big Deal? 625Case Study: A Watch Face 626Defining the watch face project 627Testing the watch face app 628Dissecting the skeletal watch face project 631Enhancing the skeletal watch face project 634Chapter 3: Developing for Android TV 637Getting Started 638Running the Skeletal App 641Dissecting the TV App 644Adding to the standard AndroidManifest.xml 644Looking into build.gradle (Module: app) 645Defining a layout 646The adapter and the presenter 647Using the Adapter class 648Using the Presenter class 650Chapter 4: Developing for Android Auto 653Checking Auto Compatibility 654Choosing the Google Play Services 656Considering Notification Limits 658Creating an Emulator 660Configuring your car for development 661Defining an emulator 662Developing an Android Auto App 670Creating the project 670Viewing the project configuration 672Performing required configuration tasks 674Touring the Media Service app 675Book 6: The Job Isn’t Done Until 679Chapter 1: Publishing Your App to the Google Play Store 681Creating a Google Play Developer Account 681Preparing Your Code 682Un-testing the app 683Choosing Android versions 683Setting your app’s own version code and version name 684Choosing a package name 685Preparing Graphic Assets for the Play Store 685Creating an icon 686Creating screenshots 688Providing other visual assets 690Creating a Publishable File 691Differences among builds 692Creating the release build 697Running a new APK file 702Running the app in a new AAB file 703Another way to build and run an AAB file 705Publishing Your App 708The App Releases page 708The Store Listing page 710The App Signing page 711Other pages 711Leave No Stone Unturned 714Publishing Elsewhere 714The Amazon Appstore 714Other venues 715Chapter 2: Monetizing and Marketing Your App 717Choosing a Revenue Model 718Charging for your app 719Offering an extended free trial 723Freemium apps 724Selling things with your app 726Subscription pricing 729Earning revenue from advertising 729Variations on in-app advertising 731Donationware 732Offering your app for free 732Getting paid to develop apps for others 732Marketing Your Application 733Brick Breaker Master: An App Marketing Case Study 734Chapter 3: Creating Public Support for Your App 739Obtaining Support through Patreon 740Discovering that patronage isn’t new 740Considering crowdfunding 741Defining why you should use crowdfunding 741Understanding the development angle 742Determining the trade-offs 744Developing Your Own Distribution Stream 744Creating podcasts 744Developing YouTube videos 746Employing social media 748Answering questions 750Taking the Personal Approach 750Creating a blog 751Answering your email 752Considering App Store Alternatives 754Getting Awards 756Looking for awards in all the right places 757Strutting your stuff 757Index 759