java me - Accessing the 'Media' directory of a Blackberry within the JDK -
Trying to use the device to access saved media under the '/ home / video /' directory. Using Blackberry JDK 4.6.1 The single line of code throws an ' file system IO error exception, which is as usual, is unusable at the peak.
fconn = (file connection) connector.open ("file: /// home / user / video /" + name, connector. READ); Has anyone tried to do this? I can open the file inside my jar, but I can not use the media folder. I have the javax.microedition.io.Connector.file.read permission set and my transcript is signed.
There are two types of file systems on Blackberry - SDCard and Store. You have to use one of them, it must define in the path the standard directory on SDCard where the video, music etc. is stored "File: /// SDCard / Blackberry".
String StandardPath = "File: /// SDCard / Blackberry"; String videodir = System.getProperty ("fileconn.dir.videos.name"); String filename = "video.txt"; String path = standardpath + "/" + videodare + "/" + fileName; String content = ""; File connection fconn = null; DataInputStream = Tap; Bytevictor bytes = new byte vectors (); Try {fconn = (FileConnection) Connector.open (Path, Connector.READ); Is = fconn.openDataInputStream (); Int c = is.read (); While (-1! = C) {bytes.addElement (byte) (C)); C = is.read (); }} Hold (IOException e) {// TODO auto-generated cal block e.printStackTrace (); } Content = new string (bytes.ORRA); Add (New RichTextField (Content)); See also
Comments
Post a Comment