1

有没有人能够将 achartengine 1.0 库绑定到 MonoForAndroid 项目(rel. 4.2.7)并使其工作?

我在我的解决方案中创建了“Java Binding Library”项目,我在文件夹 Jars 中复制了文件 acahrtengine.jar,编辑了文件 Transforms/metadata.xml 添加以下行以规范命名空间并修复错误:

<attr path="/api/package[@name='org.achartengine']" name="managedName">AChartEngine</attr>
<attr path="/api/package[@name='org.achartengine.chart']" name="managedName">AChartEngine.Chart</attr>
<attr path="/api/package[@name='org.achartengine.model']" name="managedName">AChartEngine.Model</attr>
<attr path="/api/package[@name='org.achartengine.renderer']" name="managedName">AChartEngine.Renderer</attr>
<attr path="/api/package[@name='org.achartengine.tools']" name="managedName">AChartEngine.Tools</attr>
<attr path="/api/package[@name='org.achartengine.util']" name="managedName">AChartEngine.Util</attr>

<attr path="/api/package[@name='org.achartengine.tools']/class[@name='Pan']/method[@name='addPanListener']" name="eventName">PanEvent</attr>

它没有错误地遵守并创建 DLL,但是当我将引用添加到我的项目并尝试重新编译时,出现以下错误

obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error :      org.achartengine.tools.PanListener
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error :         org.achartengine.tools.ZoomListener
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error :    public void zoomApplied (org.achartengine.tools.ZoomEvent p0)
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error : 
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error :  package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error :  private native void n_zoomApplied (org.achartengine.tools.ZoomEvent p0);

有什么建议可以让 AChartEngine 在 Mono For Android 上运行吗?谢谢

4

1 回答 1

1

您需要将 jar 文件添加到 Monodroid 项目以及引用绑定项目。

该过程在此处的帮助文档中进行了描述:

http://docs.xamarin.com/Android/Guides/Advanced_Topics/Java_Integration_Overview/Binding_a_Java_Library_(.jar)#Add_the_Jar_to_the_Project

于 2012-12-26T21:08:47.940 回答