Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 16 Next »

Intent

Need to create an unified Intent 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.

Approaches

Approach 3 : (A Hybrid approach between 1 & 2)

Intent provides the basic information such as content URL, mimeType & user/session context.

Params

Description

resourceID

Content ID of the resource

context

Context of the play - like did, sid, uid etc

mimeType

Mime type of the content

contentUrl

The public DIKSHA content url or a dial url (https://diksha.gov.in/content/v1/read/do_xxxx => https://diksha.gov.in/dial/XC40VV)

Pros

  1. The spec doesn’t need to change if more content metadata needs to be sent

  2. The integration apps need to understand our content model and can also index the content in their apps

Context Information

Following are the contextual params passed to the reader app

  1. Device ID

  2. User ID

  3. Session ID

  4. Collection ID

  5. Batch ID

  6. Reference ID

Params

Description

Data type

resourceId

identifier of the resource to be served in bazaar apps

String

collectionId

CollectionID of textbook,course

String

referrerPackageId

package details of referrer app

String

batchId

BatchId if it is trackable collection

String

mimeType

Content MimeType

String

vendorCode

Vendor ID to validate the referrer

String

contentCategory

contentCategory

String

artifactURL

Artifact URL to play content

String

telemetryContext

Hashed value of uid, sid

String

Data Sharing Table :

Params

Approach 1

Approach 2

Approach 3

resourceId

Yes

Yes

collectionId

Yes

Yes

referrerPackageId

Yes

Yes

Yes

batchId

Yes

mimeType

Yes

vendorCode

Yes

Yes

Yes

contentCategory

Yes

artifactURL

Yes

contentURL

Yes

telemetryContext

Yes

Yes

Yes

All the reader apps need to send summary data back to DIKSHA 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:

Request Object:

{"request":{"source":"web","name":"DIAL Code Consumption","filters":{"dialcodes":"XC40VV","contentType":["Collection","TextBook","TextBookUnit","Resource","Course"]},"userProfile":{}}}

Response Object:

{"id":"api.dial.assemble","ver":"v1","ts":"2021-02-10 04:27:14:674+0000","params":{"resmsgid":null,"msgid":"90e184d1-c52c-106b-c410-6a168900ef05","err":null,"status":"success","errmsg":null},"responseCode":"OK","result":{"response":{"ignoredSections":[],"name":"DIAL Code Consumption","id":"01265699913956556871","sections":[{"display":"{\"name\":{\"en\":\"Linked Content\"}}","alt":null,"count":0,"description":null,"index":1,"sectionDataType":"content","facets":[{"values":[],"name":"primaryCategory"},{"values":[],"name":"subject"},{"values":[],"name":"grade"},{"values":[],"name":"domain"},{"values":[],"name":"language"},{"values":[],"name":"medium"},{"values":[],"name":"contentType"}],"imgUrl":null,"resmsgId":"406a3b50-6b58-11eb-ae68-add1f2666d9e","contents":null,"searchQuery":"{\"request\":{\"facets\":[\"language\",\"grade\",\"domain\",\"contentType\",\"primaryCategory\",\"subject\",\"medium\"],\"filters\":{\"primaryCategory\":[\"Digital Textbook\",\"Textbook Unit\",\"Course\"],\"mimeType\":[\"application/vnd.ekstep.content-collection\"],\"status\":[\"Live\"],\"compatibilityLevel\":{\"max\":4,\"min\":1},\"dialcodes\":\"XC40VV\",\"contentType\":[\"Collection\",\"TextBook\",\"TextBookUnit\",\"Resource\",\"Course\"]},\"mode\":\"collection\",\"userProfile\":{},\"limit\":10},\"limit\":10,\"sort_by\":{\"lastUpdatedOn\":\"desc\"}}","name":"Linked Content","id":"01265699616802406427","dynamicFilters":null,"dataSource":null,"apiId":"api.content.search","group":1}]}}}

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://diksha.gov.in/play” -->
            <data android:scheme="https"
                  android:host="diksha.gov.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 -->
    }

  • No labels