Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
anta40
Posts: 223
Registered: ‎07-26-2010
My Device: Z10
My Carrier: Telkomsel

Integration ROT13 app to BB menu

I have to idea of writing a fun app: a ROT13 app which is integrated to the BB menu. So for example, when you're composing new tweets, writing emails, or texting BBM message, you could just highlight the message, press the BB menu, select the "ROT13 This Text" menu, and the highlighted text will be ROT13-ed.

 

On adding the "ROT13 This Text" menu, I think I could use this:

http://docs.blackberry.com/en/developers/deliverables/7693/Create_a_menu_item_508119_11.jsp

 

Now the problem is how to ROT13 the text? Of course I'm not asking about ROT13 algorithm itself, but to "capture" the highlighted text, so it can be ROT13-ed in-place. Is it possible?

Please use plain text.
Developer
simon_hain
Posts: 15,863
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Integration ROT13 app to BB menu

direct access is not possible i think, and a context menu only gets what the system gives it.
but you could work around this by using the clipboard API, the user would have to copy the text, use your menu item and insert it again, your app would replace the contents of the clipboard.
see
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/Clipboard.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
anta40
Posts: 223
Registered: ‎07-26-2010
My Device: Z10
My Carrier: Telkomsel

Re: Integration ROT13 app to BB menu

Ah I see. It's easier.

 

BTW, regarding this:

http://docs.blackberry.com/en/developers/deliverables/7693/Create_a_menu_item_508119_11.jsp

 

Does the menu item stay permanent, e.g if I quit the app or restart the device?

Please use plain text.
Developer
simon_hain
Posts: 15,863
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Integration ROT13 app to BB menu

an applicationmenuitem is permanent unless you remove it using http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/menuitem/ApplicationMenuIt... net.rim.blackberry.api.menuitem.ApplicationMenuItem)

I usually use an autostart part to add menu items, options provider, notifications etc
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.