Introduction

People take up mobile development these days for a lot of reasons. For some it is all about learning something new, but for many it comes out of necessity of a job or career. Perhaps you see mobile development as the next big thing, just like client-server development was in the 1990s, or web development became in the 2000s. Maybe you've been asked to learn more about mobile development techniques and technologies to make a recommendation to your boss for an approach to get your company started building mobile applications. Or you might be an independent software consultant who's feeling the demand for mobile software and is responding to the demand by learning the skills you need to stay ahead of the technology curve and deliver solutions to your customers.

Whatever your reason for picking up this book, thank you — and congratulations! Whether this is your first foray into mobile development or you've been writing mobile applications for years, you've just taken the first step on a journey that can be both technically challenging and tremendously rewarding. The technologies and techniques in this book can give you an edge over your competition. You then can speak authoritatively about mobile software best practices and proven enterprise mobility techniques wrought from years of experience. You can be confident recommending an approach for mobile development to your organization that can provide flexibility across mobile platforms and architectures. You can be the hero who puts your company on a path that is optimized for future changes in the marketplace — one that can result in savings of both time and money by leveraging your existing skills in .NET and C# development. This book gives you everything you need to catch the wave. Join us on the incredible ride that's only just beginning in mobile application development!

Who This Book Is For

This book is written by professional developers for professional developers. It is not a book about technology for technology's sake. The approaches outlined in this book, whether around choosing a mobile architecture, designing your user experience, or coding for reuse across platforms, come out of our experiences as professional developers in an enterprise setting. Solving the real-world business and technical problems facing companies across industries is the primary purpose of the material in this book.

This book is for experienced developers who are proficient in the .NET Framework and the C# language. The concepts and examples provided in this book require a fundamental knowledge of object-oriented principles and software design patterns. You don't need to know anything about mobile development. A basic understanding of the principles of layered architectures and the Model-View-Controller pattern is all you need. If you've ever written a web application using ASP.NET, you probably have the knowledge necessary to succeed with this book. You learn how to translate that skill and knowledge to become proficient at mobile development. With a little study and determination, you can lead your organization into the world of mobile apps!

What This Book Covers

This book covers everything you need to know to build enterprise mobile applications in C# that can be delivered on all the major mobile platforms in the market today. You build applications that share code on native iPad, iPhone, Android, Windows Phone, and the mobile web. You learn about the chief technical considerations to take into account when building mobile applications, such as user experience, device access, and disconnected capabilities. Security and deployment needs are also considered, all with an eye toward helping you start coding. You learn what questions to ask when deciding whether to build for the mobile web and native platforms or to use a hybrid approach. You learn the design and prototyping techniques necessary to take advantage of the unique interfaces and form-factors available on modern mobile devices and how to translate that into working applications. You code real-world examples and deploy them across platforms, all from a single code base. Mobile data services design and consumption, data synchronization, device utilities, and accessing device functionality are all covered in depth, as are hybrid development techniques and ways to extend your application to the desktop using thick client, web, or cloud approaches. This book contains all the essentials of cross-platform mobile development.

How This Book Is Structured

Part I, “Mobile Development Overview,” covers the architecture and design phases. Chapter 1, “Choosing the Right Architecture,” covers the essentials of mobile application architecture and many of the considerations you need to discuss when settling on an approach for your application. Chapter 2, “Designing Your User Experience,” covers designing your user experience using proven design and prototyping methods specifically geared toward mobile application usability and mobile device usage. The content included in this part is an essential component to succeed in mobile application development. You may be tempted to skip this section and get right to the code examples in Part II, but you should give Part I due attention. It can pay off when you get to the subsequent examples.

