×

Discussion Board

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

    Can I create a file on the mobile device ?

    Dear Sir ,
    I'm not able to create a file on my mobile device ... The application is working well on the emulator ... I'm using N95 ...
    Can u pls tell me what is d prob ?

    Thanks
    Nanditha

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,563

    Re: Can I create a file on the mobile device ?

    Quote Originally Posted by nandyiyer View Post
    Dear Sir ,
    I'm not able to create a file on my mobile device ... The application is working well on the emulator ... I'm using N95 ...
    Can u pls tell me what is d prob ?

    Thanks
    Nanditha

    Hi Nanditha..Welcome to the Forum!!

    Well actually I might be not be of help to your specific needs, but the information you have provided is too little for anybody to help. Why not check this and give more information so that somebody can provide you a specific solution

    Good Luck!!

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Can I create a file on the mobile device ?

    Hi Nandita ,

    You can create the files in your mobile phone if and only if your mobile supports jsr75 i.e FileConnection API . With that you can create the file.

    For more information . Go through this post in forum

    http://discussion.forum.nokia.com/fo...FileConnection


    public boolean writeFile(String path, byte[] data)
    {
    javax.microedition.io.Connection c = null;
    java.io.OutputStream os = null;
    try {
    c = javax.microedition.io.Connector.open("file:///" + path, javax.microedition.io.Connector.READ_WRITE);
    javax.microedition.io.file.FileConnection fc =
    (javax.microedition.io.file.FileConnection) c;
    if (!fc.exists())
    fc.create();
    else
    fc.truncate(0);
    os = fc.openOutputStream();
    os.write(data);
    os.flush();
    return true;
    } catch (Exception e) {
    return false;
    } finally {
    try {
    if (os != null)
    os.close();
    if (c != null)
    c.close();
    } catch (Exception ex) {
    ex.printStackTrace();
    }
    }
    }

Similar Threads

  1. Unable to install the self certification sis file on Nokia E60 device
    By manjunaths in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 22
    Last Post: 2009-09-24, 07:09
  2. Mobile Virus Info and Solution
    By kunalshastry in forum General Development Questions
    Replies: 16
    Last Post: 2007-08-07, 11:12
  3. Replies: 10
    Last Post: 2007-07-02, 06:28
  4. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 06:26
  5. Replies: 11
    Last Post: 2005-05-20, 10:09

Posting Permissions

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