Home Page Icon
Home Page
Table of Contents for
Xamarin Essentials
Close
Xamarin Essentials
by Mark Reynolds
Xamarin Essentials
Xamarin Essentials
Table of Contents
Xamarin Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Xamarin and Mono – a Pathway to the Unnatural
Understanding Mono
The Xamarin product suite
Evaluating whether Xamarin is the right tool
Learning C#
Installing Xamarin
Installing Xamarin on OS X
Installing Xamarin on Windows
Development environments
Using the Xamarin Studio environment
Using Xamarin Studio to develop Android apps
Using Xamarin Studio to develop iOS apps
Using the Visual Studio environment
Using Visual Studio to develop Android apps
Using Visual Studio to develop iOS apps
Comparing IDEs
Version control
Summary
2. Demystifying Xamarin.iOS
Xamarin.iOS and Ahead-of-Time compilation
Understanding Mono assemblies
Xamarin.iOS bindings
The design principles
C# types and type safety
Use of inheritance
Mapping Objective-C delegates
Via .NET events
Via .NET properties
Via strongly typed delegates
Via weakly typed delegates
Creating binding libraries
Memory management
Disposing of objects
Keeping objects around
Limitations of using the AOT compilation
Runtime features disabled
Generating code for XIB and storyboard files
Generated classes
Designer files
Non-designer files
Outlets properties
Action properties
Xamarin.iOS Designer
Summary
3. Demystifying Xamarin.Android
Mono CLR and Dalvik VM – working side by side
Introducing the Java Native Interface
Peer objects
Xamarin.Android application packaging
Understanding Mono assemblies
Xamarin.Android bindings
The design principles
Properties
Events versus listeners
Special help with collections
Interfaces
Mapping nested classes
Mapping the Runnable interface
Enumerations
Resources
Attributes for the ApplicationManifest.xml file
Editor for the ApplicationManifest.xml file
Garbage collection
JNI global and weak references
Mono collections
Automatic collections
Helping the GC
Xamarin.Android Designer
Summary
4. Developing Your First iOS App with Xamarin.iOS
The sample national parks app
Creating the sample app
The Project Options view
Running and debugging within Xamarin Studio
Extending the sample app
Storing and loading national parks
Adding Json.NET
Creating an entity class
Adding a JSON-formatted file
Loading objects from a JSON-formatted file
Saving objects to a JSON-formatted file
Running the app
Enhancing the UI
Touring the Xamarin.iOS Designer
Adding EditViewController and segues
Implementing the DoneClicked event handler
Implementing the DeleteClicked action
Passing data
Running the app
Finishing the sample app
Finishing DetailViewController
Finishing EditViewController
Running the app
MonoTouch.Dialog
Summary
5. Developing Your First Android App with Xamarin.Android
The sample app
Creating NationalParks.Droid
Reviewing the app
Resources
The Resource.designer.cs file
The MainActivity.cs file
The Main.axml file
Project Options
Xamarin Studio Preferences
Running and debugging with Xamarin Studio
Running apps with the Android Emulator
Running apps on a physical device
Running apps with Genymotion
Extending NationalParks.Droid
Storing and loading national parks
Adding Json.NET
Borrowing the entity class and JSON file
Creating the NationalParksData singleton
Enhancing MainActivity
Adding a ListView instance
Touring the Xamarin.Android Designer
Editing the Main.xml file
Creating an adapter
Adding the New action to the ActionBar
Overriding the OnCreateOptionsMenu() method
Overriding the OnOptionsItemSelected() method
Running the app
Creating the DetailActivity view
Adding ActionBar items
Populating DetailActivity
Handling the Show Photos action
Handling the Show Directions action
Adding navigation
Running the app
Creating EditActivity
Adding ActionBar items
Creating reference variables for widgets
Populating EditActivity
Handling the Save action
Handling the Delete action
Adding navigation
Navigating on the New action
Navigating on the Edit action
Refreshing ListView in MainActivity
Running the app
Working with Xamarin.Android projects in Visual Studio
Reviewing the generated elements
Peer objects
The AndroidManifest.xml file
The APK file
Summary
6. The Sharing Game
Sharing and reuse
Old school source file linking
Creating a shared library project
Updating NationalParks.Droid to use shared files
Updating NationalParks.iOS to use shared files
Portable Class Libraries
Creating NationalParks.PortableData
Implementing IFileHandler
Updating NationalParks.Droid to use PCL
Updating NationalParks.iOS to use PCL
The pros and cons of the code-sharing techniques
Summary
7. Sharing with MvvmCross
Introducing MvvmCross
The MVVM pattern
Views
ViewModels
Commands
Data binding
The binding modes
The INotifyPropertyChanged interface
Binding specifications
Navigating between ViewModels
Passing parameters
Solution/project organization
The startup process
App.cs
Setup.cs
The Android startup
The iOS startup
Creating NationalParks.MvvmCross
Creating the MvvmCross core project
Creating the MvvmCross Android app
Reusing NationalParks.PortableData and NationalParks.IO
Implementing the INotifyPropertyChanged interface
Implementing the Android user interface
Implementing the master list view
Creating MasterViewModel
Updating the Master.axml layout
Creating the MasterView activity
Implementing the detail view
Creating DetailViewModel
Updating the Detail.axml layout
Creating the DetailView activity
Adding navigation
Implementing the edit view
Creating EditViewModel
Updating the Edit.axml layout
Creating the EditView activity
Adding navigation
Creating the MvvmCross iOS app
Implementing the iOS user interface
Implementing the master view
Implementing the detail view
Adding navigation
Implementing the edit view
Adding navigation
Refreshing the master view list
Considering the pros and cons
Summary
8. Sharing with Xamarin.Forms
An insight into the Xamarin.Forms framework
Pages
Views
Layouts
Cells
Navigation
Defining Xamarin.Forms user interfaces
Extensible Application Markup Language (XAML)
Code-behind classes
Data binding
Using Renderers
Native features and the DependencyService API
App startup
Shared App classes
iOS apps
Android apps
Project organization
Creating the NationalParks Xamarin.Forms app
Creating the solution
Adding NationalParks.PortableData
Implementing ParksListPage
Implementing ParkDetailPage
Using DependencyService to show directions and photos
Creating the interface
Creating the iOS implementation
Creating the Android implementation
Adding calls to DependencyService
Running the app
Implementing ParkEditPage
Considering the pros and cons
Summary
9. Preparing Xamarin.iOS Apps for Distribution
Preparing for distribution
Profiling Xamarin.iOS apps
iOS Application (Info.plist) settings
iOS Build settings
SDK Options
Linker Options
Overriding the linker
Debugging options
Code generation options
Supported architectures
LLVM optimizing compiler
ARM thumb instruction set
Distributing Xamarin.iOS apps
The Ad Hoc and enterprise distributions
TestFlight distribution
App Store submission
Summary
10. Preparing Xamarin.Android Apps for Distribution
Preparing for a release APK
Profiling Xamarin.Android apps
Disabling debug
Changing the settings in AndroidManifest.xml
Changing the settings in AssemblyInfo.cs
Android Application (AndroidManifest.xml) settings
Linker Options
Overriding the linker
Preserving code with attributes
Preserving code with custom linker files
Skipping assemblies
Supported ABIs
Publishing a release APK
Keystores
Publishing from Xamarin.Android
Republishing from Xamarin.Android
Publishing from Visual Studio
App distribution options
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Table of Contents
Next
Next Chapter
Xamarin Essentials
Xamarin Essentials
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset