rexseeApplication
返回手册目录
【函数】void exit()
【说明】连同虚拟机一同退出。
【返回】
【参数】
【示例】
rexseeApplication.exit();
运行示例

【函数】void confirmExit()
【说明】先确认再连同虚拟机一同退出。
【返回】
【参数】
【示例】
rexseeApplication.confirmExit();
运行示例

【函数】void askForExit()
【说明】强制退出。
【返回】
【参数】
【示例】
rexseeApplication.askForExit('测试','必须退出了!');
运行示例

【函数】void quit()
【说明】退出。
【返回】
【参数】
【示例】
rexseeApplication.quit();
运行示例

【函数】void confirmQuit()
【说明】先确认再退出。
【返回】
【参数】
【示例】
rexseeApplication.confirmQuit();
运行示例

【函数】void restart()
【说明】重启。
【返回】
【参数】
【示例】
rexseeApplication.restart();
运行示例

【函数】void confirmRestart()
【说明】先确认再重启。
【返回】
【参数】
【示例】
rexseeApplication.confirmRestart();
运行示例

【函数】void askForExitOrRestart()
【说明】强制退出或重启。
【返回】
【参数】
【示例】
rexseeApplication.askForExitOrRestart('测试','必须退出或重启了!');
运行示例

【函数】void uninstall()
【说明】卸载。
【返回】
【参数】
【示例】
rexseeApplication.uninstall();
运行示例

【函数】void confirmUninstall()
【说明】先确认再卸载。
【返回】
【参数】
【示例】
rexseeApplication.confirmUninstall();
运行示例

【函数】String getHome()
【说明】获取本应用程序预设的首页地址,该地址并非一定存在,如果不存在,则表示是开发版,启动时会要求用户输入首页地址,而开发者也可以通过setDeveloperHomePage()动态设定首页地址并通过getDeveloperHomePage()获得动态设定的首页地址。
【返回】首页地址。
【参数】
【示例】
alert(rexseeApplication.getHome());
运行示例

