i've got this shell script:
#!system/bin/sh
while :
do
sync
echo 3> /proc/sys/vm/drop_caches
echo "Script is been launched"
sleep 30m
done
exit 0;
i wish run this script with an android app. I have already created a button with only a toast for now. How can i take the script (free.sh) and launch it with the button on the app? Or is there a solution to rewrite the code in java? Thanks
Here is how you can run shell script from your android app
Well, now No errors (THANK YOU!) but do nothing..to try i've written a easy script that write a file.txt. See the code:
The are no errors but when i press the button i think the shell doesn't go so don't create the file.txt
I've got errors in my code:
First, you will use Eclipse to create a simple Android helloworld app. And add a button in your layout. This is very priliminary practise of Android development which you can dig a lot more from http://d.android.com
please try this code in your button's onclick call back function: