在Eclipse Android和黑莓的项目 [英] Android and Blackberry project in eclipse

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

问题描述

我是相当新的Andr​​oid和只真正被使用eclipse一些基本的黑莓工作,所以我很好奇,如果我能挑几个专家心目中的任何建议/你使用双平台工作区/项目设置指针在Eclipse支持项目?

I'm fairly new to android and have only really been using eclipse for some basic Blackberry work so I was curious if I could pick a few expert's minds for any suggestions/pointers on the workspace/project setup you use for dual platform support projects in eclipse?

我发现我的code的80%左右是黑莓和Android之间的共同所以它是这20%我需要解决的问题。

I've found about 80% of my code is common between Blackberry and Android so it's this 20% I'm needing to address.

我现在的想法是通过源代码树中的选项来设置他们有一个工作区,在多个项目共享源。

My current thinking is to have one workspace with shared source in multiple projects via setting them in the source tree options.

在哪里平台特定功能的使用,我会标记源名称为*的Andr​​oid _ ??? *和*黑莓_ *分别???,并有这两个项目指向一个泛型类。

Where platform specific features are used I'll tag the source name as *Android_???* and *Blackberry_???* respectively and have a generic class that both projects point to.

即。有效的一个工作区同时拥有Android和黑莓的设置和工作区都为黑莓一个项目,一个为Android,但每个项目共享同一个文件系统与其他appropritate平台的源文件从生成中排除。

I.e. effectively one workspace holds both Android and Blackberry setups and in the workspace have one project for Blackberry and one for Android but each project shares the same filesystem with the appropritate other platform's source files excluded from the build.

如果只是有做Java中的 #IFDEF 相当于一个简单的方法,这将简化这个端口,但我想我们必须这样做没有。(我听说使用AC preprocessor这样做,但听起来很凌乱,除非它极力推荐我宁愿不采用这个)

If only there was an easy way of doing the #ifdef equivalent in java this would simplify this port but I guess we have to do it without.(I heard about using a c preprocessor to do this but sounds messy so unless it's highly recommended I'd rather not adopt this)

我听说有关创建共享库,但有一种感觉这些都不是Android和黑莓之间的兼容,所以这种方法的任何意见,也受欢迎。

I'd heard about creating a shared library but have a feeling these are not compatible between android and blackberry so any advice on this approach is also welcome.

推荐答案

这可能为时已晚,但我还是给你说了我的想法。

It's probably too late, but I'll still give you my thoughts on that.

我也有类似的需求。我有共同的code和黑莓和Android特定部分。我对每一部分三个独立的Eclipse项目。 特定项目是一个实际运行,并且他们有一个项目依赖关系(我觉得这不是源列入清洁)上常见的一种。

I have a similar need. I have common code and Blackberry and Android specific parts. I have three separate Eclipse project for each part. The "specific" projects are the one actually run, and they both have a project dependancy (which I find cleaner than source inclusion) on the Common one.

请注意,共同的项目必须是黑莓的项目(使用插件创建),因为黑莓的项目不能依赖于一个非黑莓的项目。

Note that the Common project must be a Blackberry project (created using the plugin), since a Blackberry project cannot depend on a non-blackberry project.

它的工作很适合我!

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

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