我在 Android 上安装了 QPython 应用程序并执行了一个名为 helloworld.py 的脚本。它使用 androidhelper 的方法 maketoast 来显示带有 Android api 的消息。
我尝试在另一个文件上编写完全相同的脚本,但出现以下错误:
com.googlecode.android_scripting.rpc.RpcError: Unknown RPC.
然后我尝试修改 helloworld.py,它现在给我上面的错误。
我在互联网上搜索了这个错误,但没有解决方案。
顺便说一下,我使用的是 root 的三星 Galaxy Tab 3 LITE T110N。
我已经尝试使用 android 模块,但它不存在。 sl4a 也不存在。
我使用的是 python 2.7。
请您参考如下方法:
import androidhelper
droid=androidhelper.Android()
droid.makeToast("Hello, sl4a!")
#not maketoast
#it's makeToast!
#read this:
#http://www.mithril.com.au/android/doc/index.html
#when you call sl4a,you have to tell sl4a what to do, if sl4a can't recognize it,
#sl4a throws an Unknown RPC error
#Thanks
