Feature Request: Decouple Swing

12 views
Skip to first unread message

Dave Smith

unread,
Jan 27, 2011, 3:27:21 PM1/27/11
to JTwitter
I am a mobile developer working heavily with Android. To date, there
is a severe lack of working libraries in the open-source community
right now to integrate social functionality like Twitter into Android
applications. I found JTwitter to be the simplest to integrate and it
actually worked as expected on the platform, but there is currently a
big hole in its usability having to do with versions of Android
earlier than 2.0.

There are portions of this library that are statically linked to
javax.Swing classes, which are not part of the UI toolkit on Android.
As a result, the VM throws VerifyErrors when users attempt to access
that JAR. In Android 1.5 and 1.6, this is a fatal exception and the
application crashes. In Android 2.0+, the VM handles VerifyErrors
differently and a silent warning is created, but the application is
still allowed to run. Forced with no better option for a Twitter
library, we locked our latest application to a minimum of Android 2.0
so we could use JTwitter, a non-ideal decision. It would be fantastic
if this could be released without being coupled to the Swing libraries
so we could use it to create more universal Android applications.

Cheers!

Daniel Winterstein

unread,
Jan 27, 2011, 5:27:30 PM1/27/11
to jt...@googlegroups.com

No problem - we'll do a new release as soon as. Sorry we were unaware of the problem.
Daniel

Daniel Winterstein

unread,
Jan 28, 2011, 5:21:07 AM1/28/11
to jt...@googlegroups.com
Hi Dave,

I've converted the Swing dependency into a reflection based lookup.
That should fix your issue (& without removing the Swing-based
convenience methods). Just don't call askUser() or authorizeDesktop()
methods from Android (the documentation makes this clear).

Link for JTwitter version 1.8.6: http://www.winterwell.com/software/jtwitter.php

Let me know if you encounter any problems.

Best regards,
- Daniel

--
--------------------------------------------------
Daniel Winterstein
Edinburgh
http://winterwell.com   http://soda.sh

Dave Smith

unread,
Jan 28, 2011, 12:14:37 PM1/28/11
to JTwitter
Daniel -

Thanks very much for your prompt response! I have downloaded the new
JAR and I will let you know how things go. Your implementation is
very compatible with Android since you are using the org.json parser.
I would recommend advertising this more as this is the only library
I've found that's basically drop-in. Although, many Android folks may
prefer to see this code licensed under Apache.

Cheers!
Dave

On Jan 28, 3:21 am, Daniel Winterstein <daniel.winterst...@gmail.com>
wrote:
> Hi Dave,
>
> I've converted the Swing dependency into a reflection based lookup.
> That should fix your issue (& without removing the Swing-based
> convenience methods). Just don't call askUser() or authorizeDesktop()
> methods from Android (the documentation makes this clear).
>
> Link for JTwitter version 1.8.6:http://www.winterwell.com/software/jtwitter.php
>
> Let me know if you encounter any problems.
>
> Best regards,
>  - Daniel
>
Reply all
Reply to author
Forward
0 new messages