×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    32

    Question Downloading large amount of data

    Hi all


    I am making one j2me application in which application will download large amount of data around 3MB at the start of application and use the same at later stage in application.so my question is how i will come to know that much amount of memory is available or not where i am saving downloaded data.So please help me...how i will come to know if memory is full or sufficient memory is not available

    Thanks in advance.
    Swapnil Desai
    TELiBrahma Softwares,
    Bangalore.

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

    Re: Downloading large amount of data

    You can get the available and used memory in mobile with the help of the java runtime.
    You can find the below code of much helpful.You can take a form and set this as the displayable in the midlet, some of the code segment is..
    Runtime runTime = Runtime.getRuntime();
    form.append("Total memory: " + runTime.totalMemory());
    form.append("Free memory: " + runTime.freeMemory());
    display.setCurrent(form);
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    32

    Re: Downloading large amount of data

    Hi raj thanks for your reply.
    actually i am not looking for run time memory but i am asking about memory available on the device to store downloaded data.it can be phone memory i.e.gallery or memory card.i am downloading data from server and saving in local memory so how i will get to know sufficient memory is available or not on the device.or while saving data if memory becomes full then??
    Swapnil Desai
    TELiBrahma Softwares,
    Bangalore.

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

    Re: Downloading large amount of data

    Raj's advice is important... if you're downloading by HTTP, you won't be able to download more data than you have available heap memory.

    What device(s) are you planning to use?

    Graham.

  5. #5
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Downloading large amount of data

    I am making one j2me application in which application will download large amount of data around 3MB at the start of application and use the same at later stage in application.so my question is how i will come to know that much amount of memory is available or not where i am saving downloaded data.So please help me...how i will come to know if memory is full or sufficient memory is not available
    Hi Swapnil,

    if you are using RMS to store this data, try rs.getSizeAvailable()to see if you have the required space in your recordstore to save this much data.

    thanks,
    Ekta

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

    Re: Downloading large amount of data

    Hey guy's,
    Kindly note that his requirement is to save the data of few MB, you can read this quoted paragraph.
    am making one j2me application in which application will download large amount of data around 3MB at the start of application and use the same at later stage in application.so my question is how i will come to know that much amount of memory is available or not where i am saving downloaded data.So please help me...how i will come to know if memory is full or sufficient memory is not available
    SO RMS will not be the solution for such a need.He has to save the data in the File system of the device.

    And as swap842 ask -
    actually i am not looking for run time memory but i am asking about memory available on the device to store downloaded data.it can be phone memory i.e.gallery or memory card.i am downloading data from server and saving in local memory so how i will get to know sufficient memory is available or not on the device.or while saving data if memory becomes full then??
    Last edited by raj_J2ME; 2010-05-13 at 06:28.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Downloading large amount of data

    If you problems or your datasize is too large to store in RMS, you can go for JSR-75 FCA API and use -- File Connection. availableSize() to get to know the available free memory on the device filesystem in the selected drive.

    availableSize


    public long availableSize()
    Determines the free memory that is available on the file system the file or directory resides on. This may only be an estimate and may vary based on platform-specific file system blocking and metadata information.
    Returns:
    The available size in bytes on a file system, or -1 if the file system is not accessible.
    Throws:
    java.lang.SecurityException - if the security of the application does not have read access to the root volume.
    IllegalModeException - if the application does have read access to the directory but has opened the connection in Connector.WRITE mode.
    ConnectionClosedException - if the connection is closed.

    thanks,
    Ekta

  8. #8
    Registered User
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    32

    Re: Downloading large amount of data

    Hi raj and ekta



    Thanks for your information this will help me in developing my application.
    Swapnil Desai
    TELiBrahma Softwares,
    Bangalore.

Similar Threads

  1. retrieving large amount of data from a XML file
    By sunitha.m13 in forum Symbian
    Replies: 14
    Last Post: 2012-02-09, 12:19
  2. Replies: 6
    Last Post: 2009-12-11, 12:15
  3. Large data transfer
    By sourav_kumar97 in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2008-11-03, 09:03
  4. Measure the amount of data traffic
    By heuven in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-08-03, 08:31
  5. Sending large data via Bluetooth sockets
    By yellow27 in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-12-18, 03:59

Posting Permissions

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