Build Android Apps with C# and .NET using the Xamarin Tools for Visual Studio (3 days)

MOC-40537

Categoria corsi: Developer

This course teaches C# .NET developers the basics of building Android mobile applications using the Xamarin tools for Visual Studio. Topics include Android activities, intents, fragments, consuming REST-based services, ListViews, and data storage with SQLite.

This three-day course is intended for developers with at least basic C# knowledge with 6-12 months of .NET experience. Students should own and/or have used an Android device and/or be familiar with the paradigms of the platform.

Hardware/Software:

  • A Mac running on the latest OS, with Visual Studio for Mac installed or a Windows 10 PC with Visual Studio 2017 and the Mobile development with .NET workload installed

  • An Android device is highly recommended although not required.

After completing this course, students will be able to:

  • Build multi-screen Android applications with C# and .NET
  • Store data locally with SQLite
  • Communicate with REST services

Course Outline
Module 1: Getting Started with Xamarin (XAM101)
By the end of this module, you will be able to choose the Xamarin approach that is right for you. You will also set up your development machine and run an app on Windows, the iOS simulator, and an Android emulator.
Lessons

  • Cloud technology overview

  • Define the state of mobile technology today

  • Discuss mobile app trends

  • Identify approaches to development

  • Discover the Xamarin Approach

  • Set up your development environment
    Lab : Building Cross-Platform Applications with Xamarin

  • Demonstration - Cross-Platform Applications with Xamarin

  • Demonstration – View a Xamarin.Forms Project

  • Setup Validation – Validate your development environment is ready

After completing this module, students will be able to:

  • Identify mobile development trends.
  • Identify the different approaches to mobile development.
  • Describe the Xamarin approach to development.
  • Set up and validate the development environment.

Module 2: Introduction to Xamarin.Android (AND101)
During this module you will create a new project in Visual Studio, code the user interface and behavior for an Activity, build the project, and test it on an Android emulator. You'll also see how to keep your development environment up to date as new Android versions are released.
Lessons

  • Create a Xamarin.Android project
  • Decompose an app into Activities
  • Build an Activity's UI
  • Write an Activity's behavior
  • Update your Android SDK

After completing this module, students will be able to:

  • Create a new Xamarin.Android project.
  • Define the concept of an Activity.
  • Decompose an app into Activities.
  • Add Views to a Layout in XML.
  • Use the Designer tool.
  • Designate a Main Activity.
  • See how the Main Activity is listed in the app Manifest.
  • Load an Activity's UI.
  • Access Views from code.
  • Review native Android development.
  • Understand the Xamarin.Android development process.
  • Update your Android Tools.
  • Update your Android Platform SDK.

Module 3: Activities and Intents (AND102)
In this module you will code the core patterns that make Activities work together. You will see how to start Activities, pass arguments, and retrieve results. You will also see how to launch standard Android Activities such as the camera or the web browser.
Lessons

  • Start an Activity in your .apk

  • Finish an Activity

  • Pass arguments to an Activity

  • Get Activity results

  • Start a system Activity
    Lab : Create an app with collaborating Activities

  • Explore the completed lab exercise

  • Start an Activity in your .apk

  • Programmatically end an Activity

  • Pass arguments to an Activity

  • Get Activity Results

  • Launch a system Activity

After completing this module, students will be able to:

  • Create an explicit Intent.
  • Start an Activity.
  • Implement Stack Navigation.
  • Programmatically finish an Activity.
  • Load a Bundle of arguments into an Intent.
  • Retrieve the arguments in the target Activity.
  • Pass and return a request code and Bundle.
  • Retrieve results.
  • Create an implicit Intent.
  • Load Intent Action, Data, and Extras.
  • Verify that Android found an Activity that matches your implicit Intent.

Module 4: List Views and Adapters in Android (AND110)
In this module you will code an Adapter to populate the ListView and handle item-selection events to implement a simple master-detail pattern. You will also see two advanced tasks: layout recycling with view holders to boost performance and fast scrolling with section indexers to help the user navigate large data sets.
Lessons

  • Handle list-item click events

  • Implement a custom adapter

  • Use layout recycling and the view-holder pattern
    Lab : Use an Adapter to populate a ListView and then customize it to boost efficiency

  • Populate a ListView using an ArrayAdapter

  • Handle list-item click events

  • Implement a custom adapter

  • Use layout recycling and the view-holder pattern

  • Enable fast scrolling and a code a section indexer

After completing this module, students will be able to:

  • Add a ListView to a UI.

  • Use ArrayAdapter to populate a ListView.

  • Identify the limitations of ArrayAdapter.

  • Subscribe to the ListView.ItemClick event.

  • Determine which list items was clicked.

  • Reuse inflated layouts to reduce memory usage.

  • Cache view references to increase performance.

  • Enable ListView fast scrolling.
    Module 5: Consuming REST-based Web Services (XAM150)
    In this module, you will learn to consume REST-based web services with HttpClient using both the managed networking stack and the platform-specific handlers that boost performance. You will also learn some common strategies for dealing with the unique challenges that mobile devices face when communicating over the network.
    Lessons

  • Obtain the device’s network capabilities

  • Introduce REST

  • Consume REST services with Xamarin
    Lab : Use, consume, and communicate with REST services

  • Determine the network connectivity

  • Communicate with a Book Service

  • Demonstration: Leverage the native platform network stack

