如何在应用程序中捆绑文件?

时间:2013-10-19 12:54:34

标签: java android html

我制作了一个html IDE,想要打包一些可以添加到网站的js库。我需要做些什么来实现这个目标?

1 个答案:

答案 0 :(得分:1)

正如kamituel指出的那样,使用AssetManagerhttp://developer.android.com/reference/android/content/res/AssetManager.html

以下是一个例子:

AssetManager assetManager = this.getAssets();
Bitmap[] yourImages = new Bitmap[] {
    BitmapFactory.decodeStream(assetMgr.open("firstimage.png"));
    BitmapFactory.decodeStream(assetMgr.open("secondimage.png"));
    BitmapFactory.decodeStream(assetMgr.open("thirdimage.png"));
};