添加非Android项目到Android项目 [英] Adding Non-Android Project to an Android Project

查看:118
本文介绍了添加非Android项目到Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中三个项目:基础,服务器和AndroidClient。底座和服务器是Java 1.7的项目,而AndroidClient显然是一个Android项目。该基地项目具有的服务器和Android客户端之间共享类和文件。

I have three projects in Eclipse: Base, Server, and AndroidClient. The Base and Server are Java 1.7 projects, while the AndroidClient is obviously an android project. The base project has classes and files that are shared between the server and android client.

据我所知,Android不使用一切正常的Java类,并有关于Dalvik的是从你必须单独编译它们的JVM足够的不同部分的交易。假设我很小心,不要使用Android在基础项目不支持任何Java类,有没有什么办法,包括基础项目作为库到Android客户端以简单的方式?

I understand that the Android doesn't use all of the normal Java classes and there's some deal about the Dalvik being different enough from the JVM that you have to compile them separately. Assuming I'm careful not to use any java classes that android doesn't support in the base project, is there any way to include the base project as a library to the android client in a simple way?

推荐答案

想通了。答案是打开你的Andr​​oid项目的属性,构建路径,点击链接源...。添加源目录为您基地项目。现在,你的Andr​​oid项目将建立在Android这些文件也是如此。

Figured it out. The answer is to open up your Android projects Properties, Build Path, and click "Link Source...". Add the source directory for your base project. Now, your android project will build those files for the android as well.

这篇关于添加非Android项目到Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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