简体   繁体   English

Android SDK或JDK

[英]Android SDK or JDK

I have an Eclipse project in which I have 2 entrypoints: a GWT web application and a mGWT+phonegap(+Android) mobile app. 我有一个Eclipse项目,其中有两个入口点:一个GWT Web应用程序和一个mGWT + phonegap(+ Android)移动应用程序。 There are under the same project, as they are based on the same Java code. 它们位于同一项目下,因为它们基于相同的Java代码。 Debugging let me suspect that within the web application, the Android implementation are used, instead of the JDK implementation. 调试让我怀疑在Web应用程序中使用的是Android实现,而不是JDK实现。 Why, because during debugging, I have to choose the correct java file (for instance Float.java). 为什么,因为在调试期间,我必须选择正确的Java文件(例如Float.java)。 How can I ensure that the Web application does not use the Android libraries? 如何确保Web应用程序不使用Android库?

You don't need your Android-SDK in the GWT project. 在GWT项目中不需要Android-SDK。 Don't include it in your Web-Project. 不要将其包含在您的Web项目中。

Split the two project and link the source Files with linked folders. 拆分两个项目,然后将源文件与链接的文件夹链接。

  1. GWT Application with two entry points 具有两个入口点的GWT应用程序

  2. Android Native Application Android本机应用程序

In your Android Project you can link the folder from your GWT Application: http://deviltechie.wordpress.com/2010/12/06/linking-an-external-folder-to-eclipse-flex-builder-project/ 在您的Android项目中,您可以从GWT应用程序链接该文件夹: http : //deviltechie.wordpress.com/2010/12/06/linking-an-external-folder-to-eclipse-flex-builder-project/

I do not believe that can be done. 我不认为可以做到。

It would be a best practice to split your project into 将您的项目分成

main project
 subproject 1 ( common code )
 subproject 2 ( entrypoint gwt webapp)
 subproject 3 ( entrypoint android)

This will ensure ensure top level modularity, testability and any adverse debugging/deployment scenarios like yours. 这将确保确保顶级的模块化,可测试性以及像您这样的不利调试/部署方案。 There is a good chance poor lib management causing issue in production. 库管理不善很可能导致生产中出现问题。

You can opt for maven ( gwt is well supported ) or ivy or any other tool to simplify your build. 您可以选择maven(gwt得到很好的支持)或ivy或任何其他工具来简化构建。

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

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