You Are Here:

Community: Developer Discussion Boards

#1 Old Read File from Phone Memory - 2006-06-29, 19:19

Join Date: Jun 2006
Posts: 50
decisor
Offline
Regular Contributor
Hi,

I'm developing an application for Series 40 and I want to know if I can read a file from Phone Memory or Card Memory should do to.

I've search in the internet and i see FileConnection class. Can I use it?

I'm testing on Nokia 6230 and 6230i. The FileConnection do not work so well.

I use this function that I found in internet:
Code:
private void LoadFile(){
        try {
            FileConnection fc = (FileConnection) Connector.open("file:///CFCard/");
            // Get a filtered list of all files and directories.
            // True means: include hidden files.
            // To list just visible files and directories, use
            // list() with no arguments.
            System.out.println
                    ("List of files and directories under CFCard:");
            Enumeration filelist = fc.list("*", true);
            while(filelist.hasMoreElements()) {
                String fileName = (String) filelist.nextElement();
                fc = (FileConnection)
                Connector.open("file:///CFCard/" + fileName);
                if(fc.isDirectory()) {
                    System.out.println("\tDirectory Name: " + fileName);
                } else {
                    System.out.println
                            ("\tFile Name: " + fileName +
                            "\tSize: "+fc.fileSize());
                }
                
            }
            fc.close();
        } catch (IOException ioe) {
            System.out.println(ioe.getMessage());
        }
        
    }
Can anyone help me?



thanks,
decisor
Reply With Quote

#2 Old Re: Read File from Phone Memory - 2006-06-29, 20:21

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
6230 does not have FIle Connection API. 6230i should have it.

Also check this document on how to use FileConnection API (there is an example midlet included) http://www.forum.nokia.com/info/sw.n...Notes.txt.html
Reply With Quote

#3 Old Re: Read File from Phone Memory - 2006-06-30, 06:26

Join Date: Feb 2006
Posts: 689
soku123
Offline
Super Contributor
Hi,
In the phones you have specified,you can access only certain folders under the Gallery.So ensure the folders that you can access and also check the path for file connection.
Thanks
Soku
Reply With Quote

#4 Old Re: Read File from Phone Memory - 2006-06-30, 16:51

Join Date: Mar 2006
Posts: 518
wang_shui
Offline
Super Contributor
Hi,

Here is a tutorial for fileconnection api
http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

Wang
Reply With Quote

#5 Old Re: Read File from Phone Memory - 2006-06-30, 17:02

Join Date: Apr 2003
Posts: 6,408
Location: USA, CA
hartti's Avatar
hartti
Offline
Nokia Expert
Ouch, thanks wang!
I just realized that my post above contains a totally wrong like (thanks to an attempted multitasking...).

Decisor, please disregard the link in my post (2nd in this thread), that was not related to this thread.

Hartti
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Read from a text file razas General Symbian C++ 2 2005-09-12 08:23
socket read hangs until socket is closed camroe Mobile Java Networking & Messaging & Security 1 2005-07-21 10:44
Sending .jpg file from phone to PC ja_calulot General Symbian C++ 0 2003-09-06 10:34
Some memory related and other issues sanjg2k1 General Discussion 0 2003-07-07 18:38
Forward Locking .dm file to a 3650 phone tsyme Digital Rights Management & Content Downloading 1 2003-04-11 09:11

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia