【发布时间】:2016-07-05 20:52:12
【问题描述】:
我有一个基于原生 Android Moodle 的应用程序,我必须在应用程序中显示 SCORM 格式的课程。
有人可以帮我解决这个问题...
这些课程以 SCORM 格式上传到我基于 Moodle 的网站。get_course_contents 网络服务给了我一个指向课程文件的 url,在这里指定
https://github.com/dongsheng/moodle/wiki/WebService:get_course_contents
如何在我的原生 Android 应用程序中显示这些 SCORM 文件?
我是否需要解析imsmanifest.xml 文件并获取SCORM 包的详细信息并显示HTML5 内容?还是有另一种/更好的方法?
**
**
更新:
我现在尝试在 WebView 中显示 SCORM 包内容。
我的 SCORM 包是这样的:
我已将此包复制到我的 POC 项目的 Assets 文件夹中。
我的WebView 设置是:
settings.setJavaScriptEnabled(true);
settings.setPluginsEnabled(true);
PluginState state = PluginState.ON;
settings.setPluginState(state);
settings.setAllowFileAccess(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setDatabaseEnabled(true);
String databasePath = this.getApplicationContext()
.getDir("database", Context.MODE_PRIVATE).getPath();
settings.setDatabasePath(databasePath);
webview.loadUrl("file:///android_asset/ttttt.html");
我的清单是:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.html5test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.html5test.MainActivity"
android:hardwareAccelerated="true"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
但我没有得到所需的结果,也无法查看我的 SWF....
另外,当我将 SCORM 包复制到设备的 sdcard 并尝试打开 html 文件时,它在 HTMLViewer 应用程序中打开并显示空白屏幕...
有人可以帮我解决这个问题吗....
提前谢谢...
【问题讨论】:
标签: android android-webview moodle scorm