In desktop Java applications, i was able to restart my Java application by itself with some scripting not necessary to be compiled for example (so that remotely we can add some extra on stuff on it) as:
Desktop script: restartme.sh
#!/bin/bash
export DISPLAY=:0.0
pkill java
java -cp SystemV.jar Main.Boot 0x01 &
# on the fly add new stuffs depending on the situations..
iperf -s -p 65000 &
convert -size 800x600 xc:transparent -font Bookman-DemiItalic -pointsize 50 -draw "text 25,90 ' inactive.'" -channel RGBA -blur 0x6 -fill steelblue -stroke white -draw "text 10,90 ' inactive.'" -antialias /var/www/html/video/now.jpeg;
x11vnc -forever -passwd x1x &
Desktop application:
system("/var/tmp/restartme.sh &");
public static String system(String cmds) {
String value = "";
try {
String cmd[] = { "/bin/sh", "-c", cmds};
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = reader.readLine();
while (line != null) {
value += line + "\n\r";
line = reader.readLine();
}
}
catch (IOException ioe) {
ioe.printStackTrace();
}
catch (InterruptedException ie) {
ie.printStackTrace();
}
return value;
}
How do i restart in Android, like Desktop? Can i have default BASH or other default built-in Android shell scripting? Or there is some other way on the fly to do some not compiled scripts to be executed?