简体   繁体   English

在Necessitas中设置Java类路径

[英]Setting Java Classpath in Necessitas

I'm porting an application we've written with Qt to Android, using Necessitas. 我正在使用Necessitas将我们用Qt编写的应用程序移植到Android。 This has gone fairly smoothly, but I need to use a vendor provided Java library to access the serial port on our Android device. 这进展得相当顺利,但是我需要使用供应商提供的Java库来访问我们Android设备上的串行端口。 There isn't much help available on using Java within Necessitas, particularly with add-on libraries, but I've been told by the vendor that I need to include the library in the manifest like this: 在Necessitas中使用Java并没有太多帮助,特别是在附加库中,但是供应商告诉我,我需要这样在清单中包含该库:

  <uses-library android:name="vendor.serial.library"
                android:required="true"/>

...and that I also need to include the library in the Java classpath, but this is where I'm stuck: I don't know where the classpath is stored or how to update it. ...而且我还需要将该库包含在Java类路径中,但这是我遇到的问题:我不知道类路径存储在何处或如何更新。 I'm also a little confused as to the location of the library: There's a version on the device at system/framework, which is what I've been told to add to the classpath, but there's also a version on my computer which is larger. 关于库的位置,我也有些困惑:系统/框架上的设备上有一个版本,有人告诉我要添加到版本路径中,但是我的计算机上还有一个版本更大。 How are add-on libraries managed? 附加库如何管理? Do they get copied to the device from the computer when a deploy occurs? 发生部署时,它们是否从计算机复制到设备上?

Any help would be much appreciated! 任何帮助将非常感激!

Update 更新资料

I should point out that our vendor provides instructions as to how to use their library in Eclipse, and this information works: You right-click the project, select properties, then change the Project Build Target to be their supplied library (which is initially installed as an add-on using the Android SDK manager). 我应该指出,我们的供应商提供了有关如何在Eclipse中使用其库的说明,并且此信息有效:您右键单击该项目,选择属性,然后将Project Build Target更改为其提供的库(该库最初已安装)作为使用Android SDK管理器的附加组件)。 Unfortunately, I can't find a parallel to this in Necessitas's Qt Creator: Go to Projects -> Run -> Package Configurations and I find an option to set the Android SDK, but no option for our vendor package appears here (just 7, 8 and 10). 不幸的是,我在Necessitas的Qt Creator中找不到与此类似的东西:转到“项目”->“运行”->“程序包配置”,并且找到设置Android SDK的选项,但此处没有我们的供应商程序包选项(仅7, 8和10)。 I assume SDK's have to be configured separately for Necessitas, and it doesn't automatically find all available ones. 我认为必须为Necessitas分别配置SDK,并且它不会自动找到所有可用的SDK。

Unfortunately, comparing an Eclipse project which uses SDK 10 and one which uses the vendor SDK didn't turn up any clues as to how one might make Necessitas use the new SDK, so I'm at something of a loss as to where to go from here. 不幸的是,将使用SDK 10的Eclipse项目与使用供应商SDK的Eclipse项目进行比较,并没有发现有关如何使Necessitas使用新的SDK的任何线索,所以我对去向何处感到困惑从这里。

@Philip : Please refer the below link. @Philip:请参考以下链接。 Hope it helps http://qt-project.org/wiki/Setup_Necessitas_SDK_on_Windows 希望对您有所帮助http://qt-project.org/wiki/Setup_Necessitas_SDK_on_Windows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM