1) This document provides an overview of Xamarin and building Android apps. It discusses components like Xamarin.Mobile that allow writing code once across platforms.
2) It describes the anatomy of an Android app including activities, layouts, strings, styles, and the main application class.
3) The document demonstrates how to create custom views like a calendar and handle intents, fragments, lists, and drawing. It provides best practices for testing on devices due to emulator limitations.
5. Who Am i?
• My name is Ben Bishop (Twitter: @benjamminstl)
• I grew up in a small rural town of Indiana
• Went to Purdue University
• Now lives in Saint Louis
• Been independent for 4+ years
• Worked at an agency for 5 years, 1 year at TMG
7. WHAT IS A XAMARIN?
“The best damn mobile team,
building the best damn mobile platform.”
8. What is Mono?
•
Mono 1.0 was released on June 30, 2004
•
“The Mono runtime contains a code execution engine that
translates ECMA CIL byte codes into native code and supports a
number of processors: ARM, MIPS SPARC, PowerPC, S390 , x86,
x86-64 and IA-64 for 64-bit modes.”
•
Also has support for LLVM
•
Runs on Linux, OSX, Windows, PS3,
XBox 360, Wii
9. How does Mono Work?
“Xamarin compiles your
app to a native binary, not
cross-compiled, and not
interpreted.”
10. ART (Android RunTime) is an experimental runtime that
could replace Dalvik. ART uses Ahead of Time compilation
instead of JIT (like iOS)
11. Code Structure
By only having to write core code once, more time can be
spent tuning the UI per platform.
17. Android components
Google Play Services allows your app to interface with the
PlayStore. Android support helps make your Android app
backwards compatible.
23. Pro tip: need for speed
You can specify hardware acceleration for the app or for
specific activities.
http://developer.android.com/guide/topics/graphics/hardware-acce
36. layouts for orientations
By creating a directory “layout-land,” Activities will use this as
content when orientation changes.
http://docs.xamarin.com/guides/android/application_fundamentals
37. layouts for screen sizes
Relying on naming conventions you can specify layouts to be
used for screen widths. “layout-large” is for Android apps
below API-13, “layout-swXXXdp” is for 13 and above.
43. More value resource types
Bool
XML resource that carries a boolean value.
Color
XML resource that carries a color value.
Dimension
XML resource that carries a dimension value.
Integer
XML resource that carries an integer value.
Integer Array
XML resource that provides an array of integers.
Typed Array
XML resource that provides a TypedArray (which you can use for
an array of drawables).
46. Units of measure
px
Pixels - corresponds to actual pixels on the screen.
in
Inches - based on the physical size of the screen.
mm
Millimeters - based on the physical size of the screen.
pt
Points - 1/72 of an inch based on the physical size of the screen.
dp
Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are
relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the
screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp"
is more consistent with "sp".
sp
Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is
recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and
user's preference.
81. experiences
- The Android SDK is substantially more robust
(complicated?) than iOS
- Device fragmentation is challenging (TestCloud)
- Emulators suck. Use a device instead.
- Not as prescriptive in UX/Design
- The more innovative (but not as polished)
platform.