Xamarin Mobile Application Development for Android - Second Edition
eBook - ePub

Xamarin Mobile Application Development for Android - Second Edition

Nilanchala Panigrahy

Share book
  1. 296 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Xamarin Mobile Application Development for Android - Second Edition

Nilanchala Panigrahy

Book details
Book preview
Table of contents
Citations

About This Book

Develop, test, and deliver fully-featured Android applications using XamarinAbout This Book• Build and test multi-view Android applications using Xamarin.Android• Work with device capabilities such as location sensors and the camera• A progressive, hands-on guide to develop stunning Android applications using XamarinWho This Book Is ForIf you are a C# developer who wants to develop Android apps and enhance your existing skill set, then this book is ideal for you. Good working knowledge of C#, .NET, and object-oriented software development is assumed.What You Will Learn• Build a multi-view, orientation-aware Android application with navigation• Lay out content using the LinearLayout, RelativeLayout, and TableLayout layout managers• Use a ListView (AdapterView) and Adapter to build a view that is populated from server data• Consume REST web service to perform GET, UPDATE, DELETE operation• Use Android SQLite for data persistence and caching• Capture the current location of a device, determine the street address, and integrate with the map app• Test, debug, and deploy an Android appIn DetailTechnology trends come and go, but few have generated the excitement, momentum, or long-term impact that mobile computing has. Mobile computing impacts people's lives at work and at home on a daily basis. Many companies and individual developers are looking to become a part of the movement but are unsure how to best utilize their existing skills and assets. The Xamarin suite of products provides new opportunities to those who already have a significant investment in C# development skills and.NET code bases, and would like to enter into this new, exciting world.This example-oriented guide provides a practical approach to quickly learn the fundamentals of Android app development using C# and Xamarin.Android. It will lead you through building an Android app step-by-step with steadily increasing complexity.Beginning with an overview of the Android and Xamarin platforms to provide you with a solid understanding of the underlying platform, we gradually walk through building and testing a Points of Interest Android app using C# and the Xamarin.Android product. You will learn to create ListView and add detail view to your Android application. You will handle application behaviors on orientation changes, before learning the different techniques to manage resources and layouts to support multiple screen sizes. You will then access a SQLite database in a cross-platform way and add location features to your application. Finally, you will add camera integration to your application and deploy your app to the various Android app stores.Style and approachAn example-oriented, comprehensive guide to gain an understanding of both the Android and Xamarin platforms.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Xamarin Mobile Application Development for Android - Second Edition an online PDF/ePUB?
Yes, you can access Xamarin Mobile Application Development for Android - Second Edition by Nilanchala Panigrahy in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785280634

Xamarin Mobile Application Development for Android Second Edition


Table of Contents

Xamarin Mobile Application Development for Android Second Edition
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
Downloading the color images of this book
Errata
Piracy
Questions
1. The Anatomy of an Android App
The Android platform
Versions of Android
The Linux kernel
Native libraries
The Android runtime
The application framework
The application layer
The building blocks of the Android application
The Android packages (.apk)
The application manifest
Activities
The life cycle of an activity
The events of an activity
Fragments
The fragment life cycle
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
The View and layout identifiers
Using XML layouts from activities
Intents
Resources
The R.java file
Summary
2. The Xamarin.Android Architecture
Getting started with Xamarin
Why Xamarin.Android?
The benefits of using Xamarin.Android
The drawbacks of using 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 POIApp
Installing Xamarin.Android
Installing platforms and tools
Tools
The Android platform APIs
The Android platform Extras
Creating Android Virtual Devices
Cloning a virtual device
Speeding up the Android emulator
Using the x86 emulator
Third-party emulator solutions
The Xamarin Android Player
Genymotion
Creating the POI app
The Xamarin Studio IDE
The Project Options view
Understanding the project structure
The Xamarin Studio layout designer
The designer content layout
The Document Outline and Properties pads
Toolbox
Setting the target framework
Setting the app icon and package name
The launcher activity
Running and debugging the app
Debugging with an Android device
Enabling USB debugging
Installing a USB driver
Running apps on a device
Behind the scenes
The peer object
The AndroidManifest.xml file
Summary
4. Adding a List View
Creating the POI ListView layout
Creating POIListActivity
Creating the POI list row 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
Creating the PointOfInterest apps entity class
Populating the ListView item
Creating POIListViewAdapter
Implementing a constructor
Implementing Count { get }
Implementing GetItemId()
Implementing the index getter method
Implementing GetView()
Reusing row Views
Populating row Views
Populating the list thumbnail image
Using UrlImageViewHelper
Adding Internet permissions
Hooking up POIListViewAdapter
Consuming the web service
An introduction to web services
Deploying the POI web service
Consuming REST web services asynchronously
Creating the POIService class
Asynchronous programming with async and await
Serializing and deserializing using Json.NET
Updating POIListActivity
Adding actions to ActionBar
Defining the menu XML file
Setting menus in OnCreateOptionsMenu()
Handling selection in OnOptionsItemSelected()
Handling the ListView click event
Handling no network condition
Toast
Summary
5. Adding a Details View
Creating the POIDetail layout
Understanding ScrollView
Using the TableLayout manager
Working with EditText's InputType
Creating POIDetailActivity
Adding navigation to POIDetailActivity
Navigation on the POIList item click
Receiving the data in POIDetailActivity
Binding variables to controls
Populating user interface widgets
Adding the save and delete actions
Disabling the delete action
Adding the save and delete actions in POIService
Consuming the web service to create or update a POI
Adding the CreateOrUpdatePOIAsync method to POIService
Consuming the web service to delete the POI
Adding the DeletePOIAsync method to POIService
Creating SavePOI()
Creating DeletePOI()
Adding validation
Using the EditText.Error property
Adding a delete confirmation prompt
Refreshing POIListActivity
Summary
6. Making Your App Orientation-aware
The Android behavior on configuration changes
Locking the Android application orientation
Dynamically requesting the orientation
Saving the activity state for configuration changes
Manually saving the activity state
Retaining the POI list scroll position
Building the orientation-aware layout
Manually handling the orientation behavior
Summary
7. Designing for Multiple Screen Sizes
An introduction to Android tablets
Creating an Android tablet emulator
An introduction to fragments
Creating a new fragment
Making POIApp compatible with Android tablets
Using fragments for displaying POIDetails
Creating the POIDetailsFragment layout
Creating the POIDetailFragment
Working with the save and delete actions
Adding the POIDetailFragment to POIDetailActivity
Modifying the POI details activity layout
Refactorin...

Table of contents