reading a specific file from sdcard in android -


how read specific file sdcard. have pushed file in sdcard through ddms , trying read though way give me exception. can tell me how point on file?

my code this.

string path = environment.getexternalstoragedirectory().getabsolutepath(); fileinputstream istream =  new fileinputstream(path); 

you trying read directory... need file! this... then, can read file want.

file dir = environment.getexternalstoragedirectory(); file yourfile = new file(dir, "path/to/the/file/inside/the/sdcard.ext"); 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -