BUG Community

Welcome! Log In

Forums Applications What about components?

Subscribe to What about components?  14 posts, 5 voices

Log in to reply to this topic
 
Dec 2, 2007 11:55pm
Img_missing_medium Shawn 14 posts

Hi everyone,

I’ve been working on a component that I think might be helpful.
However it’s not a full module, just a component that you could add to your modules. Where should something like that be posted?

I have a sample module that demos how it works, but it doesn’t do much.
Should I post that? or is there a better way?

Thanks
-Shawn

Dec 4, 2007 4:16pm
Medium Bug Labs team mcaric 64 posts

Hi Shawn,

From what you’re describing it sounds like you’re working on a piece of an application, like Ken’s Menu Extender – is that correct? Regardless of what it is we’d love to see it, and the best way to share it with the community would be to upload what you have to BUGnet with a description of what it is, what it does, all that good stuff.

We’re looking forward to seeing what you’ve come up with!

Thanks,
Melinda

Dec 5, 2007 11:43pm
Img_missing_medium Shawn 14 posts

Okay, here is a little component I put together to help fill in the gap I was seeing for data entry into applications, when a keyboard module was not connected.

See the VKey.java class for information on its use, and VirtKBTest.java for an example of its use. Running the entire applications will show how it looks.
You will need to plug a display module onto the bug, and then from the LCD menu select the app to run. A simple screen with a textfield and a textarea will display as soon as the textfield has focus the virtual keyboard should pop up. When you press the done button the display, and the keyboard should disappear.

Hope you find it helpful.

-Shawn

Dec 6, 2007 2:29pm
Medium Bug Labs team mcaric 64 posts

Great work Shawn, thanks!

Melinda

Jan 20, 2008 5:13pm
Medium Bug Labs team finsprings 268 posts

I have a similar question to Shawn. I put together a static helper class called PositionHelper that works with LatLon objects to: calculate the distance between them using the Haversine formula; display them as strings; and convert kilometers to miles.

I’ve used this is a couple of my bug apps, but for now I’ve just been making a utils package with that class in it, and copying it from project to project. If we had a GPS utils package or something, these functions could go in there.

Any thoughts as to how we share general purpose utility libraries, as opposed to full-blown apps like we do on bugnet?

Jan 22, 2008 12:00am
Medium Bug Labs team finsprings 268 posts

Shawn,

I was playing with your VirtKeyboard demo app and had some questions. At first it didn’t seem like pressing X was working for me to close the keyboard, so I put a breakpoint on the hide() call in VKey.actionPerformed. With that, I can see that it the keyboard does get hidden. However, I can’t seem to navigate from the userid field to the notes field: the keyboard come right back as soon as I try and click, or press tab.

If I run without the breakpoint, when I press the X the keyboard disappears and then reappears.

What am I doing wrong? I really like what you’ve done here, and I’d like to incorporate it into my todo app so it’s not just running off canned lists of cake.

Jan 22, 2008 7:15am
Medium Bug Labs team kgilmer 215 posts

Finsprings,

In regards to your question about sharing code among apps; there are several ways to do this and the way you mention is a good one. Another approach (we are working on Web and SDK support for this now) is to create a seperate utility bundle that your application bundle "Imports-Package" from. This allows other application bundles to use your utility bundle independently of your application. This is a core use case of OSGi in general. Unfortunately with the Web and SDK as they stand now there is no easy way of finding dependent bundles for a given application. This is something we hope to fix soon. LMK what you think…

Jan 22, 2008 7:46am
Medium Bug Labs team finsprings 268 posts

kengilmer
Finsprings,

In regards to your question about sharing code among apps; there are several ways to do this and the way you mention is a good one. Another approach (we are working on Web and SDK support for this now) is to create a seperate utility bundle that your application bundle "Imports-Package" from. This allows other application bundles to use your utility bundle independently of your application. This is a core use case of OSGi in general. Unfortunately with the Web and SDK as they stand now there is no easy way of finding dependent bundles for a given application. This is something we hope to fix soon. LMK what you think...

That sounds like a good approach Ken. Will those bundles have version numbers associated with them? If you break the interface contract in a bundle, you'd want to be able to rev the version number and keep the old one around for apps that haven't been updated. Apps would need to associate themselves with a particular major or major+minor version of the bundle.
Jan 22, 2008 9:05am
Img_missing_medium Shawn 14 posts

Finsprings, good catch.

Try the new version of VirtKey I just uploaded. I had an extra addFocusListener inside the vkey constructor. Doh!!

It was catching it’s own focus change and was causing the issues
you saw. You might also want to remove the code in the test app that adds the vkey to the notes field so when you shift from one to the other you can see the keyboard close itself.

Thanks for the question and info. If you find anything else please post it and I’ll be happy to help track it down.

-Shawn

Jan 22, 2008 9:05pm
Medium Bug Labs team finsprings 268 posts

Shawn, I think I got the update – it’s hard to tell since bugnet doesn’t show the change history on an app AFAIK. I’ve been putting my own version number stuff in the app description and bumping the rev in the manifest.

Anyhoo, I see "//addFocusListener(this)" in one of the ctors, so I presume it’s the updated one. However, when I run it on my MacBook, I see the same thing: when I press the X, the keyboard comes right back.

I also took the listener off the Note control but I can’t ever select it.

Any idea what I am doing wrong? Was that the change you made?

Jan 22, 2008 9:31pm
Img_missing_medium Shawn 14 posts

Yes that was the change, I verified it updated the app on bugnet, and from your comment you have that new version as well.

Oh by-the-way you can drag the keyboard around on the screen so that it’s out of your way to select the notes field. (not sure if I had mentioned that in the comment for the vkey).

Now I’m not one to point at another VM and say it’s their fault, but I’m wondering if this is due to extra events being throw to focusGained by the mac JVM? Which version are you running. 1.4, 1.5, 1.6 on Mac?
I’m on 1.6.0_03, on linux. Also which version of eclipse? and Dragonfly?
(not sure where to look for Dragonfly’s version num.)

But this shine the light on an issue that emulators always have, they are not the real thing. So if we solve it for all the JVM on the desktop the real device may still do other bad things. :(

I’ll walk through the code again and see if I can put some other checks so as not to allow the vkey to pop back.

Jan 22, 2008 9:43pm
Medium Bug Labs team finsprings 268 posts

I’m using Eclipse 3.3.1 with GEF 3.3.1 and the latest Dragon SDK from the …/testing/.. url as per the wiki (as of yesterday). I was using the default 1.5.0_13 JRE that comes with Leopard, but I get the same with Apple’s 1.6.0_01-41 developer preview.

I should just set up a new linux VM and be done with it.