Results 1 to 3 of 3

Thread: http ldownload large file to symbian device

  1. #1
    Join Date
    Nov 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Angry http ldownload large file to symbian device

    Hi

    Using this example i made it run on my N8 and E6 fine. As soon as a download starts of a large 100MB file, I see memory full errors pretty quickly. I have sufficent RAM (>128 MB) and sufficient disk (16GB).

    Now i think the problem is the readAll() when writing it.

    Qt Code:
    1. file->write(reply->readAll());
    To copy to clipboard, switch view to plain text mode 

    The actual write is the problem.

    This is not recommended for large files. So i created a simple buffer:

    Qt Code:
    1. QByteArray b(reply->readAll());
    2. int t = b.size();
    3. qDebug() << "sz1: " << t;
    4. const int BUFFER_SIZE = 4096;
    5. int s = 0;
    6. int tw = 0;
    7. while (s < t) {
    8. int c = file->write(b.mid(s, BUFFER_SIZE)); // <---
    9. qDebug() << "written: " << c;
    10. tw += c;
    11. s += BUFFER_SIZE;
    12. }
    To copy to clipboard, switch view to plain text mode 

    and even this does not work. Like 4K bufferred write should work? Even flushing() after the write makes the memory full come even quicker!
    I really need some help here please..

    thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: http ldownload large file to symbian device

    When are you calling this code?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: http ldownload large file to symbian device

    In the httpReadyRead(). It's exactly the same example in my OP ? http://qt-project.org/doc/qt-4.8/net...indow-cpp.html ?

    The original Qt example shows memory full on any of my Nokia belle devices. So I though maybe i need to modify and re-buffer the data that's ready. In the API it says don't use readAll() for large files. So what should we be using then for mobile devices? (I used the CODA debug to send the app to my N8 and E6)

    thank you

Similar Threads

  1. How to play an audio file in the symbian device?
    By satya@sipl in forum Newbie
    Replies: 1
    Last Post: 19th July 2012, 07:45
  2. stylesheet not changing on Symbian^3 device
    By Ceaser88 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 1st August 2011, 11:55
  3. Replies: 0
    Last Post: 28th June 2011, 03:16
  4. given example HTTP not opened in N8 device???
    By chandantheracer in forum Newbie
    Replies: 0
    Last Post: 22nd March 2011, 05:35
  5. Symbian On-Device Debugging
    By Granty in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 19th October 2010, 13:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.