diff --git a/JarBinding/Additions/AboutAdditions.txt b/JarBinding/Additions/AboutAdditions.txt new file mode 100644 index 00000000..c2403076 --- /dev/null +++ b/JarBinding/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/JarBinding/JarBinding.csproj b/JarBinding/JarBinding.csproj new file mode 100644 index 00000000..942738cf --- /dev/null +++ b/JarBinding/JarBinding.csproj @@ -0,0 +1,66 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {A8FBE3C3-BDE1-42C5-A4B9-F34CE5A68F46} + {10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46} + Library + Properties + JarBinding + JarBinding + 512 + false + v9.0 + class-parse + XAJavaInterop1 + + + true + portable + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + false + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JarBinding/Jars/AboutJars.txt b/JarBinding/Jars/AboutJars.txt new file mode 100644 index 00000000..c359b62f --- /dev/null +++ b/JarBinding/Jars/AboutJars.txt @@ -0,0 +1,24 @@ +This directory is for Android .jars. + +There are 2 types of jars that are supported: + +== Input 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". + +Set the build action for these jars in the properties page to "InputJar". + + +== Reference Jars == + +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". \ No newline at end of file diff --git a/JarBinding/Jars/pgyer_sdk_3.0.5.jar b/JarBinding/Jars/pgyer_sdk_3.0.5.jar new file mode 100644 index 00000000..c97f33fd Binary files /dev/null and b/JarBinding/Jars/pgyer_sdk_3.0.5.jar differ diff --git a/JarBinding/Properties/AssemblyInfo.cs b/JarBinding/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..cd14d1c4 --- /dev/null +++ b/JarBinding/Properties/AssemblyInfo.cs @@ -0,0 +1,30 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Android.App; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JarBinding")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JarBinding")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/JarBinding/Transforms/EnumFields.xml b/JarBinding/Transforms/EnumFields.xml new file mode 100644 index 00000000..22959957 --- /dev/null +++ b/JarBinding/Transforms/EnumFields.xml @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/JarBinding/Transforms/EnumMethods.xml b/JarBinding/Transforms/EnumMethods.xml new file mode 100644 index 00000000..49216c61 --- /dev/null +++ b/JarBinding/Transforms/EnumMethods.xml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/JarBinding/Transforms/Metadata.xml b/JarBinding/Transforms/Metadata.xml new file mode 100644 index 00000000..91493a25 --- /dev/null +++ b/JarBinding/Transforms/Metadata.xml @@ -0,0 +1,9 @@ + + +