Skip to content Skip to sidebar Skip to footer

Android And Blackberry Project In 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

Solution 1:

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

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.

It's working well for me!

Solution 2:

For anyone else facing this issue I've found the solution that worked was by creating 3 directories on disk

Common Blackberry Android

The vast majority goes into Common however the classes that have platform specific calls go into the Blackberry/Android counterparts respectively and extend a common base class in the common directory.

E.g. a class called MyClass that needed platform specific versions would have a MyClassCommon in the common directory and in the Blackberry directory it has MyClass extends MyClassCommon definition and the same for Android.

In Eclipse the Common,Blackberry,Android src paths are individually added via a common variable (trunk) which is extened to the Common,Blackberry,Android paths for the 3 src root imports.

This seemed to be the only mechanism to ensure that the package name was consistent across platforms so not having a knock on effect that other dependent classes needed new package names.

I'm sure there is a more elegant/correct way of doing this but this appears to work well for now.

Post a Comment for "Android And Blackberry Project In Eclipse"