Showing posts with label xamarin. Show all posts
Showing posts with label xamarin. Show all posts

Tuesday, June 21, 2016

Xamarin Studio + Android Studio

If you have a Xamarin Studio project for an Android application, you'll probably want to use Android Studio to edit the resource files.
  • Create a new Android Studio project (I usually call it AndroidStudioHolder, but the name is unimportant)
  • cd AndroidStudioHolder/app/src/main
  • rm -rf res
  • ln -s ../../../../YourAndroidProject/Resources res
Unfortunately, you still have to deal with all the weird naming issues that Xamarin Studio creates.  You should fix them anyway, and it's easier to do it early in the project.  (Main.axml isn't a real layout file, for example, even though Xamarin Studio will create it for you by default.)

Thursday, May 26, 2016

Using F# modules and types from C#

It's simple to use FSharp modules from C#, but for some reason I always forget exactly how the system works
(maybe too much switching back and forth between Scala/C#/F#/Java...).

Here's some F# snippets and a C# example of how to pull them together. The weird one is C#'s "using static", since the name seems to indicate that it's just pulling in static methods. In addition to pulling in static methods, though, it also pulls in nested types.







Consuming from F# is slightly simpler:



Here's the F# specification for more details.

Wednesday, April 22, 2015

Xamarin Studio 5.9 + F# - Target _CreateNativeLibraryArchive failing

If you're seeing an error like this in Xamarin Studio 5.9, building an Android project:

Target _CreateNativeLibraryArchive:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
error : Error executing task CreateNativeLibraryArchive: Argument cannot be
null.
Parameter name: unformatted
Build FAILED.


You may have mips binary files marked as EmbeddedNativeLibrary.  Turn that off (mips isn't supported yet anyway), and you should be able to build.

The bug has been reported to Xamarin - tech support found the solution.