AssetManager

Class of android.content.res · AssetManager.java · Android's reference

public final class AssetManager implements AutoCloseable

The resource tables and assets of the app: the HLE of libandroidfw's AssetManager2 (src/android/res/arsc.c). Each native call is made holding the manager's lock, as Android's AssetManager does.

Fields

public static final int ACCESS_UNKNOWN = 0 source
public static final int ACCESS_RANDOM = 1 source
public static final int ACCESS_STREAMING = 2 source
public static final int ACCESS_BUFFER = 3 source

Constructors

public AssetManager() source

Methods

public static AssetManager forApk() source

The app's APKs: the base's resources.arsc, its cookie 1, then each split's that has one. A configuration split's (a density's, a language's) holds the base's package with its configurations' entries, which a lookup takes with the base's (arsc.c).

public synchronized void setConfiguration(Configuration c, DisplayMetrics m) source
public InputStream open(String fileName) throws IOException source
public InputStream open(String fileName, int accessMode) throws IOException source
public InputStream openNonAsset(String fileName) throws IOException source
public AssetFileDescriptor openFd(String fileName) throws IOException source

An asset as a file: copied out of the APK to the app's cache once.

public AssetFileDescriptor openNonAssetFd(String fileName) throws IOException source

A file of the APK outside assets/, copied out the same way.

public String[] list(String path) throws IOException source
public XmlResourceParser openXmlResourceParser(String fileName) throws IOException source
public XmlResourceParser openXmlResourceParser(int cookie, String fileName) throws IOException source
public String[] getLocales() source
public synchronized void close() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.