【函数】void setDeveloperHome(home)
【说明】设置开发者首页地址,在开发版中和正式版中设置该值意义是不同的。在正式版中,只有本地地址(file://xxxxxx)才会生效,这将使得程序成为一个手机本地程序。注意,设置完毕后必须重新启动。
【返回】
【参数】home:首页地址。
【示例】 设为手册目录:
rexseeApplication.setDeveloperHome('http://www.rexsee.com/rexsee/help/index.php');
rexseeDialog.toast('设置完毕');
运行示例 设为手册首页:
rexseeApplication.setDeveloperHome('http://www.rexsee.com/rexsee/index.php');
rexseeDialog.toast('设置完毕');
运行示例

【函数】String getDeveloperHome()
【说明】获取开发者首页地址,仅在开发版中有效。
【返回】首页地址。
【参数】
【示例】
alert(rexseeApplication.getDeveloperHome());
运行示例

【函数】String getCurrentHome()
【说明】获取当前的首页地址,如果getHome()不为空则和其返回值相同,否则和getDeveloperHome()返回值相同。
【返回】首页地址。
【参数】
【示例】
alert(rexseeApplication.getCurrentHome());
运行示例

【函数】JsonArray getDomailWhiteList()
【说明】获取本应用程序预设的域名白名单,网页或网页中资源(图片、CSS、JavaScript等)的域名必须和首页域名相同或在该白名单内才允许载入,该白名单并非一定存在,如果不存在,则网页或网页中资源的域名必须和首页域名相同才允许载入。
【返回】域名白名单,是JSON格式的字符串,代表一个数组,使用"eval('('+json+')')"转换为JavaScript数组对象。
【参数】
【示例】
alert(rexseeApplication.getDomailWhiteList());
运行示例

【函数】String getAuthorName()
【说明】获取本应用程序开发者的名称,该名称并非一定存在。
【返回】开发者的名称。
【参数】
【示例】
alert(rexseeApplication.getAuthorName());
运行示例

【函数】String getAuthorEmail()
【说明】获取本应用程序开发者的电子邮件地址,该地址并非一定存在。
【返回】开发者的电子邮件地址。
【参数】
【示例】
alert(rexseeApplication.getAuthorEmail());
运行示例

【函数】String getName()
【说明】获取软件包的名称,并非显示的软件标题,软件标题使用getLabel()获得。
【返回】软件包的名称。
【参数】
【示例】
alert(rexseeApplication.getName());
运行示例

【函数】String getLabel()
【说明】获取软件包的标题,即显示在手机应用列表和桌面的程序名称。
【返回】软件包的标题。
【参数】
【示例】
alert(rexseeApplication.getLabel());
运行示例

【函数】int getInstalledTime()
【说明】获取软件包已经安装的时间。注意,升级后时间将重新开始计算。
【返回】软件包已经安装的时间,秒数。
【参数】
【示例】
alert(rexseeApplication.getInstalledTime());
运行示例

【函数】int getRunTimes()
【说明】获取软件已经运行的次数。
【返回】软件已经运行的次数。
【参数】
【示例】
alert(rexseeApplication.getRunTimes());
运行示例

【函数】int getVersionCode()
【说明】获取Rexsee系统的数字版本号。
【返回】数字版本号。
【参数】
【示例】
alert(rexseeApplication.getVersionCode());
运行示例

【函数】String getVersionName()
【说明】获取Rexsee系统的字符串版本名称。
【返回】字符串版本名称。
【参数】
【示例】
alert(rexseeApplication.getVersionName());
运行示例

【函数】int getEditionName()
【说明】读取Rexsee系统的版本名称。
【返回】版本名称。
【参数】
【示例】
alert(rexseeApplication.getEditionName());
运行示例

【函数】int getTimeout()
【说明】读取系统访问网络时的超时时间。
【返回】超时时间,秒数。
【参数】
【示例】
alert(rexseeApplication.getTimeout());
运行示例

【函数】void setTimeout()
【函数】void setTimeout(int seconds)
【说明】设置系统访问网络时的超时时间。
【返回】
【参数】seconds:超时时间,秒数。为空表示恢复默认值,默认值为30秒。
【示例】
rexseeApplication.setTimeout(20);
rexseeDialog.toast('设置完毕。');
运行示例
rexseeApplication.setTimeout();
rexseeDialog.toast('设置完毕。');
恢复默认

【函数】boolean getAutoClearCache()
【说明】读取每次启动是否自动清除缓存。
【返回】true表示每次启动自动清除缓存,false表示不自动清除缓存,默认为true。
【参数】
【示例】
alert(rexseeApplication.getAutoClearCache());
运行示例

【函数】void setAutoClearCache(boolean autoClear)
【说明】设置每次启动是否自动清除缓存。
【返回】
【参数】autoClear:true表示每次启动自动清除缓存,false表示不自动清除缓存,默认为true。
【示例】
rexseeApplication.setAutoClearCache(false);
rexseeDialog.toast('设置完毕。');
运行示例
rexseeApplication.setAutoClearCache(true);
rexseeDialog.toast('设置完毕。');
恢复默认

【函数】String getDefaultEncoding()
【说明】读取当前的默认编码。
【返回】当前的默认编码。
【参数】
【示例】
alert(rexseeApplication.getDefaultEncoding());
运行示例

【函数】void setDefaultEncoding(String encoding)
【说明】设置默认编码。
【返回】
【参数】encoding:编码,例如"utf-8"、"gb2312"、"gbk"等,默认为"utf-8"。
【示例】
rexseeApplication.setDefaultEncoding('gb2312');
rexseeDialog.toast('设置完毕。');
运行示例
rexseeApplication.setDefaultEncoding('utf-8');
rexseeDialog.toast('设置完毕。');
恢复默认

【函数】boolean sendShortcutToDesktop()
【说明】向桌面发送本程序的快捷方式。
【返回】成功返回true,失败返回false。
【参数】
【示例】
alert(rexseeApplication.sendShortcutToDesktop());
运行示例

【函数】boolean sendShortcutToDesktop(String shortcutLable, String shortcutUrl)
【说明】向桌面发送本程序的快捷方式。
【返回】成功返回true,失败返回false。
【参数】shortcutLable:快捷方式的显示名称。
shortcutUrl:快捷方式启动程序后访问的URL。
【示例】
alert(rexseeApplication.sendShortcutToDesktop('RexseeTest', 'http://www.rexsee.com/CN/help/index.php'));
运行示例
alert(rexseeApplication.sendShortcutToDesktop('RexseeTest', rexseeStorage.getRoot()+'eric.jpg', 'http://www.rexsee.com/CN/help/index.php'));
运行示例
返回手册目录