java me - File connection+j2me -
i want make application can images no matter whether in phone or in external memory. want import images in application. how can possible? came know possible through file connection. not getting exact idea.
- get file system roots using
filesystemregistry.listroots()
- open connection each root in turn using
fileconnection fconn = (fileconnection)connector.open(root)
- list folder using
fconn.list()
. - for each entry in list, if ends image extension (
file.getname().endswith(".png")
etc), it's image. - if entry folder (
file.isdirectory()
returns true) usefconn.setfileconnection(folder)
traverse directory/ - do same recursively folders in roots.
Comments
Post a Comment