Xamarin.Android 4.7

The Xamarin.Android 4.7 series contains the upgrade of the Mono runtime engine to the Mono 3.0 system, and includes advanced features like C# and async programming.

First-class support for asynchronicity is a powerful and brilliantly simple language tool.

It makes it easy to write responsive user interfaces, which in turn makes for delighted users It makes complex workflows, with their error handling, natural to write. This translates into proper error messages and proper program recovery; and finally By letting the compiler do the work for you, it eliminates bugs from your code, and enables you to enjoy your work and to focus on what really matters for your application. This is best seen by watching it in action. See how this piece of old C# code turns into a piece of beauty. Error handling and dealing with the UI thread go from painful to trivial. To learn more about how to use async start from this article.

While asynchronicity is the main theme of this release, we also pack two years of improvements to the Mono runtime spread over more than 7,000 individual commits that are now available to Android, Mac and iOS users.

Among the new features:

  • New .NET 4.5 APIs
  • iOS generic compiler improvements, fewer "Attempting to JIT compile method” errors.
  • Async-friendly System.Net.Http
  • Improved debugging stack
  • Variant and contravariant interfaces

New .NET 4.5 APIs: We’re bringing in a huge refresh to the class libraries. Our current products have historically been an extension of the Silverlight API. Now our class libraries are based on the .NET 4.5 profile.

New System.Net.Http: This is such a delightful async API that it deserves to be called out on its own. This is an async-friendly HTTP stack, and makes building clients apps trivial We now ship System.Net.Http, a new, async ready, HTTP stack that have been designed from the bottom up to work well with the new version of the language.

Debugging Upgrades: Our debugger has received a lots of small improvements and fixes, they add up and you will notice how all the small details now work more smoothly than before.

Variance and Contravariance: With the upgrade to our class libraries, we have introduced support for variance and contravariance in the core types. While this change enables a whole class of new code to be written, it also means that some old code that was not covariant/contravariance friendly will have to be adjusted.

Xamarin.Android 4.7.0

First release of the Mono 3.0-based stack.

The product is now based on mono 3.0. This includes C# 5 with async, two years of improvements in the runtime and class libs.

The class libs are now based on top of .NET 4.5 bringing in a lot of improvements. Some core generic interfaces are now using covariance.

Xamarin.Android 4.7.1

Improve performance of some string copying, object cloning and boxing.

Fixed some culture related bugs.

Xamarin.Android 4.7.2

Optimized LINQ with arrays.

Sgen can now return memory to the OS on 32bits systems.

System.Net.Http.dll is now been shipped.

Xamarin.Android 4.7.3

Our classlib is now built with /optimize+, this saves up to 1Mb compared to the previous alpha release.

Fixed a few bugs in the C# compiler regarding async.

Multiple fixes to the AOT compiler involving generics and async.

Reduced the number of thread roundtrips that HttpClientHandler does in some cases.

Optimized Marshal code that read/write from native memory.

Fixed multiple bugs in culture handling and date parsing.

Xamarin.Android 4.7.4

Windows builds are back

Improved diagnostics on deployment failures

Multiple linker issues fixed when building from inside Xamarin Studio

Faster KillProcess behavior

Xamarin.Android 4.7.5

New Features

  • Starter edition size limit bumped to 64KB.
  • F# support
  • Generated binding files now get Metadata.xml XPath info.
  • C#5 Async overloads
  • Give meaningful message for missing //attr/@name attribute in Metadata.xml
  • Inclusion of Xamarin.Android.NUnitLite.dll and ability to write NUnit-based projects within Xamarin Studio 4.0.8+.
  • Android SDK r22 support
  • Add Java.Interop.ObjectManager.GetSurfacedObjects_ForDiagnosticsOnly()
  • Initial work on bringing async to the Android Framework, some types already have async overloads
  • Runtime now is built with proper hardware floating point on armv7 (managed code would already use it correctly)

Integrated Mono features/fixes

