简体   繁体   中英

Adding Non-Android Project to an Android Project

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.

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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