diff --git a/AndroidBinding1/Additions/AboutAdditions.txt b/AndroidBinding1/Additions/AboutAdditions.txt new file mode 100644 index 0000000..2775bd3 --- /dev/null +++ b/AndroidBinding1/Additions/AboutAdditions.txt @@ -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; } +} \ No newline at end of file diff --git a/AndroidBinding1/AndroidBinding1.csproj b/AndroidBinding1/AndroidBinding1.csproj new file mode 100644 index 0000000..aaa7bdb --- /dev/null +++ b/AndroidBinding1/AndroidBinding1.csproj @@ -0,0 +1,36 @@ + + + net9.0-android + 21 + enable + enable + + true + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidBinding1/Transforms/EnumFields.xml b/AndroidBinding1/Transforms/EnumFields.xml new file mode 100644 index 0000000..2295995 --- /dev/null +++ b/AndroidBinding1/Transforms/EnumFields.xml @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/AndroidBinding1/Transforms/EnumMethods.xml b/AndroidBinding1/Transforms/EnumMethods.xml new file mode 100644 index 0000000..49216c6 --- /dev/null +++ b/AndroidBinding1/Transforms/EnumMethods.xml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/AndroidBinding1/Transforms/Metadata.xml b/AndroidBinding1/Transforms/Metadata.xml new file mode 100644 index 0000000..2d2cd07 --- /dev/null +++ b/AndroidBinding1/Transforms/Metadata.xml @@ -0,0 +1,36 @@ + + + + + Com.Lvcheng.Lock.Shared.Nfc + + + java.util.List + + + + + + Com.Lvcheng.Lock.Shared.Nfc.Ctrl + Com.Lvcheng.Lock.Shared.Nfc.CV + Com.Lvcheng.Lock.Shared.Nfc.Met + Com.Lvcheng.Lock.Shared.Nfc.Result + + + Com.Lvcheng.Lock.Shared.Nfc.Example.NFCHelper + + + + + + int + \ No newline at end of file diff --git a/AndroidBinding1/nfc-sdk.aar b/AndroidBinding1/nfc-sdk.aar new file mode 100644 index 0000000..c07e480 --- /dev/null +++ b/AndroidBinding1/nfc-sdk.aar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfe42222a9d06d4187f79a4be887d732d7738859f1c7628d54c3e441454213c9 +size 66849