将 .class 文件导入 Android 项目时遇到问题
你好 Stack Overflow 社区,
我正在为一个工程项目创建一个 Android 应用程序。该应用程序的基本目标是通过 WiFi 远程控制遥控汽车。汽车上安装有摄像头和麦克风,并将视频和语音无线传输回控制器。我们(该小组)有一个可用的 Java 应用程序,其中视频传输通过无线摄像头完美运行。我有有效的 Java 代码,但代码需要 .class 文件才能运行:aplug.class、aplug$AU.class、aplug$SI.class 和 aplug$TS.class。在 Eclipse 中,为了使程序正常工作,我必须“添加外部类库”来编译代码,并且一切正常。但是,我似乎无法越过声明声明行:
private aplug applet = new aplug();
我尝试过“添加外部类文件夹”和 Eclipse 中的“添加类文件夹”,以及“配置构建路径”,然后右键单击类-> “添加到构建路径”,但似乎没有任何作用。我还在
<uses-library>android:name="aplug.class" />
AndroidManifest.xml 文件中尝试过。有谁知道如何导入这些 .class 文件以便我可以在我的 Android 项目中使用它们?
提前致谢!
Hello Stack Overflow community,
I'm creating an Android app for an engineering project. The basic goal of the app is to remotely control an RC car via WiFi. The car has a camera and microphone mounted on it, and transmits video and voice wirelessly back to the control. We (the group) have a working Java app where the video transmission works perfectly via a wireless camera. I have the working Java code, but the code requires for .class files to function: aplug.class, aplug$AU.class, aplug$SI.class, and aplug$TS.class. In Eclipse, to get the program working I had to "Add External Class Library" to get the code to compile, and everything works fine. However, I can't seem to get past the declaration declaration line:
private aplug applet = new aplug();
I've tried "Add External Class Folder", and "Add Class Folder" in Eclipse, as well as "Configure Build Path", and right-clicking the classes -> "Add to Build Path", but nothing seems to work. I also tried
<uses-library>android:name="aplug.class" />
in the AndroidManifest.xml file. Does anybody know how to import these .class files so I can use them in my Android Project?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
步骤#1:将它们打包为 JAR。
步骤#2:将 JAR 放入您的
libs/
目录中。步骤#3:在 Eclipse 的构建路径中选择“添加 JAR”,然后添加对 JAR 的引用。
Step #1: Package them as a JAR.
Step #2: Put the JAR in your
libs/
directory.Step #3: Choose Add JAR in the build path in Eclipse and add the reference to the JAR.