×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    Flicker using Display.setCurrent and FullCanvas

    I have an application - a game - using a number of screens, each of which is implemented as a FullCanvas.

    I move between these screens using Display.setCurrent(), but when I do the phone screen "flickers" and briefly shows the background (signal charge and battery indicator, etc.). This occurs on both the Series 60 emulator and a real device (7650).

    Any ideas how I can avoid this, other than refactoring the application to avoid Display.setCurrent() calls?

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393

    RE: Flicker using Display.setCurrent and FullCanvas

    Are you using double buffering? If not, use it to avoid flicker. Search this forum for more on double buffering.

    [N]/ Forum Nokia
    Cheers,
    Nitin

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    43
    Unfortunately I am having the same problem and double buffering does not help. Double buffering will eliminate flicker when redrawing the SAME screen, but when SWITCHING BETWEEN SCREENS the problem keeps popping up. I suspect that it has something to do with the way Nokia implemented the display.setCurrent() method.
    Can nmittal or other Nokia experts weigh in on what might be causing this and how to avoid it? Or, ywh, did you ever find a workaround?

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393
    - Can you post your source code for us to evaluate further?

    Try to minimise the change of screen and repaint your screen instead. That would minimise the number of object creation/deletion and could avoid the flicker by having more memory for processing.

    - What version of software is running on your 7650?

    [N]/ Forum Nokia

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    1
    I have the same problem.

    I have made a queue of dialogs (using FullCanvas). When calling the method displayNext() (see below) the emulator is first drawing the native screen I had before using Display.setCurrent() the first time. When that screen has been drawed it paints my FullCanvas. So for a fraction of a second I see a wrong screen, before my new screen is displayed.


    /**
    * Displays next dialog in the queue (if any)
    */
    private synchronized void displayNext()
    {
    if(m_queue.size() > 0)
    {
    m_active = (Dialog)m_queue.elementAt(0);
    m_queue.removeElementAt(0);
    m_active.setDialogListener(this);
    m_display.setCurrent(m_active.getDisplayable());
    }
    }

    ...
    private Dialog m_active;
    private Vector m_queue; // Dialog queue

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    Any success with this problem?

    Having the same problem, has anyone got a useful workaround? Or is the only workaround not to use Display.setCurrent? (sigh)

    If anyone from Nokia is reading, I'd really rather poke my eyes out than develop another J2ME title for the 7650, and I suspect other developers here feel the same. Bugs like this one, along with the off-screen image drawing problems introduced in the 4.39(ish) firmware update make life completely impossible for the developer. It bugged me that you couldn't even acknowledge what changes had been made to the firmware between versions when someone asked on these forums. I can't wait to take delivery of the Siemens phone that our next (licensed) title will be developed for.

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    I might have got a solution for the battery bar / signal strength flickering problem on the 7650.

    I had this happen on top of the active screen after I switched to the phone menu or received an incoming call.

    It's never happened in any other software I've done until the app I'm currently working on now. The main difference between this new app and old ones is that I'm not using any Lists in this one - I've put all list functionality on a FullCanvas instead, and that's when it started happening. So I've tried creating a blank List object, displaying that, and then immediately after (literally straight away) I set the display to my FullCanvas. The list is never displayed, but neither are the flickering bars either... Oh, and you only have to do this once.

    Hope this helps.

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    Hi Guys,

    I had exactly the same problem, however, while searching through these forums I found a proposed solution to a memory issue which I have found also benefits this thread.

    There is a thread entitled '7650 and 3650 Canvas and FullCanvas memory', started by 'marcilgen'. It entails making a single class displayed throughout the application life which abstracts away the actual classes which are being swapped and displayed.

    In doing this the flicker is eliminated as you are not changing between FullCanvas classes.

    It is a little clumsy and creates a more tightly coupled class set than I would hope for but if you have an application which is already written and the flickering is a real pain then this may be a good half-way house solution.


    Regards,
    Lee

  9. #9
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    Hi dynamitemobile

    I'm facing this flickering problem too.... looks OK on the emulator but on the actul 3650, I can see the flicker with the signal and battery bar in-between screens.

    I mention abt a solution LIST, would you explain in more detail?

    Thanks!

  10. #10
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    To be honest, the above solution (From theimode) is the preferable one, but if you want a quick fix, try this:

    List loadlist = new List("Loading", List.IMPLICIT);
    Display.getDisplay(this).setCurrent(loadlist);

    I put this as the first bit of the run method in my midlet, and immediately after that set the FullCanvas class I use to be the current display. You never see the list, but there's no flicker either.

    You can't guarantee that it will work on later firmware revisions though, so it will most likely be best to use theimode's version.

  11. #11
    Registered User
    Join Date
    Aug 2003
    Posts
    43
    Thanks, dynamitemobile.
    Will try it and let you guys know if it work for me.

    Cheers!

  12. #12
    Registered User
    Join Date
    Apr 2003
    Posts
    25
    I tried dynamitemobile way and it didnt work - and doing what theimode suggested would mean too much work for me just to fix a problem with one device.

    Please post any success tho - as it would be usefull for future projects. Thanks.

  13. #13
    Registered User
    Join Date
    Mar 2003
    Posts
    12
    Hi alanjeeves,

    The solution sounds more complicated than it actual is. I've integrated it into an existing application and also as a much cleaner solution elsewhere.


    Thanks
    theimode

  14. #14
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    Hi dynamitemobile

    Tried but didn't work.
    At what stage did you display the list?
    Is it when the first FullCanvas is displayed?

    Thanks!

  15. #15
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Seattle, WA USA
    Posts
    53
    This may be a different problem, but I solved a flicker issue this way:

    Every time you do a setCurrent() call, set up a timer variable that waits about 1/2 second before doing any painting (e.g. decrement a counter in your timer tick loop, if you have one).

    Make sure that both conditions are met: 1) the timer has expired, and 2) isVisible() returns TRUE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×