O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering Android Studio 3

Book Description

Unleash the power of Android Studio 3 to develop mobile applications faster and efficiently.

About This Book

  • Use Android Studio not just as an IDE but as a complete testing and build solution
  • Produce customized APKs with Gradle to suit various versions of an app, such as test versions and free versions of an otherwise paid app.
  • Explore all aspects of UI development and testing using working XML and Java examples.
  • Learn seamless migration from Eclipse and other development platforms to Android Studio.

Who This Book Is For

This book targets developers, with experience of developing for Android, who are new to Android Studio or wish to migrate from another IDE such as Eclipse. This book will show you how to get the utmost from this powerful tool.

What You Will Learn

  • Create styles, themes, and material designs
  • Set up, configure, and run virtual devices using the AVD manager
  • Improve the design of your application using support libraries
  • Learn about GitHub libraries
  • Use emulators to design layouts for a wide variety of devices, including wearables.
  • Improve application performance in terms of memory, speed, and power usage

In Detail

Android Studio is an Integrated Development Environment (IDE) designed for developing Android apps. As with most development processes, Android keeps resources and logic nicely separated, and so this book covers the management of imagery and other resources, and the development and testing tools provided by the IDE.

After introducing the software, the book moves straight into UI development using the sophisticated, WYSIWYG layout editor and XML code to design and test complex interfaces for a wide variety of screen configurations.

With activity design covered, the book continues to guide the reader through application logic development, exploring the latest APIs provided by the SDK. Each topic will be demonstrated by working code samples that can be run on a device or emulator.

One of Android Studio's greatest features is the large number of third-party plugins available for it, and throughout the book we will be exploring the most useful of these, along with samples and libraries that can be found on GitHub.

The final module of the book deals with the final stages of development: building and distribution. The book concludes by taking the reader through the registration and publication processes required by Google. By the time you have finished the book, you will be able to build faster, smoother, and error-free Android applications, in less time and with fewer complications than you ever thought possible.

Style and approach

This is a step-by-step guide with examples demonstrating how Android Studio can be used as a complete solution for developing, testing, and deploying apps from start to finish.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the color images of this book
      2. Errata
      3. Piracy
      4. Questions
  2. Workspace Structure
    1. How Android Studio differs
    2. Workspace structure
      1. Editor windows
      2. Tool windows
    3. The Android SDK
      1. Virtual devices
      2. Instant Run
    4. Importing projects into Android Studio
    5. Summary
  3. UI Design
    1. The Layout Editor
      1. Linear and relative layout classes
    2. The constraint layout
      1. Creating a ConstraintLayout
      2. Applying constraints
      3. Graphic Properties tool
      4. Baseline alignment
      5. Controlling position with bias
      6. The constraints toolbar
    3. Multiple screen previewing
      1. Hardware profiles
      2. Virtual storage
    4. Summary
  4. UI Development
    1. Material design
      1. Android styles
      2. Material themes
        1. The Theme Editor
      3. XML fonts
    2. The design library
      1. The coordinator layout
      2. Snackbars and Floating Action Buttons
    3. Collapsing app bars
      1. Raw text resources
      2. The percent library
    4. Summary
  5. Device Development
    1. Screen orientation
    2. Virtual devices
      1. Layout and image qualification
      2. Scale and platform
      3. Alternative emulators
    3. Android Wear
      1. Connecting to a wearable AVD
      2. Wearable layouts
        1. The WatchViewStub class
        2. Shape - aware layouts
    4. Accessing sensors
      1. Sensor emulation
    5. Device monitoring
      1. Project templates
      2. Monitoring and profiling
    6. Summary
  6. Assets and Resources
    1. Asset Studio
      1. Image Asset Studio
        1. Layered icons
      2. Launcher icon tools
      3. Vector Asset Studio
      4. Vector drawables
    2. Animated icons
      1. Other animations
    3. General drawables
      1. The palette library
    4. Summary
  7. Templates and Plugins
    1. Project templates
      1. The Navigation Drawer template
        1. The Structure Explorer
        2. Class inspection plugins
      2. The Master/Detail Flow template
    2. Custom templates
      1. Third-party templates
    3. Project samples
    4. Third-party plugins
      1. ADB Wi-Fi
      2. Codota
    5. Summary
  8. Language Support
    1. Kotlin support
      1. The advantages of Kotlin
      2. Extending Kotlin
    2. C/C++ support
      1. The NDK
    3. Android Things
      1. Development kits
      2. Creating a Things project
    4. Summary
  9. Testing and Profiling
    1. Logcat filters
    2. JUnit testing
      1. Local unit tests
    3. Testing a UI
      1. Testing views
      2. Testing lists and data
      3. Recording tests
      4. Remote testing
      5. Stress testing
    4. Performance monitoring
      1. CPU profiling
      2. Memory profiler
      3. Network profiler
    5. Summary
  10. Packaging and Distribution
    1. Gradle build configurations
      1. Command-line options
      2. Product flavors
    2. An APK analysis
    3. Publishing applications
      1. Generating a signed APK
        1. Managing keystores
        2. Google Play app signing
      2. Automatic signing
    4. Summary