On Wed, Jul 6, 2011 at 8:04 AM, Jeje <[email protected]> wrote:
> Ok, but if a I would like work on another file in my application, what
> is the path ? Because the system will not find if I set :
> InputStream isEadsCert = new FileInputStream("FileName"). It misses
> the path to my file, doesn't it ?

I do not know what you mean by "another file in my application".

If you have packaged the file as a raw resource, use
getResources().openRawResource().

If you have packaged the file as an asset, use
getResources().getAssets().open().

If it is a file that you have downloaded and stored in the
application-local storage point in the internal storage, use
getFilesDir() or openFileInput().

If it is a file that you have downloaded and stored in the
application-local storage point in the external storage, use
getExternalFilesDir() or getExternalCacheDir().

If it is a file that you have downloaded and stored generically in the
external storage, use getExternalStorageDir() [this one is a method on
Environment -- all the other ones are on Context]

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to