thanks first of all to plusminus for the gr8 work with this forum and his very good guides, why am i writing here so?
Easy i was playing with a little app i'm developing but i've just found a little problem... let's explain me it...
I created a sdcard and inside it I placed some jpg files.
So my data path is something like:
/sdcard/app/img/1.jpg
/sdcard/app/img/2.jpg
/sdcard/app/img/3.jpg
/sdcard/app/img/4.jpg
[...]
/sdcard/app/img/n.jpg
Now I want to create a gallery app to show out these files, I looked at demo srcs by android sdk, but they always use imgs from resources...
I decided to try using Bitmapfactory.decodeFile and also Bitmapfactory.decodestream but both seems not to work fine returning a NullPointerException
Here you are a little snippet of my app:
Using java Syntax Highlighting
- for(int i=0;i<imgsTokens.length;i++)
- {
- Log.d(""+i,"/sdcard/app/img/"+imgsTokens[i]+".jpg");
- try
- {
- FileInputStream is = new FileInputStream(new File("/sdcard/app/img/"+imgsTokens[i]+".jpg"));
- BufferedInputStream bis = new BufferedInputStream(is);
- photos[i] = BitmapFactory.decodeStream(is);
- bis.close();
- is.close();
- //photos[i] = BitmapFactory.decodeFile("/sdcard/app/img/"+imgsTokens[i]+".jpg");
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
any idea how to fix?






