×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Post deleting the old jar file after downloading the new once.

    Hi all,

    I used the platfomrequest method to update the jar file on the mobile.
    But after downloading the jar file the old jar file is also retained.

    I want that the new jar file should delete the old once and it will be even great if
    it deletes only the jar file and not the rms files which has been used by the old jar file

    Is is possible?

    Thanks,
    Suraj

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by suraj03 View Post
    Hi all,

    I used the platfomrequest method to update the jar file on the mobile.
    But after downloading the jar file the old jar file is also retained.
    Are you using same MIDlet name for both MIDlets ?

    Regards
    Gopal

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: deleting the old jar file after downloading the new once.

    Keep the jar file name and application midlet name as same, it will delete the old JAR and ask user for upgrade and keep the database.
    Do not forget to exit the old app just after the platfomrequest.

    On which device are you trying it ?
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  4. #4
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by im2amit View Post
    Keep the jar file name and application midlet name as same, it will delete the old JAR and ask user for upgrade and keep the database.
    Do not forget to exit the old app just after the platfomrequest.

    On which device are you trying it ?
    on Nokia 2700 classic

    "Do not forget to exit the old app just after the platfomrequest."

    what do you mean by above statement?

    "Actually when I do the plataform request it starts downloading the new once and once the download is complete it diverts me to the new jar retaining the old once in the memory"

  5. #5
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by im2amit View Post
    Keep the jar file name and application midlet name as same, it will delete the old JAR and ask user for upgrade and keep the database.
    Do not forget to exit the old app just after the platfomrequest.

    On which device are you trying it ?
    "Do not forget to exit the old app just after the platfomrequest."

    What do you mean by the above statement ?
    How to exit the previous app?

    Thanks,
    Suraj

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

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by suraj03 View Post
    "Do not forget to exit the old app just after the platfomrequest."

    What do you mean by the above statement ?
    How to exit the previous app?

    Thanks,
    Suraj
    He is talking about the MIDlet which is gonna invoke the platform request,

    Java ME docs says:
    This is a non-blocking method. In addition, this method does NOT queue multiple requests. On platforms where the MIDlet suite must exit before the request is handled, the platform MUST handle only the last request made. On platforms where the MIDlet suite and the request can be handled concurrently, each request that the MIDlet suite makes MUST be passed to the platform software for handling in a timely fashion.

    If the URL specified refers to a MIDlet suite (either an Application Descriptor or a JAR file), the application handling the request MUST interpret it as a request to install the named package. In this case, the platform's normal MIDlet suite installation process SHOULD be used, and the user MUST be allowed to control the process (including cancelling the download and/or installation). If the MIDlet suite being installed is an update of the currently running MIDlet suite, the platform MUST first stop the currently running MIDlet suite before performing the update. On some platforms, the currently running MIDlet suite MAY need to be stopped before any installations can occur.
    Parameters:
    URL - The URL for the platform to load. An empty string (not null) cancels any pending requests.
    Returns:
    true if the MIDlet suite MUST first exit before the content can be fetched.
    Throws:
    ConnectionNotFoundException - if the platform cannot handle the URL requested.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by raj_J2ME View Post
    He is talking about the MIDlet which is gonna invoke the platform request,

    Java ME docs says:
    Hi

    Based on the suggestion provided by you all I had done some testing on my application.

    I am using the netbeans 6.9.1

    In the application descriptor( which is in properties)
    For Attributes tab I set the following configuration

    Midlet Name --->Customers
    Midlet-Vendor--->Vendor
    Midlet-version--->1.0

    For Midlets tab I set the following configuration

    Name ---> Customers
    class ----> Customer
    Icon ------>

    After doing the above changes I build the application and than uploaded the jar file on the server. I then downloaded the jar file on my mobile(Nokia 2700 classic)
    I than used the application and made sure that the appln creates the rms file.

    My next step was to change the version no in the application descriptor to 1.1 and to build the new jar file and to upload it on the server

    In the application I had used the platform request function.
    so from the application I made the platform request.This action downloaded the new jar file but retained the old once
    and even the new file could'nt connect to the rms created by the old file.

    thanks,
    Suraj



    .

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: deleting the old jar file after downloading the new once.

    This might be happening as the Midlet is already running in the background hence its not updated, just on the line next to the platformRequest - call DestoryApp(true); to close the midlet before the new jar is downloaded to the device, this might help.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  9. #9
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by im2amit View Post
    This might be happening as the Midlet is already running in the background hence its not updated, just on the line next to the platformRequest - call DestoryApp(true); to close the midlet before the new jar is downloaded to the device, this might help.
    Hi
    I tried your suggestion (ie destroyApp) but it is not working.

    When I do the platform request,it does not give me output as true
    Secondly does this issue is related to signing of appln as I had not done that

    thanks
    Suraj

  10. #10
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by suraj03 View Post
    Secondly does this issue is related to signing of appln as I had not done that
    I dont think this issue is because of Signing.

    Regards
    Gopal

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

    Re: deleting the old jar file after downloading the new once.

    Did you try to exit the installer app, the one which is calling the Platform Request?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  12. #12
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Quote Originally Posted by raj_J2ME View Post
    Did you try to exit the installer app, the one which is calling the Platform Request?
    Hi

    Thats what I want to know

    Mr.Amitabh had suggested me to use destroyApp() function which did'nt worked or I might have done some mistake while using it

    thanks,
    Suraj

  13. #13
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    Hi

    Does anybody knows the answer for my question?

    thanks,
    Suraj

  14. #14
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: deleting the old jar file after downloading the new once.

    which device you are trying it using Midlet.DestoryApp(true); it will exit this midlet and every thing will go good.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  15. #15
    Regular Contributor
    Join Date
    Jul 2011
    Posts
    54

    Re: deleting the old jar file after downloading the new once.

    i am trying on nokia 2700 classic.

Similar Threads

  1. Problem while Downloading JAR and JAD File from the server
    By senthil_25 in forum Mobile Java General
    Replies: 3
    Last Post: 2011-04-06, 08:40
  2. Regarding not properly downloading the .jar file extension
    By samselvan in forum Mobile Java General
    Replies: 2
    Last Post: 2011-01-06, 13:04
  3. Replies: 3
    Last Post: 2010-08-25, 07:20
  4. Replies: 2
    Last Post: 2009-10-07, 20:44
  5. is the Jar file downloaded OTA deleted after installation?
    By KevinBoyd in forum Mobile Java General
    Replies: 3
    Last Post: 2009-09-07, 15:50

Posting Permissions

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