简体   繁体   English

如何将Android电子邮件源代码导入eclipse项目?

[英]How to import android email source code into eclipse project?

I downloaded the android Email app source code [version 2.2] from here . 我从此处下载了android Email应用程序源代码[2.2版]。 I deleted the .classpath and .project file so that I could import an existing android project. 我删除了.classpath和.project文件,以便可以导入现有的android项目。 Everything seems to have worked. 一切似乎都奏效了。 However, I get quite a few recurring errors such as: 但是,我遇到了很多重复出现的错误,例如:

Attendees cannot be resolved to a variable 与会者无法解析为变量

android.provider.Calendar cannot be resolved to a variable android.provider.Calendar无法解析为变量

Calendar cannot be resolved to a variable 日历无法解析为变量

I have set the correct android version 2.2 , what am I missing? 我设置了正确的android 2.2版,我缺少什么?

Thanks all for any help 谢谢大家的帮助

I faced the same issue with Email. 我在电子邮件方面也遇到了同样的问题。 I fixed the issue, by adding the following jars into the build path and thus, all the errors were resolved. 通过将以下jar添加到构建路径中,我解决了该问题,因此,所有错误均已解决。

../out/target/common/obj/APPS/Email_intermediates/classes.jar
../out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar

But you need to make the Application build using the platform. 但是您需要使用平台来构建应用程序。

Many of the included applications cannot(or at least could not) be built with the SDK, as they depend(ed) on non-exported functionality that is only "visible" during the system build. 许多包含的应用程序不能(或至少不能)使用SDK构建,因为它们依赖于非导出功能,该功能在系统构建过程中仅是“可见的”。 I'm not sure if Email is still in this category, but it was in the cupcake days. 我不确定电子邮件是否仍在此类别中,但是那是杯形蛋糕。

There are three potential workarounds. 有三种潜在的解决方法。 Best is to rewrite those parts of the application to instead use functionality which is exported in the SDK, and thus fairly stable. 最好是重写应用程序的那些部分,以使用在SDK中导出的功能,因此相当稳定。

Next up is to use reflection to pick up the missing pieces at runtime. 下一步是使用反射在运行时拾取丢失的片段。

Last is to make do-nothing dummy classes for the needed non-public platform pieces, within your project. 最后是在您的项目中为所需的非公共平台部分做虚空伪类。 These are enough to let the program compile, and at runtime they get rejected due to name collisions with the hidden system functionality, so you end up utilizing the real classes rather than the dummies. 这些足以让程序进行编译,并且在运行时由于与隐藏的系统功能发生名称冲突而被拒绝,因此您最终将使用真实的类而不是虚拟的类。

The proper thing to do is to build the application with the platform build system, rather than the SDK. 正确的做法是使用平台构建系统而不是SDK来构建应用程序。

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

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