I'm running Python on Android using SL4A. I have a script to calculate an average that looks like this:
import android
droid = android.Android()
var1 = 10
var2 = 20
var3 = 30
average = float((var1+var2+var3)/3)
droid.makeToast('Average:'+str(average))
f=open('/data/data/com.example.devicecommunication/files/result.txt','w')
f.write(str(average))
f.close()
My requirement is to add a method to droid
named stop
, so I can define my own logic there.
Is this possible?