0%

Book Description

Learn how to make mobile native app development easier. If your team frequently works with both iOS and Android—or plans to transition from one to the other—this hands-on guide shows you how to perform the most common development tasks in each platform. Want to learn how to make network connections in iOS? Or how to work with a database in Android? This book has you covered.

In the book’s first part, authors Shaun Lewis and Mike Dunn from O’Reilly’s mobile engineering group provide a list of common, platform-agnostic tasks. The second part helps you create a bare-bones app in each platform, using the techniques from part one.

  • Common file and database operations
  • Network communication with remote APIs
  • Application lifecycle
  • Custom views and components
  • Threading and asynchronous work
  • Unit and integration tests
  • Configuring, building, and running an app on a device

Table of Contents

  1. Preface
    1. Why We Wrote This Book
    2. Who This Book Is For
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Online Learning
    7. How to Contact Us
    8. Acknowledgments
  2. I. Tasks and Operations
    1. A Note About the State of Mobile Development
  3. 1. UI Controllers
    1. Tasks
    2. Android
      1. How to Create Your App’s Starting UI Controller
      2. How to Change the Active UI Controller
      3. Understanding the UI Controller Life Cycle
    3. iOS
      1. How to Create Your App’s Starting UI Controller
      2. How to Change the Active UI Controller
      3. Understanding the Controller Life Cycle
    4. What We’ve Learned
  4. 2. Views
    1. Tasks
    2. Android
      1. Create a New View
      2. Nesting Views
      3. Update a View’s State
    3. iOS
      1. Create a New View
      2. Nesting Views
      3. Interface Builder to the Rescue
      4. Update a View’s State
      5. Modifying Position
    4. What We’ve Learned
  5. 3. Custom Components
    1. Tasks
    2. Android
      1. How to Create a Custom View
      2. How to Use a Custom View
    3. iOS
      1. How to Create a Custom View
      2. How to Use a Custom View
    4. What We’ve Learned
  6. 4. User Input
    1. Tasks
    2. Android
      1. Receive and React to a Tap
      2. Receive and React to Keyboard Input
      3. Handle Compound Gestures
    3. iOS
      1. Receive and React to a Tap
      2. Receive and React to Keyboard Input
      3. Handle Compound Gestures
    4. What We’ve Learned
  7. 5. Message Passing
    1. Tasks
    2. Android
      1. Use a Callback to React to an Operation
      2. Dispatch a Message to Any Interested Subscribers
      3. Listen for, and React to, Messages Dispatched Within a System
    3. iOS
      1. Use a Callback to React to an Operation
      2. Dispatch a Message to Any Interested Subscribers
      3. Listen for, and React to, Messages Dispatched Within a System
      4. Closures Instead of Selectors
      5. Stop Listening for Notifications
    4. What We’ve Learned
  8. 6. Files
    1. Tasks
    2. Android
      1. Get Properties from the File Like Size or Last Modified Date
      2. Read and Write Data to and from a File
      3. Copy Data from One File to Another
    3. iOS
      1. Get Properties from the File Like Size or Last Modified Date
      2. Reading and Writing Data to and from a File
      3. Copy Data from One File to Another
    4. What We’ve Learned
  9. 7. Persistence
    1. Tasks
    2. Android
      1. Establish a Database Connection
      2. Create a Database Table or Persistent Object
      3. Write Data to That Table or Persistent Object
      4. Read Data from That Table or Persistent Object
    3. iOS
      1. Set Up and Connect to a Persistence Layer
      2. Define and Create a Database Table or Persistent Object
      3. Write and Persist Data to SQLite
      4. Read Data from SQLite
    4. What We’ve Learned
  10. 8. Concurrency (Multi-Threading)
    1. Tasks
    2. Android
      1. Perform a Task in a Background Thread
      2. Act on the Results of Work Performed in the Background Thread on the Main Thread
      3. Terminating a Thread
    3. iOS
      1. Perform a Task in a Background Thread
      2. Act on the Results of Work Performed in the Background Thread on the Main Thread
    4. What We’ve Learned
  11. 9. Networking
    1. Tasks
    2. Android
      1. Read and Print a Text File on a Remote Server
      2. Make an HTTP POST Request
      3. Download a Binary File
    3. iOS
      1. Read and Print a Text File on a Remote Server
      2. Make an HTTP POST Request
      3. Download a Binary File
    4. What We’ve Learned
  12. 10. User Feedback
    1. Tasks
    2. Android
      1. Use Framework-Provided Tools to Show the User Feedback
      2. Snackbar
      3. Update the Status Bar
    3. iOS
      1. Use Framework-Provided Tools to Show the User Feedback
      2. Update the Status Bar
    4. What We’ve Learned
  13. 11. User Preferences
    1. Tasks
    2. Android
      1. Write User Preferences
      2. Read User Preferences
      3. Work with User Preferences in a Multiple User Application
    3. iOS
      1. Write User Preferences
      2. Read User Preferences
      3. Work with User Preferences in a Multiple User Application
    4. What We’ve Learned
  14. 12. Serialization and Transports
    1. Tasks
    2. Android
      1. Serialize and Deserialize an Object Instance
    3. iOS
      1. Serialize and Deserialize an Object Instance
      2. iOS Notes
    4. What We’ve Learned
  15. 13. Extensions
    1. Tasks
    2. Android
      1. Add Functionality to Existing APIs
    3. iOS
      1. Add Functionality to Existing APIs
    4. What We’ve Learned
  16. 14. Testing
    1. Tasks
    2. Android
      1. Set Up and Run Unit Tests
      2. Set Up and Run Integration Tests
    3. iOS
      1. Set Up and Run Unit Tests
    4. What We’ve Learned
  17. II. Sample App
  18. 15. Welcome and Environment Setup
    1. Comparing Native Development to Cross-Platform Tools
      1. Web-Based
      2. Other
    2. Environment Setup
      1. Android Setup
      2. iOS Setup
    3. What We’ve Learned
  19. 16. Building an App
    1. Creating a New Project
      1. Android Studio
      2. Xcode
    2. App Architecture
    3. Building Our First Screen
      1. Android
      2. iOS
    4. What We’ve Learned
  20. 17. Listing Data in the App
    1. Sprucing Up Views
      1. Android
      2. iOS
    2. Adding a Button
      1. iOS
    3. Lists, Lists, and More Lists!
      1. Add a New Catalog View
      2. Wiring Up the Button
    4. Books
    5. Populating the List View
      1. Android
      2. iOS
    6. What We’ve Learned
  21. 18. Modeling Our Library
    1. Dynamic Data in List Views
      1. Android
      2. iOS
    2. It’s Time for Our Model Objects to Get Real
    3. JSON for One, JSON for All
    4. Switch the Model Layer to JSON
      1. Android
      2. iOS
    5. What We’ve Learned
  22. 19. And Yet, We Persisted
    1. Detailing Our Books
      1. Android
      2. iOS
    2. Saving Books for Later
      1. Android
      2. iOS
    3. Storing Books for Later
      1. Android
      2. iOS
    4. Saving Books
      1. Android
    5. What We’ve Learned
  23. 20. Networking and Our App
    1. Searching the World
      1. Android
      2. iOS
    2. Building a Search Endpoint
      1. Installing Node and Express
      2. Locations JSON File
    3. Calling Our Service
      1. Android
      2. iOS
    4. What We’ve Learned
  24. Index
18.119.255.94