Fetch all Image names from blackberry Device

别等时光非礼了梦想. 提交于 2019-12-11 11:43:56

问题


Is there any way to iterate through all images stored in a blackberry device. I have seen this example which iterates over the whole file system and scans each file. I am wondering is there any cheaper way of doing the same. Something that directly looks into the image directory? Thanks


回答1:


Using System.getProperty(String key) it is possible to get image storage dirs on device:

  1. Key "fileconn.dir.memorycard.photos". Returns default directory for storing photos on SD Card. It should be something like "file:///SDCard/BlackBerry/pictures/".

  2. Key "fileconn.dir.photos". Returns default directory for storing pictures on device memory. It should be something like "file:///store/home/user/pictures/".

Knowing these locations you can just iterage images inside of them, rather than scanning the whole file system. It is possible to list images using the FileConnection API. Specifically take a look at list(String filter, boolean includeHidden) method.



来源:https://stackoverflow.com/questions/8258612/fetch-all-image-names-from-blackberry-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!