Class RawResourceDataSource

  • All Implemented Interfaces:
    DataReader, DataSource

    public final class RawResourceDataSource
    extends BaseDataSource
    A DataSource for reading a raw resource inside the APK.

    URIs supported by this source are of one of the forms:

    • rawresource:///id, where id is the integer identifier of a raw resource.
    • android.resource:///id, where id is the integer identifier of a raw resource.
    • android.resource://[package]/[type/]name, where package is the name of the package in which the resource is located, type is the resource type and name is the resource name. The package and the type are optional. Their default value is the package of this application and "raw", respectively. Using the two other forms is more efficient.

    buildRawResourceUri(int) can be used to build supported Uris.