0 Replies Latest reply: Nov 27, 2010 12:53 AM by 819081 RSS

    Setting path in Midlet application

    819081
      Sear All,

      I'm new to Midlet programming, I tried to create an application which checks if a file exists or not, it works perfect when I use the simulator, but when U send the JAR file to the mobile it always display a msg that the file does not exist!!

      The code is as follow:
      try {

      Connector.openDataOutputStream("file:///C:/J2ME.jpg");
      if (fCon.exists()){
      append("Found\n");
      }
      else {
      append("Not Found\n");
      }
      }
      catch(Exception e){
      System.out.println("Error");
      System.out.print("Error: " + e.getMessage());
      }


      When I try this it works, but when I change the path to

      file:///SDCard/J2ME.jpg

      to be used on mobile I get always Not found msg....



      Help please,,


      Greetings