I\'m trying to create an input stream by doing this
InputStream is = (InputStream) getResources().openRawResource(R.drawable.image1);
but I
If you want to open your png with this method then you have to put it in the res/raw folder. Then you'll be able to access the png using R.raw.image1.
Another alternative is to keep it in the drawable folder and then convert the drawable to a InputStream. See How to read drawable bits as InputStream
I assume you know how to get the drawable otherwise look at the Resources documentation.