Preview 6

This preview has a new shared runtime. To ensure you are using it, you will need to delete the old shared runtime from your emulator/device:

Settings -> Applications -> Manage Applications -> MonoDroid Runtime -> Uninstall

The new runtime will be deployed to the device the next time an application is deployed.

Warning: Samsung shipped a broken kernel with Android 2.1, which is not able to support JIT compilation. If you possess a Galaxy-class device with Android 2.1, you will get unexpected results, this is caused by a kernel bug that breaks cache coherency, rendering any engine doing JIT compilation useless.

Bug Fixes / Enhancements

Asset Support

Android "Assets" are now supported. Assets are basically any files you want to include and access in your application, like music, fonts, data, etc. Use these in your application in a way that is very similar to Android resources. The MonoDroid application template now creates a folder called Assets, which you can put subfolders and your data in. Set the build action on each data file to AndroidAsset.

You can then reference it in Android via the AssetManager or other Asset aware API:

InputStream input = Assets.Open ("read_asset.txt");  
var tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

Faster Redeploy

The Visual Studio plugin now detects whether your application has changed since the last time it was deployed. If it hasn't, it will re-launch the existing one rather than starting over.

Java Source Support

You can now provide additional Java source files to monodroid, e.g. to provide custom non-MonoDroid activities for splash screens.

Java source files are added to the build by setting their Build Action to AndroidJavaSource.

Native Library Support

You can now bundle additional native libraries into your .apk.

Native libraries are added to the build by setting their Build Action to AndroidNativeLibrary.

Note that since Android supports multiple Application Binary Interfaces (ABIs), monodroid must know which ABI the native library is built for. There are two ways this can be done:

  1. Path "sniffing"
  2. Using a //AndroidNativeLibrary/Abi element within the project file

With path sniffing, the parent directory name of the native library is used to specify the ABI that the library targets. Thus, if you add lib/armeabi/libfoo.so to the build, then the ABI will be "sniffed" as armeabi.

Alternatively, you can edit your project file to explicitly specify the ABI to use:

<ItemGroup>
<AndroidNativeLibrary Include="path/to/libfoo.so">  
<Abi>armeabi</Abi>  
</AndroidNativeLibrary>  
</ItemGroup>

Random Debugger Ports

The debugger now grabs available ports from the system and uses them, so you should no longer see "port in use" errors. If you have firewalls or complex network routing in place, you can still specify the ports to use in Tools->Options->MonoDroid.

Bug Fixes

  • 633465 - Timing problem in "Select Device" dialog
  • 633480 - Debug.Writelin adds question marks to ouput text
  • 640619 - Ability to use AssetManager to access files deployed with project
  • 645833 - Renaming layout file excludes it from aresgen
  • 648898 - Missing feature constants in Window class
  • 634817 - HttpWebRequest fails on HTTPS resources
  • 639679 - StartActivity() requiring intent to have FLAG_ACTIVITY_NEW_TASK and not assuming the caller's task affinity
  • 643202 - monodroid+javac error when inheriting from an Activity that comes from a Class Library
  • 644317 - monodroid should ignore @values when generating //activity/@android:label values
  • 645213 - Cannot build project that has no activities
  • 645255 - Inheriting from Java.Lang.Object and implementing interface in abstract class won't compile
  • 646224 - TabLayout demo doesn't work
  • 646263 - Back button Force Close - Unable to stop activity
  • 646797 - Application crashes when using Async webclient call
  • 648893 - EditText.Text.ToString() doesn't give you the contents of the text field
  • 648896 - KeyEventArgs.KeyCode should use Keycode enum instead of int
  • 640839 - PreferencesActivity crash
  • 645985 - monodroid needs to support -nf=path/to/native-libs and bundle additional native libs
  • 646424 - Multiple thread pool threads cause VM crash

 

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.