Intent
Need to create an interface for enabling Access to Content on Sunbird across different apps like Read Along,Games etc.
Note: Assumption of this specification is based on the apps being able to support these intents as part of their implementation.
Documentation is categorised into multiple sections:
Approaches
Technical Specification for third party apps
Param Data Supported
Data Sharing Table
Summary Event Spec
API Documentation
Intent Handling
Vendor Registration of Apps to Sunbird
Global Vendor Registration API
Local Vendor Registration by Deep Linking
Approaches
Technical Specification for Third Party Apps
All the reader apps need to send summary data back to Sunbird app via intent data.
SUMMARY Event Spec
{ "edata": { "type": "", // Required. Type of summary. Free text. "session", "app", "tool" etc "mode": "", // Optional. "starttime": Long, // Required. Epoch Timestamp of app start. Retrieved from first event. "endtime": Long, // Required. Epoch Timestamp of app end. Retrieved from last event. "timespent": Double, // Required. Total time spent by visitor on app in seconds excluding idle time. "pageviews": Long, // Required. Total page views per session(count of CP_IMPRESSION) "interactions": Long, // Required. Count of interact events "envsummary": [{ // Optional "env": String, // High level env within the app (content, domain, resources, community) "timespent": Double, // Time spent per env "visits": Long // count of times the environment has been visited }], "eventssummary": [{ // Optional "id": String, // event id such as CE_START, CE_END, CP_INTERACT etc. "count": Long // Count of events. }], "pagesummary": [{ // Optional "id": String, // Page id "type": String, // type of page - view/edit "env": String, // env of page "timespent": Double, // Time taken per page "visits": Long // Number of times each page was visited }] } }
Specifications for Bazaar Apps:
Need to implement an activity which is capable of calling API and read the content metadata to launch the content in their respective apps. Following is the API request,response structure to be adhered to.
API Information:
For More Details Refer Sunbird Documentation
Intent Handling
Need to create an intent filter in Android Manifest as follows :
<activity android:name="com.example.ExampleActivity" android:label="@string/title_example" > <intent-filter android:label="@string/play_view_web_example"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <!-- Accepts URIs that begin with "http://sunbird.staginged.in/play” --> <data android:scheme="https" android:host="sunbird.staginged.in" android:pathPrefix="/play" /> </intent-filter> <intent-filter android:label="@string/play_view_app_example"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <!-- Accepts URIs that begin with "example://play” --> <data android:scheme="example" android:host="play" /> </intent-filter> </activity>
Implement Activity as follows
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = getIntent(); String action = intent.getAction(); Uri data = intent.getData(); <!-- Trigger the Business Logic of App --> }