Java tutorial
//package com.java2s; import android.content.Context; import java.io.IOException; import java.io.InputStream; public class Main { public static InputStream getInputStream(Context context, int rawResId) { return context.getResources().openRawResource(rawResId); } public static InputStream getInputStream(Context context, String assetsPath) throws IOException { return context.getResources().getAssets().open(assetsPath); } }