BUG Community

Welcome! Log In

Forums Applications Old school text entry

Subscribe to Old school text entry  15 posts, 4 voices

Log in to reply to this topic
 
Mar 8, 2010 6:57pm
Medium icubed 21 posts

I am making a text entry utility that is reminiscent of the way you used to enter your initials into an old arcade game.  If you recall, it had an up and down function that scrolled through the available alphabet like it was on a continuous wheel.  You would then move left or right to go to a different character.


I am trying to do something like this and would like some feedback on my initial idea.  Right now I am making an array of the available alphabet.  Then, I could implement some listeners to buttons for the up and down functions, as well as the side to side motions.  When an up or down button is pressed, the callback function would increment or decrement the character shown by changing the active item from the array and refreshing the display.


Any thoughts or suggestions for better and/or smoother ways to implement this?

Mar 9, 2010 12:48pm
Medium Bug Labs team jconnolly 285 posts

That is exactly how I’d go about it.  Nintendo/Arcade game style.

Mar 12, 2010 9:37pm
Medium icubed 21 posts

Hey jconnolly,

In your app BaseDiagnostic, in the service tracker, line 171, what is the use of KEY_UP?  I can’t find anything that tells me what that relates to on the bugbase.

Thanks again for your help.

Mar 15, 2010 12:47pm
Medium icubed 21 posts

So I have run in to an issue and I am not sure of the best way to account for it.  First, I am using the BaseDiagnostic app and the bugBase_helloworld app as references to some of the functionality that I require.

The functionality I am implementing would ideally call my text editor function when a menu node that requires it is executed.  At this point the text editor locks BaseDisplay and adds a buttonEventListener.  When the editing is done, it releases these objects and returns the string.

What is the best and/or proper way to do this?  From what I can gather, I can’t do the BaseDisplay locks/unlocks or add/remove the buttonEventListener outside of a class extending AbstractServiceTracker because they require the getService method.

 

Options:

Is there any reason I should not just create another servicetracker class in my package that is instantiated by my texteditor?  This option would register a service that is required for the texteditor servicetracker to get the basedisplay, etc.

Can I just restrict dostart/dostop to calls from outside the servicetracker itself?  Should I just add a method to the servicetracker that I call when I am ready to run?  This seems like an end run around the OSGi system though.

I realize I have probably glossed over the right way to do this and that my questions/ideas are probably n00bish.  I am just trying to show I am trying to figure it out before I ask.

 

Thanks for any input.

Mar 15, 2010 1:33pm
Medium Bug Labs team kgilmer 215 posts

icubed, my response in the IRC channel to your questions:

 

09:58 <@kgilmer> 23:00 < willis-home> is there anything stopping me from having more than 1 servicetracker file in an
                 app?
09:58 <@kgilmer> no, it’s a common use case.
09:59 <@jconnolly> kgilmer discovers the power of irssi logs
09:59 <@kgilmer> willis-home, if your text editor does not need to be accessable from other bunldes, it doesn’t need to
                 be an osgi service.  if this is the case, simply implement IMenuNode, register that impl w/ the Menu
                 service, and create and display your editor in IMenuNode.execute().
10:00 <@kgilmer> if you do need the text editor as an osgi service, than you will need to get a reference to your
                 editor in your IMenuNode implementation, and call show() (?) on the window when the
                 IMenuNode.execute() method is called.

Mar 25, 2010 11:34am
Medium icubed 21 posts

hey jconnolly or kgilmer, odd issue, when I try to run the latest rendition of my app on virtual bug, it no longer registers the menu nodes automatically, and when I go to start the program, it kicks an error.

Thu Mar 25 10:29:57 CDT 2010 Error occured while executing a menu node.
    Exception: Error starting bundle Bundle [21]: file:/home/wj/bugdev/.metadata/.plugins/com.buglabs.osgi.concierge.runtime/bundles/MenuWifi.jar

Line 21:

import com.buglabs.device.IButtonEventListener;

 

I can’t think of anything, but I am guessing I am doing something simple but incorrectly.  Any ideas?

Mar 25, 2010 11:42am
Medium Bug Labs team jconnolly 285 posts

Pastebin the entirety to concierge.log as well as the code used to register the menu.  My hunch is the path you’re using to register the node.

Mar 25, 2010 12:14pm
Medium icubed 21 posts

concierge log:

http://pastebin.com/5gvhHv0c

 

inner class and calling code:

http://pastebin.com/VRW3RKCy

(some stuff commented out while I was trying to figure this out on my own)

Mar 25, 2010 12:23pm
Medium Bug Labs team jconnolly 285 posts

Now you’re having an entirely different problem.  Pastebin your manifest and your entire class.

Mar 25, 2010 5:26pm
Medium icubed 21 posts

jconnolly,

You were right about the manifest.mf file.  It was missing com.buglabs.device in the imported packages section.  I added it and it started working.

Thanks.

Mar 27, 2010 11:55pm
Medium icubed 21 posts

Ok, kgilmer, I have a question.  For the API change to work, do I need to setEnabled(false) on both services?  Also, the menucontroller doesn’t return anything with getService.  I am guessing I need to implement the interface somehow, but what is the use?


I am asking because the virtual bug is giving me a concurrent error.  I will pastebin some stuff in the morning.

Mar 29, 2010 9:50am
Medium Bug Labs team jconnolly 285 posts

IIRC, the setEnabled thing is for the physical BUG only. 

Mar 29, 2010 10:00am
Medium Bug Labs team kgilmer 215 posts

 

.setEnabled() should need to be called on IMenuProvider only.  The code should (could?) also work on the Virtual BUG but I did not try that out.  You do not have to implement the interface, only call setEnabled on your reference to the service.  I can provide an example app if you’d like…

Mar 30, 2010 12:33pm
Medium icubed 21 posts

Ok, so I am having two issues on the physical bug:

1) The menu node is really sluggish.  When you scroll to the Configure Wifi node in Settings, it stays blank for a while and then shows up.  Same thing when you move right into the node.

2) When I execute the node, it flashes some stuff, throws up a letter, then replaces my new text with the original menu node text and continues scrolling it.  It also either doesn’t respond to the up/down presses, or it responds so slowly that I can’t see it happening.

Thanks for the input.

Aug 14, 2012 1:55am
User_img_not_found_06_med rubing 103 posts

Isn’t it funny how we www.coachfactorystoreec.com/ Coach Factory Store always want what we can’t have? The girl with the round and pert backside wishes that her rear were 5 times smaller. Meanwhile, the girl with the non existent posterior wishes to achieve a larger butt. Well, if the grass is greener on the other side, just water yours! If you’ve got a small behind, you can create the illusion of a larger one with butt enhancing jeans. Here’s how to do it. Look for light weight denim – This mater