• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps get File from android

jessPHP

Newbie
Hi everyone!! I need to access a txt file from android. The problem is that I should use the class “File” because I need to know the file size. This class provides the length() method but InputStream does not.



The only solution I have found in the web is


Code:
 InputStream is = getResources().getAssets().open("myfile.txt");
But InputStream can not tell the size of a file.


How can I get a object “File” from android?


Thank you very very much
 
Back
Top Bottom