hasanghaforian hasanghaforian - 2 months ago 27
Android Question

how to get ParcelFileDescriptor for file content?

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

Can I receive a
from it? I guess that
can help me, because I saw
method for it here and here, but when I'm writing my code in eclipse, I cannot find method
in class

Finally this is my question: is it possible without using socket()?


getParcelFileDescriptor() is a package private method,so I could not found it in my class(that is in another package).I tried to access it by reflection but finally I understand that it return a suitable ParcelFileDescritor,if and only if,we create our MemoryFile as a reference to an existing memory file and in this case we want File descriptor from that existing memory file.So this method can not help us.Also it seems that in later versions of Android,this method is completely ignored and removed from class.