[mono-android] java binding library
Miljenko Cvjetko
mcvjetko at holisticware.net
Thu Jun 21 04:24:41 UTC 2012
Hi Wally
On 2012.06.21 03:05, Wally McClure wrote:
> I'm working on an example of using the java binding library. I wanted
> to use a fairly well known java library, so a friend told me to use
> the commons-math jar library. Ok, sounds good to me. I plug this into
> a MfA java binding library, and of course, it generates a bunch of
> errors. This is actually good. Now, I need to go through and fix
> these errors as noted here:
> http://docs.xamarin.com/android/tutorials/Binding_a_Java_Library_%28.jar%29
You have properties and/or events with the same name as class and you
have to rename those
in Transforms\Metadata.xml
with following:
Renaming class:
<attr
path="/api/package[@name='org.achartengine.tools']/class[@name='Pan']"
name="managedName"
>PanWrapper</attr>
Renaming event by adding eventName attribute:
<attr
path="/api/package[@name='org.achartengine.tools']/class[@name='Pan']/method[@name='addPanListener']"
name="eventName"
>Panned</attr>
Renaming property by adding propertyName attribute:
<attr
path="/api/package[@name='org.achartengine.tools']/class[@name='Pan']/method[@name='addPanListener']"
name="propertyName"
>Panned</attr>
To prevent binding of property/event - set the event/property name to
the empty string.
small writeup:
http://holisticware.net/HolisticWare/Know-How/development/Mobile/android/mono-for-android-monodroid/binding-projects.aspx
If You need sample I can push AChartEngine bindign to github. I didn't
have neought time
since I finished it, but if You need really bad it let me know.
cheers
mel
>
> Some of the errors that I am getting are:
> Error 1 'Gamma': member names cannot be the same as their
> enclosing type C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Special.Gamma.cs
> 12 23 BindingLibrary
>
> Error 2 The type or namespace name 'FirstMoment' does not exist
> in the namespace 'Org.Apache.Commons.Math3.Stat.Descriptive.Moment'
> (are you missing an assembly reference?)
> C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Stat.Descriptive.Moment.Mean.cs
> 30 70 BindingLibrary
>
> Error 5 Type
> 'Org.Apache.Commons.Math3.Stat.Clustering.EuclideanIntegerPoint'
> already defines a member called
> 'GetCentroidOf_Ljava_util_Collection_Handler' with the same parameter
> types C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Stat.Clustering.EuclideanIntegerPoint.cs
> 90 19 BindingLibrary
>
> Error 29 The name 'Handle' does not exist in the current
> context C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Stat.Descriptive.Moment.SecondMoment.cs
> 23 22 BindingLibrary
>
> Error 33 The name 'SetHandle' does not exist in the current
> context C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Stat.Descriptive.Moment.SecondMoment.cs
> 51 5 BindingLibrary
>
> Error 35 'object' does not contain a constructor that takes 2
> arguments C:\Projects\MonoAndroidAppDev\New in
> 4.2\Projects\ExampleJavaBindings\BindingLibrary\obj\Debug\generated\src\Org.Apache.Commons.Math3.Stat.Descriptive.Moment.SecondMoment.cs
> 62 28 BindingLibrary
>
> I'm wondering what the proper step is to go about fixing them. Should
> I go through the code and manually fix this up? Is there something in
> the various transform files I should do? As much assistance as I can
> get in minute detail would be helpful.
>
> Wally
>
>
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
--
Miljenko Cvjetko dipl.ing. ET
Direktor/CEO
Projektant rjes(enja/Solution Architect
Razvojni programer/Senior developer
Voditelj projekta/Project Manager
IX juz(na obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://www.holisticware.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120621/35c5367a/attachment.html>
More information about the Monodroid
mailing list