Based on Mono 3.0.11.
  • Add System.Diagnostics.Switch/etc.
  • 327: if sqlite3_column_origin_name is not found, omit the metadata, instead of exploding
  • 4595: Clear entries referencing the domain in reference_queue_clear_for_domain () even if the object is already null
  • 5598: Fix memleak by using a LruCache
  • 10392: Don't try to merge interfaces between to non-interface types.
  • 11294: Fix incompatibility with .NET's serialization of ObservableCollection
  • 11362: Fail with an exception when loading the value of field of a broken class.
  • 11694: Check interface implementation using all base types members.
  • 11739: Fix quoted values parsing for custom tostring formats.
  • 11796: Don't check public token on missing references.
  • 11862: Fix the map of bool and char in runtime invoke signatures.
  • 11867: Don't catch aggregate exception handle predicate exceptions.
  • 11880: Ignore requests to set breakpoints at il offsets belonging to dead code.
  • 11908: Task.Yield needs to continue on synchronization context if there is any.
  • 11979: StreamWriter async methods cannot call base TextWriter async methods.
  • 12001: Fix TraceSource constructor.
  • 12008: Don't throw when trying to parse leading sign number only.

Bug fixes

  • Use Encoding.Default for javac response files.
  • More sanely select a working directory for mandroid execution.
  • Fix license activation problem which occurs when both Xamarin.Android and Xamarin.iOS licenses are checked at the same time.
  • Fixed method lookup to avoid duplicate method bindings
  • Cecil is now vendorized. This fixes conflicts & bugs in between VS, XS and xbuild.
  • Fixed a GC interop regression when you build a linked list out of user peers.
  • Fixed Typos in 'Publish Android Application' dialog
  • Better handle system with unavailable devices (VMs with a floppy drive)
  • 5037: Copy Satellite assemblies into obj/Release/assemblies.
  • 8209: Generate .mdb files for libraries that only have .pdb
  • 10693: Disable serialization assembly generation.
  • 11401: Fastdev directory creation fails on API-12 devices.
  • 11471: annotations need to be generated as interface, not class
  • 11529: 'Publish Android Application' dialog window has multiple typos.
  • 11608: move <activity-alias> elements directly after their target activities
  • 11694: Reject project.properties file which is placed on an ancestor of obj/*.
  • 11740: MSBuild error being thrown on release builds.
  • 11744: When user add image to resources folder it displayed Build Action to Content.
  • 11782: Fixed nested class names in nested interfaces.
  • 11783: jcifs: binding generator tools miss some methods that involves derivation in different jars
  • 11803: User is not able to deploy the application on the emulator/device, the app is closed immediately after launching.
  • 11918: Trial users don't get Fast Deployment support.
  • 11921: AndroidGameView lockups up when Stop is called
  • 11921: Fixed an AndroidGameView lockup when Stop is called.
  • 11964: MapsAndLocationDemo_v2 example causes recursive path build issue.
  • 12007: float values are being corrupted/lost when inserted into a Queue<float>.
  • 12112: GC STW fix.
  • 12243: ScanAssemblies build task counts referenced assembly twice.
  • 12250: Invalid folders in setup.msi

Xamarin.Android 4.7.6

New Features

  • Bind the java.lang.Void type.
  • Bind the java.text package.

Integrated Mono features/fixes

Based on Mono 3.0.12.

  • Improved PCL support.
  • 5904, 12355, 12395: Fix incorrect end-of-stream with null callback.
  • 11703: Mono.Security.X509Certificate.Hash does not support SHA2 digest algorithms, makes such certificates unusable with XSP.
  • 12329: Using CountAsync on device with Parse 1.2.4 library crashes with JIT issue.
  • 12342: NullReferenceException in IAsyncResult.AsyncWaitHandle.WaitOne.
  • 12349: HttpClient.GetStringAsync throws NullReferenceException on concurrent requests.

Bug fixes

  • Fix detection of aapt.exe on Windows. (Windows should build and install now!)
  • 360: Generate property setters for array fields.
  • 11051: Provide non-exceptional error messages for ACW generation.
  • 11950: Properly handle null array fields.
  • 12370: Fix detection of dx on Windows.
  • 12432: Fix slow builds due to touching res\values\styles.xml.

Xamarin.Android 4.7.7

New Features

  • Updated Mono.Android.Support.v4.dll and Mono.Android.Support.v13.dll to bind the Android Support Library, revision 13.
  • The Mono runtime is now built with the Android NDK, revision 8e

Integrated Mono features/fixes

Based on Mono 3.0.12.

  • 12494: Keep the exception object alive during debugger suspensions.

Bug fixes

  • Fix installation of the Visual Studio add-on when Visual Studio is installed into a non-default location.
  • 8369: BindingsGenerator couldn't not handle ApiXmlInput containing empty spaces.
  • 10580: Always preserve Mono.Runtime.
  • 10771: MakeBundleNativeCodeExternal task is broken
  • 11797: Starter edition should support Android Library projects which use Android Resources.
  • 12479: Fix lref leak in JNIEnv.NewArray(Array, Type).

Xamarin.Android 4.7.8

New Features

  • Within Android Java Library Binding projects, C# custom attributes can now be inserted into the generated code by adding a customAttributes attribute:
    <attr
            path="/api/package[@name='mono.android.app']/class[@name='IntentService']/constructor[count(parameter) = 0]"
            name="customAttributes">
        [Preserve(Conditional = true)]
    </attr>

Integrated Mono features/fixes

Based on Mono 3.0.12.

  • 12461: Make sure the behavior between GetFiles and EnumerateFiles are the same regarding symlinks.

Bug fixes

  • 8428, Linker needs to preserve IntentService default constructor.
  • 12269, 12381, 12428, 12520: Fix Aes.Create().
  • 10135, Generate XA4207 when a C# generic class (indirectly) subclasses Java.Lang.Object and uses [Export] or [ExportField].

Xamarin.Android 4.7.9

This release serves to bring compatibility to those who use both Xamarin.iOS and Xamarin.Android in Visual Studio. This release is compatible with Xamarin.iOS for Visual Studio 1.2.

Xamarin.Android 4.7.10

New Features

  • PCL support!
    (Cross your fingers, sacrifice your favorite meal under the full moon, and your PCL projects should Just Work! Testing wanted.)
  • Binding projects support Android .aar files. Use a Build action of LibraryProjectZip.
  • Accessing the e.g. TextView.Text property getter should now dispose of the intermediate GREF.
  • Rename Java.Interop.ObjectManager to Java.Interop.Runtime.
  • Add Java.Interop.Runtime.MaxGlobalReferenceCount Java.Interop.Runtime.GlobalReferenceCount Java.Interop.Runtime.LocalReferenceCount properties. These are for diagnostic purposes and should not be relied upon.
  • $(AndroidUseLatestPlatformSdk): new MSBuild property; if True, cause the build process to use the latest (highest numbered) Android Platform SDK. [Infrastructure]

Integrated Mono features/fixes

Based on Mono 3.0.12.

  • OS X 10.9 support.
  • Fix race condition in System.Net.WebConnectionStream.
  • Fix new BigInteger().GetHashCode() to not throw.
  • Fix delegate combine when left side has already been invoked.
  • 10887: Handle shifts by multiple of 32 correctly.
  • 11945: Better handle default value BigInteger.

Bug fixes

  • Fix preservation of AesCryptoServiceProvider.
  • Add [Flags] to various enumerations.
  • Generate XA42303 for [Activity(Name=".Foo")].
  • 5980: Marshal non-Java.Lang.Object types as java.lang.Object.
  • 7774: Date property for DatePicker
  • 8353: Add UI for $(JavaHeapSize), $(JavaOptions).
  • 9800: Fix .axml IntelliSense within Visual Studio.
  • 10153, 10978: Add ability to set minimum Android SDK.
  • 10865: Re-enable the "Bundle assemblies into native code" checkbox.
  • 11170#c3: Fail more gracefully with invalid resource files.
  • 12254: Fix event de-registration involving Add and Remove methods.
  • 12594: Fix the "Build failure, register the machine, build failure" loop.

Xamarin.Android 4.7.11

Integrated Mono features/fixes

Based on Mono 3.0.12.

  • Implement System.Net.Http.WebRequestHandler.
  • 12457: X509Certificate2 is not marked as Serializable.
  • 12609: Runtime assert condition `mono_defaults.iunknown_class != 0' not met.
  • 12856: Fix MethodInfo::ToString() to properly format generic structs

Bug fixes

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.