On Mon, Mar 30, 2009 at 11:09 AM, Mark Murphy
<mmur...@commonsware.com> wrote:
> When I tried putting src/java/beans/PropertyChangeEvent.java and
> src/java/beans/PropertyChangeListener.java in my source tree, though, I
> triggered the --core-library error message from dx.

It seems like there's a lot of legacy code that wants to use
java.beans, since we regularly hear about people wanting to import
something-or-other that depends on it.

> The problem is that you put us out here in a bind: we can't use your
> classes (because they are not in the SDK) and you won't let us use our
> edition of those classes.

I sympathize with your cause, but there are solutions:

In the short term, I recommend repackaging the classes in question so
they are in your app's package namespace. It's a minor pain, I admit,
but it will solve the problem. You might also investigate whether you
can excise the references to java.beans entirely from the code you
import.

In the long term, Android should probably provide at least a partial
implementation of java.beans. I don't believe it is feasible to
provide a full implementation, as some classes in java.beans reference
UI classes in java.awt that aren't reasonable to have on Android
within the foreseeable future.

> I would recommend the --core-library dx error message have a link to
> some documentation page where this gets spelled out, so we know what to
> expect. In particular, a list of the prohibited namespaces would be
> handy, so we don't have to just guess what we can and cannot use.

Glibly, java.* and javax.*. dx is actually somewhat lenient with
regard to javax, since the nominal "mandate" for that top-level
package is that it is for extensions which are often packaged
separately from the runtime. However, I would always err on the side
of repackaging. That said, you can find the actual list of verboten
javax packages in the source for dx. And *that* said, for your
convenience, here is the list as it currently stands:

    accessibility crypto imageio management naming
    net print rmi security sound sql swing transaction
    xml

I ended up augmenting the error message yesterday (in an Android-
internal branch for longer-term work, not Cupcake), though it perhaps
could still use a bit more work. We'll get there!

-dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to