This discussion is archived
8 Replies Latest reply: Oct 6, 2010 8:05 AM by 762917 RSS

Direct Manipulation in a File

802662 Newbie
Currently Being Moderated
Hi,

I am using Netbeans as IDE and I want to develop an application for mobile phone to change some bits of Images for Steganography.

my question is, can i have permission of direct access to change and save some bits of image, while i don't have license?

Thanks
  • 1. Re: Direct Manipulation in a File
    tschodt Pro
    Currently Being Moderated
    Hesam wrote:
    I am using Netbeans as IDE and I want to develop an application for mobile phone to change some bits of Images for Steganography.

    my question is, can i have permission of direct access to change and save some bits of image, while i don't have license?
    Are you asking how to access arbitrary bytes in a file using Java?
    Or is this a question about filesystem permissions? (nothing to do with Java).
    Or are you asking if you legally allowed to alter an image for which you do not have a license to use? (nothing to do with Java).
    Or something else?
  • 2. Re: Direct Manipulation in a File
    802662 Newbie
    Currently Being Moderated
    Wow,

    OK. Actually, as you told, I want to manipulate arbitrary bits of image. I think it is possible since image is saved in RAM.

    now, I want to save it (this manipulated image) on ROM again.

    My question is here, can I save the image on ROM?

    I have read in some websites that I can't save anything on ROM (because of security issues), if don't sign my application.
    and also, I heard that to sign of application, I have to pay. because this is a student project, I don't want to pay anything.

    So, my question is can I save the image (or any other file such as text files) on ROM, without application sign?

    Thanks again.
  • 3. Re: Direct Manipulation in a File
    tschodt Pro
    Currently Being Moderated
    Your terminology seems out of whack.
    The whole point of [url http://en.wikipedia.org/wiki/Read-only_memory] ROM (wiki link) is that you cannot write to it.
    Or does ROM mean something else in mobile phone lingo?
  • 4. Re: Direct Manipulation in a File
    802662 Newbie
    Currently Being Moderated
    yes, you are right, I couldn't express very well.

    How is this?
    1- I want to load a image file (from EEPROM, Flash or any other technology which is currently used) into memory (RAM).

    2- Manipulating some bits of it.

    3- Save again in its location.


    Is it possible or not?
  • 5. Re: Direct Manipulation in a File
    DarrylBurke Guru Moderator
    Currently Being Moderated
    <font size="2">To access the file system, the device must support the optional FileConnection API (JSR-75) and  the MIDlet has to be signed, which costs money.</font>


    db
  • 6. Re: Direct Manipulation in a File
    762917 Newbie
    Currently Being Moderated
    This can be helpful to you, check it:
    http://download-llnw.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/index.html

    I search a little about Steganography and what you are trying to do, maybe this can be helpful:
    public class ImmutableImageFromByteArray extends MIDlet  implements CommandListener
    {
      private Display display; 
      private Form fmMain;         // The main form
      private Command cmExit;
    
      public ImmutableImageFromByteArray()
      {
        display = Display.getDisplay(this);
    
        cmExit = new Command("Exit", Command.EXIT, 1);
            
        fmMain = new Form("");    
        fmMain.addCommand(cmExit);
        fmMain.setCommandListener(this);   
    
    
        fmMain.append(new ImageItem(null, imColor, ImageItem.LAYOUT_NEWLINE_BEFORE |ImageItem.LAYOUT_CENTER,   null));      
    //    fmMain.append(imColor);
        
        display.setCurrent(fmMain);
    
      }
    
    private static Image imColor = Image.createImage(
        new byte[] {
          (byte)0x89, (byte)0x50, (byte)0x4E, (byte)0x47, (byte)0x0D, (byte)0x0A, (byte)0x1A, (byte)0x0A, 
          (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0D, (byte)0x49, (byte)0x48, (byte)0x44, (byte)0x52, 
          (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x4F, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x13, 
          (byte)0x08, (byte)0x06, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0xA6, (byte)0x7F, (byte)0x60, 
          (byte)0x9C, (byte)0x00, (byte)0x00, (byte)0x06, (byte)0xBA, (byte)0x49, (byte)0x44, (byte)0x41, 
          (byte)0x54, (byte)0x78, (byte)0x9C, (byte)0xAD, (byte)0x58, (byte)0x7F, (byte)0x6C, (byte)0x1B, 
          (byte)0xF5, (byte)0x15, (byte)0xFF, (byte)0x5C, (byte)0x92, (byte)0x2A, (byte)0x4B, (byte)0xCB,
          .
          .
          .
          .
        },
        (int)0,
        (int)1779
    );
    In the link at the top you can find how this method works.
    i hope this can help you.
  • 7. Re: Direct Manipulation in a File
    802662 Newbie
    Currently Being Moderated
    Wow Goariz, Thanks So much.

    It helps me alot. one thowsend and one times thanks :)

    Edited by: Hesam on Oct 6, 2010 11:37 AM
  • 8. Re: Direct Manipulation in a File
    762917 Newbie
    Currently Being Moderated
    Youre welcome but, you can thank me marking your question like answer and give some points.

    Thanx.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points