Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Mark Reynolds
Xamarin Mobile Application Development for Android
Xamarin Mobile Application Development for Android
Table of Contents
Xamarin Mobile Application Development for Android
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. The Anatomy of an Android App
The Android platform
Linux
Native libraries
The Android runtime
The Application Framework
Applications
The Android packages (.apk)
The application manifest
Versions of Android
The Android applications
Activities
The life cycle of an activity
The states of an activity
The events of an activity
Services
Content providers
Broadcast receivers
Views and ViewGroups
Declarative versus programmatic View creation
User interface widgets
Common layouts
Adapter layouts
XML layout files
Element and attribute names
IDs
Using XML layouts from activities
Intents
Resources
The R.java file
2. Xamarin.Android Architecture
Why Xamarin.Android?
What is Mono?
Mono and Dalvik side by side
The Java Native Interface
Peer objects
Xamarin.Android application packaging
The Android bindings design
Design principles
C# properties
Delegates
Constants to enumerations
Development environments
Xamarin Studio
Xamarin for Visual Studio
IDE comparison
Compatibility
Summary
3. Creating the Points of Interest App
The sample app
Installing Xamarin.Android
Behind the scenes
Peer object
The AndroidManifest.xml file
Summary
4. Creating a Data Storage Mechanism
Creating the Point of Interest entity class
Creating the POI storage interface
Implementing the POI storage services
Using Xamarin.Android NUnitLite
Setting up for tests
Creating the test methods
The Create POI test
The Update POI test
The DeletePOI() test
Executing the tests
Json.NET
Downloading Json.NET
Implementing and testing the POIJsonService methods
Implementing caching
Implementing SavePOI()
Implementing GetPOI()
Implementing DeletePOI()
Summary
5. Adding a List View
Creating the POI ListView layout
Adding a RelativeLayout view group
Adding an ImageView widget
Adding a LinearLayout widget
Adding the name and address TextView classes
Adding the Distance TextView
Populating the ListView item
Shared instance of IPOIDataService
Permissions
Creating POIListViewAdapter
Implementing a constructor
Implementing Count { get; }
Implementing GetItemId()
Implementing the index getter method
Implementing GetView()
Reusing row Views
Populating row Views
Hooking up POIListViewAdapter
Adding actions to ActionBar
Defining the menu .xml file
Setting menus in OnCreateOptionsMenu()
Handling selection in OnOptionsItemSelected()
Configuring an SD card for the emulator
Running POIApp
Android Device Monitor
Handling row clicks
Summary
6. Adding a Detail View
Creating the POIDetail layout
Working with InputType
Creating POIDetailActivity
Binding variables to controls
Adding navigation to POIDetailActivity
Navigating on new action
Navigating on POI Click
Receiving data in POIDetailActivity
Populating user interface widgets
Adding Save and Delete actions
Disabling the Delete action
Creating SavePOI()
Creating DeletePOI()
Adding validation
Using the EditText.Error property
Adding a Delete confirmation prompt
Toasting success
Refreshing POIListActivity
Wrapping up
Summary
7. Making POIApp Location Aware
Location services
Setting app permissions
Configuring the emulator
Obtaining an instance of LocationManager
Requesting location change notifications
Implementing ILocationListener
Adding location services to POIApp
Adding location services to POIListActivity
Adding location services to POIDetailActivity
Updating the user interface
Adding the code
Getting an address for a location
Keeping the user informed
Dealing with configuration changes
Saving and restoring a state
Preventing activity destruction
Adding map integration
Navigating to the map app
Checking for registered map apps
Summary
8. Adding Camera App Integration
Picking an integration approach
Permissions and Features
Configuring the Emulator
Extending the data service
Defining GetImageFilename()
Implementing GetImageFilename()
Updating DeletePOI()
Capturing an image from POIDetailActivity
Adding UI elements
Creating the intent
Checking for registered camera apps
Providing additional information with the intent
Providing a filename and location
Providing size limit
Starting the intent
Completing the NewPhotoClicked() method
Processing the results of the intent
Displaying existing images in POIDetailActivity
Displaying POI images in POIListActivity
9. Deploying Your App
App distribution options
Preparing for a release APK
Disabling debug
AndroidManifest.xml
AssemblyInfo.cs
Linking
Linking options
Side effects of linking
Selecting supported ABIs
Publishing a signed APK
Keystores
Publishing from Xamarin.Android
Republishing
Summary
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
Next
Next Chapter
Table of Contents
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