Part II, “Developing Cross-Platform Applications,” covers the nuts and bolts of cross-platform development using C# and .NET following a logical progression. You learn everything you need to know to set up your development environment in Chapter 3, “Setting Up Your Development Environment.” Chapter 4, “The MonoCross Pattern,” introduces the MonoCross pattern and outlines the rationale behind the design of the framework to orient you for the following examples. In Chapter 5, “Building Shared Applications,” you build your first cross-platform application. It's a simple example that illustrates all the key concepts you need to work with to be successful with the MonoCross pattern.

In Chapter 6, “Building MonoCross Containers,” you build your user interfaces and deploy your application to multiple platforms, and you begin to see the power of the MonoCross pattern. Chapter 7, “Designing and Building Data Services,” covers mobile data services design, and Chapter 8, “Consuming Data Services,” shows you how to consume those services from your application on the device.

Chapter 9, “Accessing the Device,” and Chapter 10, “Using MonoCross Utilities,” cover accessing the resources and features on the device using the MonoCross Utilities and native device APIs. Chapter 11, “Hybrid Applications,” brings it all together with advanced techniques to deliver hybrid applications taking advantage of both native and web-based techniques from a single application architecture. Finally, Chapter 12, “Delivering Applications to the Enterprise,” shows you how you can take your application to the enterprise desktop and presents advanced techniques for extending your cross-platform development strategy using view abstraction and mixed view models.

What You Need to Use This Book

If you're an experienced .NET/C# developer, most of the code in this book can be written, tested, and deployed using the tools and frameworks you're already familiar with. You can write all the code samples discussed in this book using Microsoft Visual Studio, and you can compile, test, and run all but the iOS samples using the Visual Studio IDE as well. The iOS samples require the MonoDevelop IDE (a free download) and a MacBook or other Apple computer to compile and run.

Beyond the latest version of the Microsoft .NET Framework, you need the latest iOS SDK from Apple, Android SDK from Google, and Windows Phone SDK from Microsoft. All are free downloads.

You also need to install MonoTouch and Mono for Android from Xamarin. Both products offer a free, fully functional trial version from the Xamarin website at http://xamarin.com. The only limitation on the trial versions is that they run only in the iOS simulator and Android emulator, respectively. You need to purchase a license if you want to deploy your application to a device.

Chapter 3 covers the details on everything you need to set up your development environment, so check out the details there as well.

Conventions

To help you get the most from the text and keep track of what's happening, this book uses a number of conventions.

  • We highlight new terms and important words when we introduce them.
  • We show keyboard strokes like this: Ctrl+A.
  • We show filenames, URLs, and code within the text like so: http://monocross.net.

We present code in two different ways:

We use a Monofont type with no highlighting for most code examples.
We use Bold to emphasize code that is particularly important in the present context or to show changes from a previous code snippet.

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All the source code used in this book is available for download at www.wrox.com. When at the site, simply locate the book's title (use the Search box or one of the title lists) and click the Download Code link on the book's detail page to obtain all the source code for the book. Code included on the website is highlighted by the following icon:

1.1

Listings include the filename in the title. This book provides a structure for storing the code that appears in a code note such as this:

Found in the MonoCross.Navigation/MXView.cs file of the download

1.1Because many books have similar titles, you may find it easiest to search by ISBN; this book's ISBN is 978-1-118-15770-1.

After you download the code, just decompress it with your favorite compression tool. Alternatively, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

Errata

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, such as a spelling mistake or faulty piece of code, we would be grateful for your feedback. By sending in errata, you may save another reader hours of frustration, and at the same time, you can help provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or selecting one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that have been submitted for this book and posted by Wrox editors. A complete book list, including links to each book's errata, is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don't spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

p2p.wrox.com

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At p2p.wrox.com, you can find a number of different forums to help you, not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

1. Go to p2p.wrox.com and click the Register link.

2. Read the terms of use and click Agree.

3. Complete the required information to join, as well as any optional information you want to provide, and click Submit.

4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

1.1You can read messages in the forums without joining P2P, but to post your own messages, you must join.

After you join, you can post new messages and respond to messages other users post. You can read messages at any time on the web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works, as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.151.154