invisible.hippo
Arch-Supremacy Member
- Joined
- Nov 8, 2008
- Messages
- 17,902
- Reaction score
- 315
Hi, is it possible for an android application to execute a script and then retrieve the value in the script like this:
this is the script:
Is it possible to pass "HW" back to the android app?
I would like to ask one more question, has anyone tried before Kivy. I understand that it works in the following way. Please correct me if i am wrong.
It will import and existing android app and from there i can add python scripting into it and final package it back as a new android app?
Code:
Button b = (Button)findViewById(R.id.buttonPower);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Process p=null;
try {
p = new ProcessBuilder()
.command("/sdcard/Script/test.sh")
.start();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(p!=null) p.destroy();
}
}
});
this is the script:
Code:
#!/bin/sh
HW="Hello World!"
Is it possible to pass "HW" back to the android app?
I would like to ask one more question, has anyone tried before Kivy. I understand that it works in the following way. Please correct me if i am wrong.
It will import and existing android app and from there i can add python scripting into it and final package it back as a new android app?
Last edited: