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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Developer
Posts: 1
Registered: ‎08-26-2009
My Device: Not Specified

making an open source app work for the blackberry storm



 To start i would like to say that my java skills are not all that good and put the blackberry JDK into the mix and that skill has gone down a little, this is really the first time i've given it a go.


I've found an open source application that i like, but the problem i have with it is when i install it to my Strom (9500) i runs well but when i have to use the numeric pad for controls it doesn't seem to pick them up.


the app is a Gameboy emulator that has been built to be cross platform and it does work on most phones that i've used. So because of cross platform the conrols code is not specific to any device, which i guess is why the storm doesn't work with it. I was wondering if someone could point me to the right direction, maybe some good tutorials that would allow me to make a convertion, or even start something in this thread where i we can tried different things.


this is the code i found for hte controls:


public void keyReleased(int keyCode) { for (int i = 0; i < 8; i++) { if (keyCode == key[i]) { cpu.buttonUp(i); } } }//end Keyreleased





public void keyPressed(int keyCode) { if (settingKeys) { key[keySetCounter++] = keyCode; if (keySetCounter == 8) { writeSettings(); settingKeys = false; } repaint(); return; } for (int i = 0; i < 8; i++) { if (keyCode == key[i]) { cpu.buttonDown(i); } } }//End KeyPressed







i've only just installed all the JDK's amd plugins needed for blackberry development on using eclipse so its all up ti date and so is the firmware for my storm.


Any pointers would be awesome, if you need more information please let me know.


Thanks Brian. 

Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-, Z10 (STL100-3)-, Z30 (STA100-5)-, Passport (SQW100-1)-, PlayBook (16GB)-
My Carrier: Verizon

Re: making an open source app work for the blackberry storm

From what code you posted it looks good to me. Have you tried setting a breakpoint inside the keyPressed/keyReleased functions and seeing if they are called when you press a numeric key?


Wait, scratch that. I just remebered that you are trying this with the Storm, take a look at net.rim.device.api.lcdui.BlackBerryCanvas (or net.rim.device.api.lcdui.game.BlackBerryGameCanvas). It kills the cross platform system but it has a touchEvent support. I would suspect that it calls the keyPressed/keyReleased functions but don't know for sure (haven't coded MIDP applications).


Hope that helps.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.