Android examples for App:Assets
get Asset Data as byte array by asset path
//package com.java2s; import java.io.IOException; import java.io.InputStream; import android.content.Context; import android.content.res.AssetManager; public class Main { public static byte[] getAssetData(Context ctx, String asset) { AssetManager am = ctx.getAssets(); try {//from ww w . j av a2 s.c o m InputStream is = am.open(asset); int length = is.available(); byte[] data = new byte[length]; is.read(data); return data; } catch (IOException e1) { e1.printStackTrace(); } return null; } }