Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User josephcarmel's Avatar
    Join Date
    Feb 2009
    Posts
    7
    my application works good in default gray phone(midp2,cldc1.1)

    same application is not working in default colour phone(midp2,cldc1.1)

    here is the code

    pls help...........thx in advc.............



    public void myaxe() throws IOException
    /////function
    {

    fc = (FileConnection)Connector.open("file:///root1/myfile.txt",Connector.READ_WRITE);

    //fc.create();

    InputStream is = fc.openInputStream();

    int i = 0;

    while((i = is.read())!=-1)

    {

    char s = (char)i;

    System.out.println("================================= "+s);

    //i++;

    }

    fc.close();

    is.close();

    }
    ==================================

    public void startApp() {

    try {

    myaxe();
    //////////fuction call
    } catch (IOException ex) {

    ex.printStackTrace();

    }

    if (midletPaused) {

    resumeMIDlet ();

    } else {

    initialize ();

    startMIDlet ();

    }

    midletPaused = false;

    }
    ============================================
    public void commandAction(Command command, Displayable displayable) {

    // write pre-action user code here

    if (displayable == form) {

    if (command == backCommand) {

    // write pre-action user code here

    exitMIDlet();

    // write post-action user code here

    } else if (command == okCommand) {

    // write pre-action user code here

    System.out.println("=============================== before call======================");

    Thread t = new Thread()

    {

    public void run()

    {

    try

    {

    myaxe();
    ///////second call
    }

    catch (Exception e)

    {

    e.printStackTrace();

    }

    }

    };

    t.start();





    // write post-action user code here

    }

    }

    ===============================================
    here are the errors i got

    error on first call
    =====================================
    java.io.IOException:

    at com.sun.midp.io.j2me.file.Protocol.openInputStream(Protocol.java:183)

    at com.sun.midp.io.j2me.file.Protocol.openInputStream(+9)

    at fileconn.myaxe(fileconn.java:230)

    at fileconn.startApp(fileconn.java:198)

    at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)

    at com.sun.midp.midlet.Scheduler.schedule(+270)

    at com.sun.midp.main.Main.runLocalClass(+28)

    at com.sun.midp.main.Main.main(+80)


    error on sec call
    ==============================================




    java.io.IOException:

    at com.sun.midp.io.j2me.file.Protocol.openInputStream(Protocol.java:183)

    at com.sun.midp.io.j2me.file.Protocol.openInputStream(+9)

    at fileconn.myaxe(fileconn.java:230)

    at fileconn$1.run(fileconn.java:109)


    pls help its very urgent ...........thx once again.........

  2. #2
    Registered User josephcarmel's Avatar
    Join Date
    Feb 2009
    Posts
    7
    both phone root contains the file myfile.txt

  3. #3
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    Hi,
    Is you file get created there in root1...

    your can check the link -
    http://www.java-tips.org/java-me-tip...nnectio-2.html
    Last edited by raj_J2ME; 2009-03-25 at 06:14.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Nokia Developer Champion jitu_goldie's Avatar
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330
    Hi,
    root folder of every emulator is different. Please check that the file which u read is placed at root folder of defaultcolor emulator or not.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  5. #5
    Registered User josephcarmel's Avatar
    Join Date
    Feb 2009
    Posts
    7
    i have checked the roots of both emulator both has the file,

    com.sun.midp.io.j2me.file.Protocol.openInputStream:::: is there any prob with input stream

    when i check fc.exist() it return false , but actually there is the file

    am using netbean 6.5 & jwtk

    the same application is working perfectly with gray phone

    pls do something

  6. #6
    Nokia Developer Champion jitu_goldie's Avatar
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330
    Hi,

    Quote Originally Posted by josephcarmel View Post
    i have checked the roots of both emulator both has the file,

    com.sun.midp.io.j2me.file.Protocol.openInputStream:::: is there any prob with input stream

    when i check fc.exist() it return false , but actually there is the file

    am using netbean 6.5 & jwtk

    the same application is working perfectly with gray phone

    pls do something
    inputStream is opened correctly. Problem is quite unfamiliar to me too that why it returns false even when file is present. Lets try on device.
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. How to make phone call without default phone UI?
    By ppiggy in forum Symbian C++
    Replies: 7
    Last Post: 2006-03-31, 07:56
  2. Replies: 0
    Last Post: 2006-02-18, 18:42
  3. code is not working in the phone...
    By hegdeshashi in forum Symbian C++
    Replies: 1
    Last Post: 2005-11-15, 07:25
  4. Phone App listed in TApaTaskList?
    By teamore in forum Symbian C++
    Replies: 3
    Last Post: 2004-10-04, 13:59
  5. shutdown the phone app?
    By nmnir in forum Symbian C++
    Replies: 1
    Last Post: 2004-09-27, 04:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved