I use eclipse-indigo and android 2.3.3_r1
and I download a string from a server in network.It is the content of docx
file.
Can I receive a ParcelFileDescritor
from it? I guess that MemoryFile
can help me, because I saw getParcelFileDescriptor()
method for it here and here, but when I'm writing my code in eclipse, I cannot find method getParcelFileDescriptor()
in class
android.os.MemoryFile
.
Finally this is my question: is it possible without using socket()?
@Override
public ParcelFileDescriptor openFile(Uri uri){
File f=new File(getContext().getFilesDir(),uri.getLastPathSegment());
ParcelFileDescriptor pfd;
try {
pfd=ParcelFileDescriptor.open(f,ParcelFileDescriptor.MODE_READ_ONLY);
}
catch ( FileNotFoundException e) {
e.printStackTrace();
return null;
}
return pfd;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With