BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-06-2009, 04:49 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Model: 8100
PIN: N/A
Carrier: Airtel
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Please help me:-Trying to run a J2ME app in Blackberry by just minor changes

Please Login to Remove!

Hello Everyone,

I made an application in J2ME and now i want to run it on Blackberry also...I don't have much idea about blackberry but since blackberry's Research In Motion supports all j2me apis then i think by doing just minor changes i can make my j2me app run on blackberry also....

I would like to share the changes i made in my j2me app considering Blackberry.

1.Instead of Midlet class i made a class AppMain which extends UiApplication and starts the enterEventDispatcher() method.

2.Then i made an AppScreen which extends FullScreen and wrote all required methods.This is an abstract class.The abstract methods in this class are:-
---public abstract void init(int state);
---protected abstract boolean keyPressed(int keyCode, int gameAction);
---protected abstract void paintScreen(Graphics graphics);
And rest all my subclasses extends this AppScreen and there paintScreen() method is called in AppScreen's paint(Graphics graphics).

3. Then finally i used pushScreen() method with an instance of AppMain class which extends UiApplication to push that particular screen.

Everything is going perfect. Everything gets initialize properly and my application runs but don't know why the AppScreen class extending FullScreen paint method is not called.

I mean i have written SOP there but it's not going inside paint() method.

I hope i am clear enough and if not then please ask me i will make more clear.Please help with this problem. I am stuck with this from many days.

Thanks in advance for giving your precious time.

Regards
Rachna Khokhar | Software Engineer | Umundo Inc.
Offline  
Old 03-06-2009, 12:50 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2008
Model: 8700
PIN: N/A
Carrier: Telcel
Posts: 69
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well pal, i'm doing the exact same thing

Runned on this problems myself and you have 2 options

1.- Either stick to J2ME, BB run perfect on that platform, no changes needed to be. And you could deploy the application to a wider range of devices, not only BB
2.- Get rid of all the J2ME and focus on BB API. that what i'm doing and really, it takes a lot of effort and work, but its paying beatufully. My end user were complaining of the lack of buttons and a lot of use of the menu, so the BB API was pretty helpfull here. I'd had been able to make my own button, yes (My nokia 3500 has buttons, but can't fins those on the J2ME api so i'm pretty sure those are custom made items) but BB saved me a lot of work.

Still, calling the pushscreen should be enough to call paint the things, can't think of a reason why it won't paint the screen with the info
Offline  
Old 03-06-2009, 04:34 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2005
Location: Berlin
Model: 9500
OS: v4.7.0.78
PIN: 20CAFA18
Carrier: O2
Posts: 39
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think its the wrong approach. FullScreen is rather a manager. If you want to paint this way subclass Field and add it to FullScreen.
Offline  
Old 03-09-2009, 02:05 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: Ernakulam, Kerala, India
Model: 8320
Carrier: Airtel
Posts: 65
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rachnakhokhar View Post
Hello Everyone,

I made an application in J2ME and now i want to run it on Blackberry also...I don't have much idea about blackberry but since blackberry's Research In Motion supports all j2me apis then i think by doing just minor changes i can make my j2me app run on blackberry also....

I would like to share the changes i made in my j2me app considering Blackberry.

1.Instead of Midlet class i made a class AppMain which extends UiApplication and starts the enterEventDispatcher() method.

2.Then i made an AppScreen which extends FullScreen and wrote all required methods.This is an abstract class.The abstract methods in this class are:-
---public abstract void init(int state);
---protected abstract boolean keyPressed(int keyCode, int gameAction);
---protected abstract void paintScreen(Graphics graphics);
And rest all my subclasses extends this AppScreen and there paintScreen() method is called in AppScreen's paint(Graphics graphics).

3. Then finally i used pushScreen() method with an instance of AppMain class which extends UiApplication to push that particular screen.

Everything is going perfect. Everything gets initialize properly and my application runs but don't know why the AppScreen class extending FullScreen paint method is not called.

I mean i have written SOP there but it's not going inside paint() method.

I hope i am clear enough and if not then please ask me i will make more clear.Please help with this problem. I am stuck with this from many days.

Thanks in advance for giving your precious time.

Regards
Rachna Khokhar | Software Engineer | Umundo Inc.
Hi Khokhar

Why don't you try with MainScreen ? I guess it'll work for the purpose, and why are you calling/overriding paint ? I think you must use subpaint for the stuff to work with FullScreen class.
__________________
Regards
Anand.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.