×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    download routine in a separate thread to avoid app from hanging?

    Dear forum,
    i do have my first tries on download routines. My test application should be able to download a picture from a server. I noticed, that my app is hanging as long as the download is in progress.

    Now my question to you guys:
    Do I get better results by creating a separat download thread?
    Does it make any sense at all to create a separate thread for that?
    Is there an example on using a thread for downloads somewhere?

    Thx a lot
    novis

  2. #2
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: download routine in a separate thread to avoid app from hanging?

    Could anyone share his/her precious experience?
    Any idea is welcome.

    regards
    novis

  3. #3
    Regular Contributor
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323

    Re: download routine in a separate thread to avoid app from hanging?

    Quote Originally Posted by novis View Post
    My test application should be able to download a picture from a server. I noticed, that my app is hanging as long as the download is in progress.
    If you call your download function from menuentry, your GUI shouldn't hang.

    Code:
    def do_download():
      # do downloading here
      # and perhaps showing picture with
      # appuifw.Content_handler()
    
    appuifw.app.menu = [(u"download", do_download)]

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    153

    Re: download routine in a separate thread to avoid app from hanging?

    Thx aaaaapo,
    i'll try this. But my intention is to trigger the download by a certain event (after a certain time). So a direct user action is not involved.
    Is there a nother way but to manual choose an option from a menuentry

    thx
    novis

  5. #5
    Regular Contributor
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323

    Re: download routine in a separate thread to avoid app from hanging?

    Quote Originally Posted by novis View Post
    - - my intention is to trigger the download by a certain event (after a certain time). So a direct user action is not involved.
    Then you can probably use
    Code:
    thread.start_new_thread(do_download, ())
    Find some python's thread examples from the web.

Similar Threads

  1. S60 SDK 3rd edition FP1 Emulator problem
    By justteam in forum Symbian Tools & SDKs
    Replies: 14
    Last Post: 2010-03-23, 08:47
  2. How can I avoid Files download from others
    By chen_walter in forum Digital Rights Management & Content Downloading
    Replies: 0
    Last Post: 2004-08-09, 15:02
  3. Nokia 6610 starts to download Java App, then cuts out
    By dmford in forum Mobile Java General
    Replies: 3
    Last Post: 2002-12-18, 21:46
  4. Which SDK to download for 7650 MIDP app
    By huiben in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2002-11-24, 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
  •  
×