Ali Ahmadi wrote: > > i [sic] made a android [sic] app, which works correctly. > now i put some parts of my application into a library and as a jar file. > now my code is not working > i read some values through this command: > > suProcess = Runtime.getRuntime().exec("ls /sdcard/folder*'"); > > DataOutputStream oStream = new > DataOutputStream(suProcess.getOutputStream()); >
The 'Process' output stream from an "ls" will not be a 'DataOutputStream'. > DataInputStream osRes = new > DataInputStream(suProcess.getInputStream()); > Likewise the input stream. "ls" is a text-oriented command. > DataInputStream errStream = new > DataInputStream(suProcess.getErrorStream()); if (null != oStream && null != osRes && null!= errStream) > { > while (errStream.available()>0) > errVal += errStream.readLine(); > while (osRes.available()>0) > retval = osRes.readLine(); > } > > but nothing would return as output. > why this happens just when i use jar file? > Did you set up the project that generates the JAR as an "Android library project"? http://developer.android.com/tools/projects/index.html#LibraryProjects Did you "create a /libs directory within your Android project directory and copy the JAR file to that directory"? http://mobile.tutsplus.com/tutorials/android/jar-for-android/ Did you google for an answer? -- Lew -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en