beanshell : gzbus.bsh
source("/sdcard/com.googlecode.bshforandroid/extras/bsh/android.bsh");
a = Android();
a.call("addOptionsMenuItem","Exit","exit");
a.call("webViewShow","http://gzbusnow.sinaapp.com/index.php");
while( true){
response = a.call("eventWait").get("result");
if( response == null) continue;
print( response);
if( response.get("name").equals("exit")) break;
}
本文展示了一个使用Beanshell脚本进行Android应用开发的例子。该脚本加载了特定的Beanshell文件并调用了Android API来添加菜单项和显示网页内容。此外,还包括了一个循环用于等待并响应事件。
3520

被折叠的 条评论
为什么被折叠?



