麻烦的文件中导入的.class到Android项目 [英] Trouble importing .class files into Android project

查看:155
本文介绍了麻烦的文件中导入的.class到Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好堆栈溢出社区,

我创建用于工程项目的Andr​​oid应用程序。该应用程序的基本目标是通过WiFi进行远程控制的遥控车。该车具有安装在其上一个摄像头和麦克风,并传送视频和语音无线回控制。我们(组)有一个工作的Java应用程序,其中的视频传输通过一个无线摄像头完美的作品。我有工作的Java code,而code需要的.class文件功能:aplug.class,aplug $ AU.class,aplug $ SI.class和aplug $ TS.class。在Eclipse中,让程序工作,我不得不添加外部类库来获得code编译,一切工作正常。不过,我似乎无法让过去的声明,声明行:

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();

我试过添加外部类文件夹和添加类文件夹在Eclipse中,还有配置构建路径,然后右键单击类 - >添加到构建路径,但似乎没有任何上班。我也试过

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" />

在AndroidManifest.xml文件。有谁知道如何导入这些.class文件,所以我可以在我的Andr​​oid项目使用它们?

in the AndroidManifest.xml file. Does anybody know how to import these .class files so I can use them in my Android Project?

在此先感谢!

推荐答案

第1步:打包为一个JAR

Step #1: Package them as a JAR.

第二步:把JAR在库/ 目录

Step #2: Put the JAR in your libs/ directory.

第三步:选择添加JAR在Eclipse的构建路径,并添加引用了JAR

Step #3: Choose Add JAR in the build path in Eclipse and add the reference to the JAR.

这篇关于麻烦的文件中导入的.class到Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