android - How do I launch a QPython Script from MIT App Inventor Activity Starter and exit cleanly? -
i have made simple training app mit app inventor 2. app logs logfile, , i've made small qpython script analyze log , display stats.
i'd use activity starter launch python script, haven't been able figure out correct set of action, activityclass, activitypackage , extra[x] make work. i've run adb on android phone find correct strings "601 no corresponding activity found" when try.
here's adb output grepped "qpyplus" while running script:
i/timeline( 1898): timeline: activity_launch_request id:com.hipipal.qpyplus time:15752330 i/activitymanager( 862): start u0 {act=android.intent.action.main cat=[android.intent.category.launcher] flg=0x10200000 cmp=com.hipipal.qpyplus/com.hipipal.qpylib.mpyapi bnds=[540,456][807,756] (has extras)} uid 10116 on display 0 v/windowmanager( 862): addapptoken: appwindowtoken{1687ec32 token=token{120bbc3d activityrecord{1ef9e994 u0 com.hipipal.qpyplus/com.hipipal.qpylib.mpyapi t5112}}} stack=1 task=5112 @ 0 v/windowmanager( 862): adding window window{e90d72c u0 starting com.hipipal.qpyplus} @ 18 of 26 (after window{30168e12 u0 edu.mit.appinventor.aicompanion3/edu.mit.appinventor.aicompanion3.screen1}) i/timeline(31680): timeline: activity_launch_request id:com.hipipal.qpyplus time:15752447 i/activitymanager( 862): start u0 {cmp=com.hipipal.qpyplus/jackpal.androidterm.term (has extras)} uid 10335 on display 0 v/windowmanager( 862): addapptoken: appwindowtoken{382fc5e2 token=token{1e492ead activityrecord{2e34dfc4 u0 com.hipipal.qpyplus/jackpal.androidterm.term t5112}}} stack=1 task=5112 @ 1 v/windowmanager( 862): based on layer: adding window window{e90d72c u0 starting com.hipipal.qpyplus} @ 18 of 26 v/windowmanager( 862): adding window window{390e635c u0 com.hipipal.qpyplus/jackpal.androidterm.term} @ 18 of 27 (before window{e90d72c u0 starting com.hipipal.qpyplus}) i/activitymanager( 862): displayed com.hipipal.qpyplus/jackpal.androidterm.term: +117ms (total +245ms) i/timeline( 862): timeline: activity_windows_visible id: activityrecord{2e34dfc4 u0 com.hipipal.qpyplus/jackpal.androidterm.term t5112} time:15752597
i've read docs , tried decipher logs , populate tags. i've found old answer 2010 same sort of question, seems qpython has moved on since because recipe doesn't correspond logcat (and doesn't work). please see screenshot of both options (i'm rookie here i'm not allowed embed images).
screenshot of 2 options don't work know how should format activity starter script run?
update!
taifun has put me on right track, think. i've followed advice , re-compiled .apk new permissions , installed allowed run shell script. problem qpython seems ignore asking run script on startup. terminal opens okay, script doesn't run. if run command manually, runs fine.
any thoughts?
http://i.hizliresim.com/mlqgp4.png
action="com.hipipal.qpyplus.action.mpyapi" classname="com.hipipal.qpyplus.mpyapi" packagename="com.hipipal.qpyplus" extras={"app" : "appid", "act" : "onpyapi", "flag" : "onqpyexec", "param" : "", "pycode" : "print 'selam'\nprint 'naber'"}
this working fine :)
Comments
Post a Comment