Learn how to build your first app with Xamarin.Android. Discover how to code the UI, create activities, and program behaviors.
In this video we will discuss some conceptual topics that will get you acquainted with developing for Android using Xamarin. Xamarin Android apps are built using the Xamarin tools and libraries. The UI is created from Xamarin's wrappers around the native Android views so the app has the look and feel users expect. The behavior logic is written in C sharp witch is comfortable and familiar to the community of dot net developers. Xamarin Android apps are coded in C sharp and built with Visual Studio on the PC or Visual Studio on the Mac.
Xamarin Android supports the latest C sharp features including but not limited to generics, a sync await, link and lamgood expressions. C sharp support stays up to date with the latest versions of the language. You do have a choice of either C sharp or F sharp as your development language. In this course we will focus on C sharp. The Xamarin Android bindings to Android libraries provide a familiar programming experience for C sharp developers, you do not have to code using Java idioms despite the fact that there is a Java API underlying Xamarin C sharp wrappers.
For example, Java uses get set methods like get text and set text, most Xamarin C sharp wrappers will translate this into a text property. Native android apps have access to a Java library and an Android specific library. The Java packages are utility classes including data structures, string manipulation, networking, and others. The Android packages provide Android specific functionality. Such as access to the on device file system, access to the device's radios, gps, phone dialer, etc.
Xamarin Android apps also have access to the Mono.NET libraries, the number of provided types is quite large. Xamarin calls it an extended subset of the standard desktop.NET library. Xamarin provides C sharp wrappers for the Java and Android packages, when a new version of Android libraries is released the Xamarin C sharp wrappers are available almost immediately. You can incorporate existing Java jar files into your Xamarin Android app. There are two ways to do this. The Java Native Interface, JNI, or the Java Bindings Library, neither technique is simple but they both get the job done.
The decision between the two techniques is generally personal preference, if you use JNI your code will look verbose like you are using reflection style API. A Bindings Library yields nicer client code but takes more ahead of time preparation.
This course was created by Xamarin University. We are honored to host this training in our library.