×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    4

    series 40 download problems

    I'm using a http connection to download data paks from server. This works fine for sprint phones. On nokia series 40 phone the data I download seems to be junk.

    Step one connect and download text file listing files available.
    This seems to work fine.
    Step two download and store in rms a binary data pak.

    Can I not download binary? why is my second download gibberish?

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    Yes, you can transfer binary data. How much data are you talking about? It might help to see the code you are using to perform the download.

    Graham.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    4

    More Info

    Heres a snippet of code. This is how I initialize connection. This gets called twice. First time to get list of files and sizes and second time to actually get file. Ultimately I want to get this to work with files close to 20k in size but for right now I'm testing with 10k and 8k file sizes. My game is very memory intensive but thats not an issue here because I have almost zero art loaded. I'm using 512k records because my downloaded data pack is full of many small text files and a few large pieces of art.
    ( compressed ).


    m_cSocket = null;
    m_is = null;
    m_os = null;
    m_iBytesDownloaded = 0;
    String sServer = "http://" + SERVER + FILEPATH + m_sDifficultySetting + m_sDownloadPath;

    System.out.println( "path = " + sServer );
    try {
    m_cSocket = ( HttpConnection )Connector.open( sServer, Connector.READ_WRITE );
    System.out.println( "Trying to connect" );
    }
    catch ( Exception e )
    {
    m_iNetMenuState = NETMENU_ERROR;
    m_iNetError = ERROR_NOSERVICE;

    System.out.println( "FAILED to connect" );
    return false;

    }
    return true;


    Thanks for looking.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395
    You're saying "512k"... I do hope you mean "512 bytes"!

    I do apologize, I meant the code that gets the data. This code doesn't really do anything as, surprisingly, Connector.open() does not actually establish a connection. The phone doesn't connect until it needs data from the server, usually when you use getResponseCode() or openInputStream().

    I'd really need to see the code from opening the input stream until it's closed again. If that's not something you want to post here, click the "profile" button at the bottom of one of my posts and you can email me.

    Graham.

Posting Permissions

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