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

Mobile Development with C#

Book Description

It’s true: you can build native apps for iOS, Android, and Windows Phone with C# and the .NET Framework—with help from MonoTouch and Mono for Android. This hands-on guide shows you how to reuse one codebase across all three platforms by combining the business logic layer of your C# app with separate, fully native UIs. It’s an ideal marriage of platform-specific development and the "write once, run everywhere" philosophy.

By building a series of simple applications, you’ll experience the advantages of using .NET in mobile development and learn how to write complete apps that access the unique features of today’s three most important mobile platforms.

  • Learn the building blocks for building applications on iOS, Android, and Windows Phone
  • Discover how the Mono tools interact with iOS and Android
  • Use several techniques and patterns for maximizing non-UI code reuse
  • Determine how much functionality can go into the shared business logic layer
  • Connect to external resources with .NET’s rich networking stack
  • Read and write data using each platform’s filesystem and local database
  • Create apps to explore the platforms’ location and mapping capabilities

Table of Contents

  1. A Note Regarding Supplemental Files
  2. Preface
    1. Who Is This Book For?
    2. Contents of This Book
    3. Conventions Used in This Book
    4. This Book’s Example Files
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Surveying the Landscape
    1. The Players
      1. iOS
      2. Android
      3. Windows Phone
    2. Write Once, Run Anywhere
    3. An Alternative Approach
    4. Summary
  4. 2. Hello, Platforms!
    1. iOS
      1. What Is MonoTouch?
      2. Create the Application
        1. Defining the Interface
        2. Writing the Application Code
    2. Android
      1. Mono for Android
      2. Create the Application
        1. Resources
        2. Defining the Interface
        3. Writing the Application Code
    3. Windows Phone
      1. Create the Application
        1. Defining the Interface
        2. Writing the Application Code
    4. Summary
  5. 3. Code Sharing Techniques
    1. Project Setup
    2. File Linking
    3. Abstraction
    4. Observer Pattern
    5. Partial Classes
    6. Conditional Compilation
    7. Summary
  6. 4. Accessing the Network
    1. Reaching into the Cloud
      1. Shared Layer
      2. iOS
      3. Android
      4. Windows Phone
    2. Notifying the User Interface
      1. Shared Layer
      2. iOS
      3. Android
      4. Windows Phone
    3. Summary
  7. 5. Storing Data
    1. Project Setup
      1. Shared Layer
      2. iOS
      3. Android
      4. Windows Phone
    2. Accessing the Filesystem
      1. Direct File Access
        1. iOS
        2. Android
      2. Isolated Storage
        1. iOS
        2. Android
        3. Windows Phone
    3. Using a Local Database
      1. iOS and Android
      2. Windows Phone
      3. Open Source Alternatives
    4. Summary
  8. 6. Location, Location, Location
    1. Mapping
      1. iOS
      2. Android
      3. Windows Phone
    2. Mocking Location
      1. iOS
      2. Android
      3. Windows Phone
    3. Using Location Data
      1.  
        1. Accuracy
        2. Frequency
        3. Availability
      2. iOS
      3. Android
      4. Windows Phone
    4. Summary
  9. A. Creating Android Virtual Devices
  10. B. Further Reading
    1. iOS
      1. Books
      2. Web
    2. Android
      1. Books
      2. Web
    3. Windows Phone
      1. Books
      2. Web
  11. About the Author
  12. Copyright