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
New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Flash Screen

hey i am trying to flash the screen black and white while part of my app runs.  basically the regular screen is a png that is mostly white, so i made an all black png and then wrote the following code.  i know the code works by itself, but looping it causes it not to work at all.  it seems to not want to work in a loop at all for some reason.  but works fine by itself.  if this is wrong, can you tell me the right way to flash the screen?  if i cant flash two pngs i would settle for flashing it just painted black and white.  or anything like that.

bg is defined earlier and confirm it works if i take it otu of the loop.

boolean current = false; 
                           //

                       do                                                          
                                                          
                              
                                    if(current) {
                                   _manager.setBackground(bg);
                                   _manager.invalidate();
                                   current = false;
                               } else {
                                   _manager.setBackground(bg2);
                                    _manager.invalidate();
                                    current = true;
                               }
                              
                               for(int i=1; i < 12000000; i++) {
                                    // every 100k switch
                               
                                }
                        
                           } while(this checks something);
                          

New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Re: Flash Screen

anyone?

 

also, i got the csi files from rim today (the signing keys) and the instructions say to double click them, but csi is not registered to anything on my pc and the instructiosn dont say what to do if you cant double click on them.  

 (i am using eclipse plugin)
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Flash Screen

I don't think those commands you list do anything expect queue up requests. Invalidate

just says "repaint me" but you need to let or tell someone to do that. I guess in repaint

you could requeue your flipping thing.

 

Developer
gregzav
Posts: 170
Registered: ‎01-17-2009
My Device: 9630

Re: Flash Screen

You're opening them in regular old explorer right...?

 

Also for a flashing screen why don't you just make a custom field that takes up the screen width and have a TimerTask change the fields color.... 

New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Re: Flash Screen

ok good news for the 2nd question, i just figured out what to do from a blog i found, i needed to do:

java -jar signaturetool.jar mykey.csi for all 3 keys that worked.

 

New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Re: Flash Screen


marchywka wrote:

I don't think those commands you list do anything expect queue up requests. Invalidate

just says "repaint me" but you need to let or tell someone to do that. I guess in repaint

you could requeue your flipping thing.

 


what do you mean?  i successfuly use those commands to set up the background and then change it.  but it just wont do it back and forth in a loop.  

 

when you say queue up requests, is there a way to execute that queue?  i am sorry iam really new to bb programming.

Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Flash Screen

http://www.google.com/search?hl=en&q=site%3Ablackberry.com+invalidate+repaint

 

see also similar search on sun.com for background ideas.

 

Sometimes you may not invalidate the right things to force a screen update but if you don't

yield or something no one can paint. In nomal usage, you would want to do a bunch of updates

in a double buffered approach and then finally do one paint and flip to screen.

 

New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Re: Flash Screen

thanks i will read that link.

 

also, is there a way to make it properly update the jad file when i build my app? so i dont have to delete it everytime?

 

also is there a way to tell it to not zip the cod so i dont have to keep unzipping it for every build?

 

also after i sign the app, do i need to update the jad file again somehow since the size would change?  if so do i have to every time?

 

i am using eclipse. thanks.

New Developer
mike240se
Posts: 113
Registered: ‎02-21-2009
My Device: Not Specified

Re: Flash Screen

ok i checked your link but it appears that updateLayout() is not working or the right thing.

 

as far as making it a big frield and flashing it, could you help me with a small amount of code to point me in the right direction, i am brand new to bb development.

Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Flash Screen

UI's aren't really my thing- I haven't done much with BB and didn't particularly get a good set of

AWT components for applets, LOL.  I was just trying to get someone else to chime in. I do all

my stuff with scripts in cygwin. Sometimes I'll track down ecclipse bugs if they seem relevant

and in the past found some questions answered at sun.com as often they are not BB specific..

 

I have to admit that just going to the bin directory and typing exe files doesn't always give you

good command line help but IIRC there is something called fixjad. Again, however, zipping and

uploading and jad fixing I do with jar, curl, and awk so I'm not entirely sure what there is for BB.

These would largely work with sun build too as originally intended, as would use of the g++ preprocessor

for making conditional builds.