×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Super Contributor
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546

    Exclamation Nokia E61i is caching Graphics of Canvas !!!

    I am running my project on Nokia E61i
    The project contains one class which extends Canvas. The job of this class is do display an Image with a String and change both the Image and the String whenever Canvas is shown. The logic is very simple. Before calling Display.setCurrent(), first change the Image as well as String. And then in paint(), just draw this Image and String.

    But I can see previous Image and String on the screen for less than a second and then I can see new Image.
    paint() is called only once.
    This implies that operating system is caching the Graphics of the Canvas. I don't want this to happen.

    Did somebody come across this behavior?
    What's the solution to it?

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Nokia E61i is caching Graphics of Canvas !!!

    What happens if you destroy the Canvas and create a new one?

  3. #3
    Super Contributor
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546

    Re: Nokia E61i is caching Graphics of Canvas !!!

    I didn't try it... but I think then this problem won't arise... but I will still try it and let you know

    I guess you are thinking that operating system has a common cache for all Canvas or different one... right?
    Actually I am jumping from one Canvas to another. So I think there is a separate cache for every Canvas and due to which if I destroy and create a new Canvas then this problem won't arise but may be some other problem... only God can say about problems in mobile application development.

    Actually, I am displaying this Canvas and then doing some processor hungry work in another thread.
    So sometimes the previous Image and String displays for more than 5 seconds also...

  4. #4
    Super Contributor
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546

    Re: Nokia E61i is caching Graphics of Canvas !!!

    I am able to get rid of this problem without creating a new Canvas

    Simple logic: Just don't start doing the processor hungry work in background until paint() is called. Because paint() will ensure that Screen is painted with latest Image and String. Truly speaking, this doesn't eliminate the problem completely... it just reduces the duration to about 1/10th of a second... that is acceptable because human can't notice it...

    But this is really bad... operating system should not cache Graphics of Canvas without programmer's permission... I hope Nokia will fix this in next version of operating system... (Nokia guys... please note)

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Nokia E61i is caching Graphics of Canvas !!!

    Quote Originally Posted by arpit2agrawal View Post
    I am able to get rid of this problem without creating a new Canvas

    Simple logic: Just don't start doing the processor hungry work in background until paint() is called. Because paint() will ensure that Screen is painted with latest Image and String. Truly speaking, this doesn't eliminate the problem completely... it just reduces the duration to about 1/10th of a second... that is acceptable because human can't notice it...

    But this is really bad... operating system should not cache Graphics of Canvas without programmer's permission... I hope Nokia will fix this in next version of operating system... (Nokia guys... please note)
    Hi,
    I have face this issue in my application.

    How are you moving between the multiple canvas.I guess you are moving like this -
    @ You draw the canvas lets say canvas_One
    @ Then you are drawing the next canvas...say canvas_Two..correct
    @ while you are drawing the second canvas,first it will be first displaying the canvas_one and then two..

    try to do one thing ..if you do not need the first then unload the same..
    One more thing..painting of entities of one canvas must be in the same..
    If you need not have the previous canvas then make it unload from the heap.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Nokia E61i is caching Graphics of Canvas !!!

    have u tried to check if ur mobile (thus canvas) supports doublebuffering (Canvas.isDoubleBuffered())? and if so, maybe there is a way to turn it off ?
    and u are mentioning paint() method but do u also use flushGraphics() ?

Similar Threads

  1. Nokia N-Series Complete Model Line-Up
    By Dopod in forum General Development Questions
    Replies: 6
    Last Post: 2008-07-22, 20:16
  2. Nokia PC Connectivity能否链接到cdma手机上发送短信和其他操作?
    By bborn in forum Web Technologies and Multimedia Content- Web 技术和多媒体内容
    Replies: 2
    Last Post: 2004-05-04, 11:06

Posting Permissions

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