Top Banner
31

Building Your First Android App with Xamarin

Apr 06, 2017

Download

Software

Xamarin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Your First Android App with Xamarin
Page 2: Building Your First Android App with Xamarin

university.xamarin.com

Page 3: Building Your First Android App with Xamarin

Microsoft: Your Complete Mobile Solution

Page 4: Building Your First Android App with Xamarin

Deploy to emulator

and device

Page 5: Building Your First Android App with Xamarin

iOS

Xamarin’s unique approach

Shared C# codebase • 100% native API access • High performance

Windows C# UI

Page 6: Building Your First Android App with Xamarin

What is Xamarin.Android?

C# source Native execution

Page 7: Building Your First Android App with Xamarin

Mono and ART VMs run side-by-side to execute a Xamarin.Android app

Xamarin.Android execution

Android

Runtime (ART)

Mono

Runtime

Linux Kernel

android.*

libraries

java.*

libraries

.NET

libraries

Your

IL code

Page 8: Building Your First Android App with Xamarin

Xamarin.Android – 100% API coverage

Text-to-speech Toolbar Printing Framework Renderscript NFC

System.Data System.Collections System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

C#

Page 9: Building Your First Android App with Xamarin

Always up-to-date

Full support for all Android versions

Page 10: Building Your First Android App with Xamarin

Xamarin Platform support

Broad support for Android devices, including

phones, tablets, Android Wear and Amazon Fire TV

Page 11: Building Your First Android App with Xamarin

Open Source – open.xamarin.com

Page 12: Building Your First Android App with Xamarin
Page 13: Building Your First Android App with Xamarin

Develop on Mac or Windows

Microsoft Visual Studio

on Windows

Visual Studio for Mac

on macOS (preview)

Page 14: Building Your First Android App with Xamarin

Development workflow

Page 15: Building Your First Android App with Xamarin

Activities: a collection of collaborating parts that

comprise Android apps

App structure

Activity 1

UI

Code

Activity 2

UI

Code

Activity 3

UI

Code

Data files,

images, etc.

MyApp

Page 16: Building Your First Android App with Xamarin

Activity definition

<LinearLayout ... ><TextView ... ><EditText ... ><Button ... ><TextView ... >

</LinearLayout>

Pi.axml

[Activity]public class PiActivity : Activity{...SetContentView(Resource.Layout.Pi);

}

PiActivity.cs

An XML layout file

that defines the UI

The related C# class

provides the behavior

Page 17: Building Your First Android App with Xamarin
Page 18: Building Your First Android App with Xamarin
Page 19: Building Your First Android App with Xamarin

Integrating .NET Libraries

You can integrate

your shared

business logic

packaged as a PCL

Page 20: Building Your First Android App with Xamarin

You can use JNI or a Bindings Library to incorporate Java libraries into your

Xamarin.Android app

Integrating Java Libraries

PayPal TritonPlayerArcGIS ...

Mapping Finance Music

Page 21: Building Your First Android App with Xamarin

Set the ID of a View in XML using the id attribute and the syntax @+id/

Access UI from code

<EditText android:id="@+id/digitsInput" ... />Set an id

in the XMLprotected override void OnCreate(Bundle bundle){

base.OnCreate(bundle);SetContentView(Resource.Layout.Pi);

var et = FindViewById<EditText>(Resource.Id.digitsInput);et.TextChanged += OnTextChanged;

}

Lookup

in code

Page 22: Building Your First Android App with Xamarin
Page 23: Building Your First Android App with Xamarin
Page 24: Building Your First Android App with Xamarin

Xamarin.Android UI is

built from Google’s

controls and layout

panels, wrapped in C#

by Xamarin

Android UI

Page 25: Building Your First Android App with Xamarin

Get fully native look and

feel with native controls

Native UX

Page 26: Building Your First Android App with Xamarin

Visual Studio provides

a UI Designer on

Windows and macOS

UI Designer

Page 27: Building Your First Android App with Xamarin
Page 28: Building Your First Android App with Xamarin

Get Started Todayxamarin.com/download

Page 29: Building Your First Android App with Xamarin

Free self-guided courses

Page 30: Building Your First Android App with Xamarin

Thank you

@flyinggeekette

[email protected]

Page 31: Building Your First Android App with Xamarin

Q&A

Samples available at:

https://aka.ms/raz619