×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    1

    How to replace resource file in jar file by other image files.

    Can I replace resource files (ex: some jpeg file which is in the jar file)by other image files when midlet execute on the phone. Is it possible?

    Usualy, we use 'getResourceAsStream(filename)' to get resource data as stream.
    Is there some API function like 'setResource(filenmae,stream)' ??

    Assume that I have a javaME application which displays some image in the jar file. It is different from general image viewr program because it can display only image file in the jar file (it means image file is resource file of java applcation).
    In other words, when application executes, It shows always same image at first.but I want that user can change image displayed if user wnat to do. I want to embed authoring function into application. So user can change resource file on the phone.

    How to do that? Thank in advance.

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

    Thumbs up Re: How to replace resource file in jar file by other image files.

    Hi,
    Well ! I dont think think so it can be done. Means you cannot change the same image at runtime.Like at runtime you might be lookin lets say.. that lets change the image color...right..

    if anyone have any concept then share it here...

    thnxs.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,561

    Re: How to replace resource file in jar file by other image files.

    You could embed/include a separate "resource" file inside the .jar and then at run-time use JSR-75 to create a file that's external to the application (save the internal "resource" file to an external file).

    Then you can have the application read images and other stuff from the external file, and use those (and also at runtime, or depending on where you put it, allow the application user to change the "resources" in this external file).

Similar Threads

  1. Extracting/Re-Packaging a JAR file
    By thatch8 in forum Mobile Java General
    Replies: 0
    Last Post: 2007-06-12, 13:04
  2. Replies: 1
    Last Post: 2005-05-26, 14:22
  3. Resource file
    By hicheri in forum Symbian
    Replies: 2
    Last Post: 2005-02-24, 20:25
  4. Loading Image data from 'raw' bytes
    By LongSteve in forum Mobile Java General
    Replies: 2
    Last Post: 2002-11-20, 17:38
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

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