Skip to main content

Java ME File Browser?

6 replies [Last post]
Anonymous

Hi,

I'm possibly about to take on a project, part of which involves
getting the user to browse for files on their phone from a MIDlet.

I've check out the javax.microedition.io.file package which all seems
reasonably self-explanatory, what I can't see in there though is any
kind of access to the default file browser on the phone. Does any
such thing exist in any of the optional packages or will I have to
write the UI from scratch?

I'm thinking of something that works similar to java.awt.FileDialog,
so I can just launch the default file browser and get a reference to
the file the user selects...

cheers

====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

James,

There is no file dialog in MIDP because access to the file system is not a standard feature of MIDP in particular (or many entry-level and mid-range phones in general). For the same reason there is no standard way to access the built-in file dialog, if present.

Using the JSR 75 package, as you mention, you have access to the file system - the question is, how to present a file dialog graphically. You could of course use MIDP lcdui.List and/or lcdui.CustomItem. But for a richer experience you might look at basing your app on LWUIT:

https://lwuit.dev.java.net/

It contains support for building rich screens - but unfortunately no ready-to-use file dialog. However, the project owners are very open to suggestions ... maybe they want to pick up the idea of a file dialog.

-- Terrence

Jonathan Knudsen

Hi James,

I've been researching the trials of real-world deployment and was
wondering if you could answer a couple questions for me.

Have you made any progress on this? I'm curious to know your plans for
deploying this, because it's my understanding (I could be wrong) that
FileConnection access is denied for Untrusted and Trusted Third Party
protection domains. Do you expect to be able to sign this MIDlet to
get it into the Manufacturer or Operator domains?

Thanks,
Jonathan

On May 20, 2008, at 4:47 AM, James Closs wrote:
> Hi,
>
> I'm possibly about to take on a project, part of which involves
> getting the user to browse for files on their phone from a MIDlet.
>
> I've check out the javax.microedition.io.file package which all
> seems reasonably self-explanatory, what I can't see in there though
> is any kind of access to the default file browser on the phone. Does
> any such thing exist in any of the optional packages or will I have
> to write the UI from scratch?
>
> I'm thinking of something that works similar to java.awt.FileDialog,
> so I can just launch the default file browser and get a reference to
> the file the user selects...
>
> cheers
>
> ====
>
> James Closs, Director, bitBull Ltd
>
> http://www.bitbull.com
>
> 07771 991171
>
> ====
>
> =
> =
> =
> =
> =
> =
> =
> ====================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in
> the body of the message "signoff KVM-INTEREST". For general help,
> send email to listserv@java.sun.com and include in the body of the
> message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Ian Strain

FileConn access is not denied on all devices, there are some that will
display a security dialog box that will require the user to accept a
file connection and having the midlet signed in the third party trusted
domain will enable the user to change the midlet permissions in the
properties.
I know that Sony Ericsson, blackberry, nokia acts like this and that
Motorola require a manufacturer or operator cert.

Jonathan Knudsen wrote:
> Hi James,
>
> I've been researching the trials of real-world deployment and was
> wondering if you could answer a couple questions for me.
>
> Have you made any progress on this? I'm curious to know your plans for
> deploying this, because it's my understanding (I could be wrong) that
> FileConnection access is denied for Untrusted and Trusted Third Party
> protection domains. Do you expect to be able to sign this MIDlet to
> get it into the Manufacturer or Operator domains?
>
> Thanks,
> Jonathan
>
> On May 20, 2008, at 4:47 AM, James Closs wrote:
>> Hi,
>>
>> I'm possibly about to take on a project, part of which involves
>> getting the user to browse for files on their phone from a MIDlet.
>>
>> I've check out the javax.microedition.io.file package which all seems
>> reasonably self-explanatory, what I can't see in there though is any
>> kind of access to the default file browser on the phone. Does any
>> such thing exist in any of the optional packages or will I have to
>> write the UI from scratch?
>>
>> I'm thinking of something that works similar to java.awt.FileDialog,
>> so I can just launch the default file browser and get a reference to
>> the file the user selects...
>>
>> cheers
>>
>> ====
>>
>> James Closs, Director, bitBull Ltd
>>
>> http://www.bitbull.com
>>
>> 07771 991171
>>
>> ====
>>
>> ===========================================================================
>> To unsubscribe, send email to listserv@java.sun.com and include in
>> the body of the message "signoff KVM-INTEREST". For general help,
>> send email to listserv@java.sun.com and include in the body of the
>> message "help".
>
> ===========================================================================
>
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Ian Strain

no, you'll have to make it yourself

James Closs wrote:
> Hi,
>
> I'm possibly about to take on a project, part of which involves
> getting the user to browse for files on their phone from a MIDlet.
>
> I've check out the *javax.microedition.io.file *package which all
> seems reasonably self-explanatory, what I can't see in there though is
> any kind of access to the default file browser on the phone. Does any
> such thing exist in any of the optional packages or will I have to
> write the UI from scratch?
>
> I'm thinking of something that works similar to java.awt.FileDialog,
> so I can just launch the default file browser and get a reference to
> the file the user selects...
>
> cheers
>
> ====
>
>
> James Closs, Director, bitBull Ltd
>
>
> http://www.bitbull.com
>
>
> 07771 991171
>
>
> ====
>
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body of the message "signoff KVM-INTEREST". For general help, send
> email to listserv@java.sun.com and include in the body of the message
> "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

James Closs

> no, you'll have to make it yourself

OK, I feared as much, thanks!

====

James Closs, Director, bitBull Ltd

http://www.bitbull.com

07771 991171

====

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

davjoh
Offline
Joined: 2007-07-18
Points: 0

But don't fret! It's actually very easy anyway.... here's a good example to start from:

http://www.java-tips.org/java-me-tips/midp/how-to-access-local-file-syst...

-David