Hi ,
I want to display what are the files and contents in sdcard through
application.
I am able to print the root folder.But when i execute cd sdcard
it throws me exception that permission is denied.
When i did the same thing using adb shell i am able to display the sdcard.
Is there any way to change permissions like sudo
I used the following code to display root folder
Runtime rt = Runtime.getRuntime();
try {
Process process;
process=rt.exec("ls");
try{
BufferedReader in =new BufferedReader(new
InputStreamReader(process.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
Log.d("debug",line);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
} catch (IOException e) {
e.printStackTrace();
}
But when change the above code like
process=rt.exec("cd sdcard");
process=rt.exec("ls");
Its throws exception
Any help please
Regards,
Karteek
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en