-
public final class ContextExtKt
-
-
Method Summary
Modifier and Type Method Description final static InputStreamgetAssetAsRumResource(Context $self, String fileName, Integer accessMode, SdkCore sdkCore)Open an asset, returning an InputStream to read its contents, tracked as a RUM Resource. final static InputStreamgetRawResAsRumResource(Context $self, @RawRes() Integer id, SdkCore sdkCore)Open a data stream for reading a raw resource, tracked as a RUM Resource. -
-
Method Detail
-
getAssetAsRumResource
final static InputStream getAssetAsRumResource(Context $self, String fileName, Integer accessMode, SdkCore sdkCore)
Open an asset, returning an InputStream to read its contents, tracked as a RUM Resource.
This provides access to files that have been bundled with an application as assets -- that is, files placed into the "assets" directory.
- Parameters:
fileName- The name of the asset to open.accessMode- Desired access mode for retrieving the data.sdkCore- the SDK instance to use.
-
getRawResAsRumResource
final static InputStream getRawResAsRumResource(Context $self, @RawRes() Integer id, SdkCore sdkCore)
Open a data stream for reading a raw resource, tracked as a RUM Resource.
This can only be used with resources whose value is the name of an asset file -- that is, it can be used to open drawable, sound, and raw resources; it will fail on string and color resources.
- Parameters:
id- the resource identifier to open, as generated by the aapt tool.sdkCore- the SDK instance to use.
-
-
-
-