After completing this module, students will be able to:

  • Determine if the device has a connection.

  • Obtain the device’s connection type.

  • Determine when network availability changes.

  • Identify REST services.

  • Utilize URLs in REST.

  • Describe guidelines for using REST.

  • Identify REST services.

  • Utilize URLs in REST.

  • Describe guidelines for using REST.

  • Customize the HttpClient handler.

  • Leverage platform network stacks.

  • Use App Transport Security on iOS.
    Module 6: SQLite and Mobile Data (XAM160)
    During this module you will learn to identify the proper location for your database file and how to insert, update, retrieve, and delete data efficiently using asynchronous I/O calls.
    Lessons

  • Choose a data storage strategy

  • Store data locally with SQLite

  • SQLite asynchronously
    Lab : Utilize SQLite to store and access data

  • Determine your database file path

  • Add SQLite.Net to your projects

  • Access a SQLite database with SQLite.Net

  • Access a SQLite database using asynchronous methods
    After completing this module, students will be able to:

  • Identify data storage options.

  • Select a storage location.

  • Get the storage path for each platform.

  • Add a SQLite Portable Class Library to the project.

  • Define SQLite table schema using attributes.

  • Create and connect to a SQLite database.

  • Perform basic CRUD operations.

  • Refactor database connection to use SQLiteAsyncConnection.

  • Refactor table creation to use Async counterpart.

  • Refactor CRUD operations to use Async counterparts.
    Module 7: Toolbar and App Bar (AND180)
    In this module you will learn to create a Toolbar, populate it from an XML menu file, and respond to item-click events. You will also learn how to integrate a Toolbar into your Activity by setting it as the Activity's app bar.
    Lessons

  • Add a Toolbar to an Activity

  • Populate Toolbar Actions from an XML menu file

  • Use a Toolbar as an Activity's app bar

  • Set a navigation icon on an app bar
    Lab : Create and populate a Toolbar and set it as the Activity's AppBar

  • Add a Toolbar to an Activity.

  • Populate Toolbar Actions from an XML menu file.

  • Add a checkable submenu.

  • Use a Toolbar as an Activity’s app bar.

  • Set a navigation icon on an app bar.

After completing this module, students will be able to:

  • Add a ListView to a UI.
  • Use ArrayAdapter to populate a ListView.
  • Identify the limitations of ArrayAdapter.
  • Subscribe to the ListView.ItemClick event.
  • Determine which list items were clicked.
  • Inflate a layout file with LayoutInflater.
  • Code a custom Adapter.
  • Reuse inflated layouts to reduce memory usage.
  • Cache view references to increase performance.
  • Enable ListView fast scrolling.
  • Implement ISectionIndexer on a custom Adapter.

Module 8: Android Navigation (AND205)
This module teaches you how to code three common navigation patterns: tab, gestural, and drawer. It also includes guidelines to help you decide which pattern is appropriate for your app as well as teaches you to use fragments and FrameLayout.
Lessons

  • Use Fragment and FrameLayout to swap views

  • Implement tab navigation with TabLayout

  • Implement gestural navigation with ViewPager

  • Combine gestural and tab navigation

  • Implement drawer navigation with DrawerLayout
    Lab : Build three common navigation patterns in Xamarin.Android

  • Use Fragment and FrameLayout to swap views

  • Implement tab navigation with TabLayout

  • Implement gestural navigation with ViewPager

  • Combine gestural and tab navigation

  • Implement drawer navigation with DrawerLayout

After completing this module, students will be able to:

  • Add a Fragment to a FrameLayout dynamically.
  • Include a TabLayout in your UI.
  • Add tabs using code-behind.
  • Add tabs using XML.
  • Respond when a tab is tapped.
  • Add a ViewPager to the UI.
  • Code an adapter to supply the ViewPager with Fragments.
  • Use a ViewPager to populate a TabLayout with tabs.
  • Use DrawerLayout to display a drawer menu.
  • Use an app bar navigation button to open the drawer.
  • Code an XML file for a menu.
  • Swap content when a menu is clicked.

Module 9: Android Services (AND210)
This module teaches you to define a Service, use start/stop methods to explicitly control its lifecycle, and use bind/unbind methods to automatically destroy the instance when the last client has unbound.
Lessons

  • Handle list-item click events

  • Implement a custom adapter

  • Use layout recycling and the view-holder pattern
    Lab : Use an Adapter to populate a ListView and then customize it to boost efficiency

  • Populate a ListView using an ArrayAdapter

  • Handle list-item click events

  • Implement a custom adapter

  • Use layout recycling and the view-holder pattern

  • Enable fast scrolling and a code a section indexer

After completing this module, students will be able to:

  • Add a ListView to a UI.
  • Use ArrayAdapter to populate a ListView.
  • Identify the limitations of ArrayAdapter.
  • Subscribe to the ListView.ItemClick event.
  • Determine which list items was clicked.
  • Reuse inflated layouts to reduce memory usage.
  • Cache view references to increase performance.
  • Enable ListView fast scrolling.

Durata

  • 21 ore
  • 3 giorni

Prerequisiti

Before attending this course, students must have:

  • Basic C# knowledge with 6-12 months of .NET experience
  • Used an Android device and/or be familiar with the paradigms of the platform

Date a calendario

Anche on-site

Tutti i nostri corsi sono erogabili anche in modalità on-site, personalizzati secondo le esigenze.

Richiesta informazioni