• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps cd doesn't execute in Runtime.exec() in my android application

mm2426

Lurker
Hello Everybody.
I was developing a simple android application in which on a button's click event I wrote
----------------------------------
Runtime r = Runtime.getRuntime();
Process p = r.exec("mount /sdcard");
p = r.exec("cd /mnt/sdcard");
and displayed the standard input stream on the log.
------------------------------------
my problem is I am unable to navigate to the sdcard directory and I am getting an exception saying java.io Exception error running exec command [cd /mnt/sdcard]
Working Directory: null
Environment: null
I was browsing some pages and I came to know that cd doesn't work
then how should I navigate to the sdcard directory?
Thanks in advance
 
I want to run the gcc compiler command line tool (which runs on a linux os ). I am trying to invoke that tool through my application.
 
I know gcc is not included in android that's why I am trying to install gcc in android, as gcc is available for many linux operating systems I want to try to install it in android.
 
Well, if that's the case, before you even begin to try to install it, you need to first port it to Android. Linux is a general term. Software still will often have descrepencies for each distro. Android might be a moodified linux kernel, but it does things very diffferent at times, so gcc will first need to be ported to Android.
 
Back
Top Bottom