android - External Storage Differences -


this potentially stupid question, , i'm not sure if goes here, i'm confused.

currently have lg nexus 5 phone. app have made uses filepath:

file = environment.getexternalstoragedirectory().getpath() + filename; 

this works great on phone. saves pdf file can access it.

i go plug in tablet (samsung) , try use app, find breaks due saving pdf in file name above, producing in error log:

08-31 14:38:57.918  w/system.err﹕ java.io.filenotfoundexception: /storage/emulated/0/31/08/2015 2:38:57 pm.pdf: open failed: enoent (no such file or directory) 

after doing bit of googling can see it's because don't have sd card in tablet. makes sense. @ phone , can't find sd card slot anywhere? why work , save on phone, not on tablet.

will have buy sd card make work? file i'm trying save pdf file generated itext. i've read apparently can't/shouldn't save internal storage either.

any explinations/help appreciated.

getexternalstoragedirectory(), traditionally part of sd card, may implemented built-in storage in device distinct protected internal storage , can mounted filesystem on computer.

more details here.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -