Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Xamarin.Android-Tests.sln
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Performance-Tests", "Perfor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "timing", "build-tools\timing\timing.csproj", "{37CAA28C-40BE-4253-BA68-CC5D7316A617}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.DefaultInterfaceMethods-Tests", "tests\CodeGen-Binding\Xamarin.Android.DefaultInterfaceMethods-Tests\Xamarin.Android.DefaultInterfaceMethods-Tests.csproj", "{80E5171A-56DF-48AC-8AD9-65028319C1B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.DefaultInterfaceMethods-Lib", "tests\CodeGen-Binding\Xamarin.Android.DefaultInterfaceMethods-Lib\Xamarin.Android.DefaultInterfaceMethods-Lib.csproj", "{E2F0F78B-6088-4282-A49C-122EE28611FF}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tests\Xamarin.Forms-Performance-Integration\Xamarin.Forms.Performance.Integration.projitems*{195be9c2-1f91-40dc-bd6d-de860bf083fb}*SharedItemsImports = 13
Expand Down Expand Up @@ -194,6 +198,14 @@ Global
{37CAA28C-40BE-4253-BA68-CC5D7316A617}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37CAA28C-40BE-4253-BA68-CC5D7316A617}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37CAA28C-40BE-4253-BA68-CC5D7316A617}.Release|Any CPU.Build.0 = Release|Any CPU
{80E5171A-56DF-48AC-8AD9-65028319C1B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80E5171A-56DF-48AC-8AD9-65028319C1B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80E5171A-56DF-48AC-8AD9-65028319C1B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80E5171A-56DF-48AC-8AD9-65028319C1B8}.Release|Any CPU.Build.0 = Release|Any CPU
{E2F0F78B-6088-4282-A49C-122EE28611FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2F0F78B-6088-4282-A49C-122EE28611FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2F0F78B-6088-4282-A49C-122EE28611FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2F0F78B-6088-4282-A49C-122EE28611FF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -225,6 +237,8 @@ Global
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{2DD1EE75-6D8D-4653-A800-0A24367F7F38} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{37CAA28C-40BE-4253-BA68-CC5D7316A617} = {68B8E272-5B12-47AA-8923-550B9CE535C7}
{80E5171A-56DF-48AC-8AD9-65028319C1B8} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
{E2F0F78B-6088-4282-A49C-122EE28611FF} = {2EFFECF5-1CCA-4005-AE62-1D6F01C88DF4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8643CD20-B195-4919-8135-27549488237E}
Expand Down
1 change: 0 additions & 1 deletion build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ STABLE_FRAMEWORKS = $(foreach a, $(STABLE_API_LEVELS), $(word $(a),$(ALL_FRAMEWO
PLATFORM_IDS = $(foreach a, $(API_LEVELS), $(word $(a),$(ALL_PLATFORM_IDS)))

ALL_JIT_ABIS = \
armeabi \
armeabi-v7a \
arm64-v8a \
x86 \
Expand Down
2 changes: 1 addition & 1 deletion external/Java.Interop
3 changes: 1 addition & 2 deletions src/Mono.Android/Java.Util/Spliterators.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#if ANDROID_24
#if false//ANDROID_24
using System;
using Android.Runtime;
using Java.Interop;
using Java.Util.Functions;

namespace Java.Util
{
// FIXME: this should not be required to be hand-bound.
public partial class Spliterators
{
public partial class AbstractSpliterator
Expand Down
7 changes: 6 additions & 1 deletion src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<UsingTask AssemblyFile="..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.ReplaceFileContents" />
<Import Project="..\..\build-tools\scripts\XAVersionInfo.targets" />
<Import Project="Mono.Android.projitems" />
<PropertyGroup>
<CscToolPath>..\..\packages\xamarin.android.csc.dim.0.1.2\tools\</CscToolPath>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(IntermediateOutputPath)AssemblyInfo.cs" />
</ItemGroup>
Expand Down Expand Up @@ -78,6 +82,7 @@
<PropertyGroup>
<Generator>"$(XAInstallPrefix)xbuild\Xamarin\Android\generator.exe"</Generator>
<_GenFlags>--public --product-version=7</_GenFlags>
<_DefaultInterfaceMethods>--default-interface-methods</_DefaultInterfaceMethods>
<_ApiLevel>--api-level=$(AndroidApiLevel)</_ApiLevel>
<_Out>-o "$(IntermediateOutputPath)mcw"</_Out>
<_Codegen>--codegen-target=XAJavaInterop1</_Codegen>
Expand All @@ -92,7 +97,7 @@
<_Dirs>--enumdir=$(IntermediateOutputPath)mcw</_Dirs>
</PropertyGroup>
<Exec
Command="$(ManagedRuntime) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) $(_Codegen) $(_Fixup) $(_Enums1) $(_Enums2) $(_Versions) $(_Annotations) $(_Assembly) $(_TypeMap) $(_Dirs) $(_Api)"
Command="$(ManagedRuntime) $(Generator) $(_GenFlags) $(_ApiLevel) $(_Out) $(_Codegen) $(_DefaultInterfaceMethods) $(_Fixup) $(_Enums1) $(_Enums2) $(_Versions) $(_Annotations) $(_Assembly) $(_TypeMap) $(_Dirs) $(_Api)"
/>
<ItemGroup>
<Compile Include="$(IntermediateOutputPath)mcw\**\*.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/Mono.Android/Test/Mono.Android-Tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<AndroidNativeLibrary Include="libs\arm64-v8a\libreuse-threads.so" />
<AndroidNativeLibrary Include="libs\armeabi\libreuse-threads.so" />
<AndroidNativeLibrary Include="libs\armeabi-v7a\libreuse-threads.so" />
<AndroidNativeLibrary Include="libs\x86\libreuse-threads.so" />
<AndroidNativeLibrary Include="libs\x86_64\libreuse-threads.so" />
Expand Down
2 changes: 1 addition & 1 deletion src/Mono.Android/Test/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Build both ARMv5TE and ARMv7-A machine code.
APP_ABI := arm64-v8a armeabi armeabi-v7a x86 x86_64
APP_ABI := arm64-v8a armeabi-v7a x86 x86_64
29 changes: 29 additions & 0 deletions src/Mono.Android/metadata
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,12 @@
-->
<attr path="/api/package[@name='java.util']/class[starts-with (@name, 'Spliterators.Abstract')]/method[@name='trySplit']" name="managedReturn">Java.Util.ISpliterator</attr>

<!-- FIXME: they had better be remapped to managedReturn of Spliterator(without .OfXYZ). So far there is BaseStream#spliterator() and removing them is harmless. -->
<remove-node path="/api/package[@name='java.util.stream']/interface[@name='DoubleStream']/method[@name='spliterator']" />
<remove-node path="/api/package[@name='java.util.stream']/interface[@name='IntStream']/method[@name='spliterator']" />
<remove-node path="/api/package[@name='java.util.stream']/interface[@name='LongStream']/method[@name='spliterator']" />


<attr path="/api/package[@name='android.service.quicksettings']" name="managedName">Android.Service.QuickSettings</attr>

<!-- android.media.AudioRouting.OnRoutingChangedListener is a new
Expand Down Expand Up @@ -1389,6 +1395,10 @@
-->
<attr path="/api/package[@name='android.graphics']/class[@name='Color']" name="managedName">ColorObject</attr>

<!-- new addition to API 26 fixup due to DIM support -->
<attr path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationStart' and count(parameter)=2]" name="managedName">AnimationStart2</attr>
<attr path="/api/package[@name='android.animation']/interface[@name='Animator.AnimatorListener']/method[@name='onAnimationEnd' and count(parameter)=2]" name="managedName">AnimationEnd2</attr>

<!-- API Level 27 -->

<!-- detected field-property conflicts (e.g. see bug #60069)
Expand All @@ -1409,4 +1419,23 @@
<remove-node path="/api/package[@name='android.text']/class[@name='PrecomputedText']" />
<attr path="/api/package[@name='android.provider']/class[@name='Telephony.CarrierId']/field[@name='CARRIER_ID']" name="managedName">CarrierIdField</attr>

<!-- FIXME: for now generator cannot "unmark" final DIM methods as *non*-sealed C# DIM methods.
Attempt to unmark them result in various ABI breakage, which needs non-trivial fixes.
So far this is the only one in android.jar, hopefully there aren't many.
-->
<attr path="/api/package[@name='java.util']/class[@name='PriorityQueue']/method[@name='spliterator']" name="final">false</attr>

<!--
This should not really be required. However current generator has
limitation that it has to generate such methods in its {implementing
interfaces} that contains {{any parameter or a return value} that is
of generic type} as explicitly implemented,
regardless of whether the method contains generic parameters or not.

This kind of problem can be workarounded by removing generic arguments from the parameters and the return type.

Spliterator itself is not suffered from that, but Spliterators.AbstractSpliterator is.
-->
<attr path="/api/package[@name='java.util']/interface[@name='Spliterator']/method[@name='tryAdvance']/parameter[1]" name="type">java.util.function.Consumer</attr>

</metadata>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Mono.Cecil;

Expand Down Expand Up @@ -163,7 +164,7 @@ bool FixAbstractMethods (TypeDefinition type)
if (ifaceDef.HasGenericParameters)
continue;

foreach (var iMethod in ifaceDef.Methods) {
foreach (var iMethod in ifaceDef.Methods.Where (m => m.IsAbstract)) {
bool exists = false;

foreach (var tMethod in typeMethods) {
Expand Down
5 changes: 5 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class BindingsGenerator : AndroidToolTask

public bool UseShortFileNames { get; set; }

public bool EnableDefaultInterfaceMethods { get; set; }

// apart from ReferencedManagedLibraries we need it to find mscorlib.dll.
[Required]
public string MonoAndroidFrameworkDirectories { get; set; }
Expand All @@ -64,6 +66,7 @@ public override bool Execute ()
Log.LogDebugMessage (" AssemblyName: {0}", AssemblyName);
Log.LogDebugMessage (" AndroidApiLevel: {0}", AndroidApiLevel);
Log.LogDebugMessage (" UseShortFileNames: {0}", UseShortFileNames);
Log.LogDebugMessage (" EnableDefaultInterfaceMethods: {0}", EnableDefaultInterfaceMethods);
Log.LogDebugTaskItems (" TransformFiles:", TransformFiles);
Log.LogDebugTaskItems (" ReferencedManagedLibraries:", ReferencedManagedLibraries);
Log.LogDebugTaskItems (" AnnotationsZipFiles:", AnnotationsZipFiles);
Expand Down Expand Up @@ -119,6 +122,8 @@ protected override string GenerateCommandLineCommands ()
cmd.AppendSwitchIfNotNull ("--enumdir=", EnumDirectory);
cmd.AppendSwitchIfNotNull ("--enummetadata=", EnumMetadataDirectory);
cmd.AppendSwitchIfNotNull ("--assembly=", AssemblyName);
if (EnableDefaultInterfaceMethods)
cmd.AppendSwitch ("--default-interface-methods");

if (!NoStdlib) {
string fxpath = MonoAndroidFrameworkDirectories.Split (';').First (p => new DirectoryInfo (p).GetFiles ("mscorlib.dll").Any ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,5 +446,59 @@ public String greet (String name, java.util.Date date)
Assert.IsTrue (xml.Contains ("<param name=\"name\"> - name to display.</param>"), "missing doc");
}
}

[Test]
[TestCaseSource ("ClassParseOptions")]
public void BindDefaultInterfaceMethods (string classParser)
{
var proj = new XamarinAndroidBindingProject () {
IsRelease = true,
};
proj.Packages.Add (new Package { Id = "xamarin.android.csc.dim", Version = "0.1.2" });
// The sources for the .jar is in the jar itself.
string classesJarBase64 = @"
UEsDBBQACAgIANWk6UwAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAAMAUEsHCAAAAAACAAAAAAA
AAFBLAwQUAAgICADVpOlMAAAAAAAAAAAAAAAAFAAAAE1FVEEtSU5GL01BTklGRVNULk1G803My0xLLS
7RDUstKs7Mz7NSMNQz4OVyLkpNLElN0XWqBAlY6BnEG5obKmj4FyUm56QqOOcXFeQXJZYA1WvycvFyA
QBQSwcIFGFrLUQAAABFAAAAUEsDBAoAAAgAAK2k6UwAAAAAAAAAAAAAAAAEAAAAY29tL1BLAwQKAAAI
AACtpOlMAAAAAAAAAAAAAAAADAAAAGNvbS94YW1hcmluL1BLAwQKAAAIAACwpOlMAAAAAAAAAAAAAAA
AEQAAAGNvbS94YW1hcmluL3Rlc3QvUEsDBBQACAgIAJmk6UwAAAAAAAAAAAAAAAAuAAAAY29tL3hhbW
FyaW4vdGVzdC9EZWZhdWx0SW50ZXJmYWNlTWV0aG9kcy5jbGFzc3WOvU7DMBSFjxsnKeWnXUE8QLrgh
ScAhBSJnwHE7qQ3JVUSC8dGFc/EwsrAA/BQiOuqLKnw8Pn4+LuWv38+vwCcY5biKMVUIKqMYWbzXEBe
mgUJTG/qju58W5B91EXDTbIkd6HtX3jj0G+DzPL5E28v3q8FJg/G25Ku6zB1ekWV9o3LO0e20iXdkns
2i/5spV+1QFaaVq11q23dKUe9U//4ArMwoRrdLdV9saLSJQICI4QVc4ogmTGfThBugFH0zuR/MpNNE7
x015NDL3C868VDL2XuYbL1joMTjI+BNpYC+/xcaA820uEvUEsHCIw1aijpAAAAhQEAAFBLAwQUAAgIC
ACYpOlMAAAAAAAAAAAAAAAAHAAAAERlZmF1bHRJbnRlcmZhY2VNZXRob2RzLmphdmF1zLEOwiAQBuCd
p7hRl0Zd2YyLgw9xwlGJFCocTWPTdxdSHarxxv///utR3bElUKFrRuwwWt8wJZZC9PnqrALrmaJBRXA
ig9nx+RNciG9BJzEJKKeXtnowIcBmCxNE4hw97CTMP6glPmJcuf1f91y5w7cbgtWQ3rCOBnSZymJhNX
nkPJYnUsziBVBLBwgzfz2miQAAAPUAAABQSwECFAAUAAgICADVpOlMAAAAAAIAAAAAAAAACQAEAAAAA
AAAAAAAAAAAAAAATUVUQS1JTkYv/soAAFBLAQIUABQACAgIANWk6UwUYWstRAAAAEUAAAAUAAAAAAAA
AAAAAAAAAD0AAABNRVRBLUlORi9NQU5JRkVTVC5NRlBLAQIKAAoAAAgAAK2k6UwAAAAAAAAAAAAAAAA
EAAAAAAAAAAAAAAAAAMMAAABjb20vUEsBAgoACgAACAAAraTpTAAAAAAAAAAAAAAAAAwAAAAAAAAAAA
AAAAAA5QAAAGNvbS94YW1hcmluL1BLAQIKAAoAAAgAALCk6UwAAAAAAAAAAAAAAAARAAAAAAAAAAAAA
AAAAA8BAABjb20veGFtYXJpbi90ZXN0L1BLAQIUABQACAgIAJmk6UyMNWoo6QAAAIUBAAAuAAAAAAAA
AAAAAAAAAD4BAABjb20veGFtYXJpbi90ZXN0L0RlZmF1bHRJbnRlcmZhY2VNZXRob2RzLmNsYXNzUEs
BAhQAFAAICAgAmKTpTDN/PaaJAAAA9QAAABwAAAAAAAAAAAAAAAAAgwIAAERlZmF1bHRJbnRlcmZhY2
VNZXRob2RzLmphdmFQSwUGAAAAAAcABwDOAQAAVgMAAAAA
";
proj.Jars.Add (new AndroidItem.EmbeddedJar ("dim.jar") {
BinaryContent = () => Convert.FromBase64String (classesJarBase64)
});
proj.AndroidClassParser = classParser;
proj.SetProperty ("CscToolPath", "$(MSBuildThisFileDirectory)\\..\\packages\\xamarin.android.csc.dim.0.1.2\\tools");
proj.SetProperty ("AndroidEnableDefaultInterfaceMethods", "True");
proj.SetProperty ("LangVersion", "latest");
using (var b = CreateDllBuilder (Path.Combine ("temp", TestName), false, false)) {
proj.NuGetRestore (b.ProjectDirectory);
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
string asmpath = Path.GetFullPath (Path.Combine (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), b.ProjectDirectory, b.Output.OutputPath, (proj.AssemblyName ?? proj.ProjectName) + ".dll"));
Assert.IsTrue (File.Exists (asmpath), "assembly does not exist");
var cs = b.Output.GetIntermediaryAsText (Path.Combine ("generated", "src", "Com.Xamarin.Test.IDefaultInterfaceMethods.cs"));
Assert.IsTrue (cs.Contains ("int Quux ();"), "Quux not generated.");
Assert.IsTrue (cs.Contains ("virtual unsafe int Foo ()"), "Foo not generated.");
Assert.IsTrue (cs.Contains ("virtual unsafe int Bar {"), "Bar not generated.");
Assert.IsTrue (cs.Contains ("set {"), "(Baz) setter not generated.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ Copyright (C) 2012 Xamarin Inc. All rights reserved.
ToolPath="$(MonoAndroidToolsDirectory)"
ToolExe="$(BindingsGeneratorToolExe)"
UseShortFileNames="$(UseShortGeneratorFileNames)"
EnableDefaultInterfaceMethods="$(AndroidEnableDefaultInterfaceMethods)"
/>

<!-- Write a flag so we won't redo this target if nothing changed -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.

<_PackagedResources>$(IntermediateOutputPath)android\bin\packaged_resources</_PackagedResources>

<_Android32bitArchitectures>armeabi-v7a;armeabi;x86;mips</_Android32bitArchitectures>
<_Android32bitArchitectures>armeabi-v7a;x86;mips</_Android32bitArchitectures>
<_Android64bitArchitectures>arm64-v8a;x86_64;mips64</_Android64bitArchitectures>

<_AndroidSequencePointsMode Condition=" '$(MonoSymbolArchive)' == 'True' And '$(AndroidUseDebugRuntime)' == 'False' And '$(AotAssemblies)' == 'True' And '$(DebugSymbols)' == 'True' And ('$(DebugType)' == 'PdbOnly' Or '$(DebugType)' == 'Portable')">Offline</_AndroidSequencePointsMode>
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite-xamarin/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_ABI := armeabi armeabi-v7a arm64-v8a x86 x86_64
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled. This can be helpful for providing convenience
methods or adding pure C# classes.

== Adding Methods to Generated Classes ==

Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size. It will look like
this:

public partial class Rectangle
{
public Rectangle (int x, int y, int width, int height)
{
// JNI bindings
}
}

Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints. We can add a new file called Rectangle.cs
with a partial class containing our new method:

public partial class Rectangle
{
public Rectangle (Point location, Size size) :
this (location.X, location.Y, size.Width, size.Height)
{
}
}

At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.


== Adding C# Classes ==

Another thing that can be done is adding fully C# managed classes to the
generated library. In the above example, let's assume that there isn't a
Point class available in Java or our library. The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.

By adding a Point.cs file with this class, it will end up in the binding library:

public class Point
{
public int X { get; set; }
public int Y { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This directory is for Android .jars.

There are 4 types of jars that are supported:

== Input Jar and Embedded Jar ==

This is the jar that bindings should be generated for.

For example, if you were binding the Google Maps library, this would
be Google's "maps.jar".

The difference between EmbeddedJar and InputJar is, EmbeddedJar is to be
embedded in the resulting dll as EmbeddedResource, while InputJar is not.
There are couple of reasons you wouldn't like to embed the target jar
in your dll (the ones that could be internally loaded by <uses-library>
feature e.g. maps.jar, or you cannot embed jars that are under some
proprietary license).

Set the build action for these jars in the properties page to "InputJar".


== Reference Jar and Embedded Reference Jar ==

These are jars that are referenced by the input jar. C# bindings will
not be created for these jars. These jars will be used to resolve
types used by the input jar.

NOTE: Do not add "android.jar" as a reference jar. It will be added automatically
based on the Target Framework selected.

Set the build action for these jars in the properties page to "ReferenceJar".

"EmbeddedJar" works like "ReferenceJar", but like "EmbeddedJar", it is
embedded in your dll. But at application build time, they are not included
in the final apk, like ReferenceJar files.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.xamarin.test;

public interface DefaultInterfaceMethods
{
default int foo () { return 0; }
default int getBar () { return 1; }
default int getBaz () { return 2; }
default void setBaz (int value) { }
default int toImplement () { throw new UnsupportedOperationException (); }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.xamarin.test;

public class ImplementedClass implements DefaultInterfaceMethods
{
public int toImplement () { return -1; }
}
Loading