Display SCORM content in Android -
i have native android moodle based application wherein have display courses in scorm format in application.
can please me how go this...
courses uploaded moodle based website in scorm format.
get_course_contents web service gives me url pointing course files, specified here
https://github.com/dongsheng/moodle/wiki/webservice:get_course_contents
how display these scorm files in native android application?
need parse imsmanifest.xml file , details of scorm package , display html5 contents? or there another/better way??
**
**
update:
have tried display scorm package contents in webview.
scorm package like:

have copied package in assets folder of poc project.
webview settings are:
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"); and manifest is:
<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> but i'm not getting required results , cannot view swf....

also, when copied scorm package onto sdcard of device , tried open html file, opened in htmlviewer app , showed blank white screen...

can please me out this....
in advance...
first have understand structure of scorm.
you can see scorm package zip file containing several folders right , manifest file.
first have unzip zip package of scorm , have parse imsmanifest.xml file , maintain 2 lists 1 containing titles , other addresses of html files corresponding title.
i have used sax2r2 parser parse manifest file , got 2 array lists 1 containing title , other addresses of html files.
later have fill ios list titles array, , when user click on title of list position of list , retrieve address of html files corresponding title addresses array list.
inaly can open html file in webview of ios, make sure have enabled parameters required open scorm html5 file.
in android have enabled , set these values java code may you.
webviewclient webviewclient = new webviewclient(); webview.setwebviewclient(webviewclient); webview.clearcache(true); webview.getsettings().setusewideviewport(true); webview.setinitialscale(1); webview.getsettings().setbuiltinzoomcontrols(true); webview.clearhistory(); webview.getsettings().setallowfileaccess(true); webview.getsettings().setdomstorageenabled(true); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setpluginstate(websettings.pluginstate.on); webview.getsettings().setloadwithoverviewmode(true); webview.getsettings().setusewideviewport(true); webview.getsettings().setpluginstate(pluginstate.on); webview.loadurl("file://" + open_scorm.scorm_path + open_scorm.scorm_name + "/" + open_scorm.href.get(0)); webview used open html/html5 files in android , have enabled above settings in android, these settings default in android, may in ios have load html file , dnt have enable these values.
in above can see retrieving href.get(0) first html5 file of scorm.
in simple words have unzip scorm , parse imsmanifest.xml file , data of , use open/parse scorm.
Comments
Post a Comment