-->

Android ParcelFileDescriptor.createPipe() for Froy

2020-04-08 13:17发布

问题:

I have a need to use ParcelFileDescriptor.createPipe(), but I would still like to target API 8/Froyo. This function requires API 9/Gingerbread.

I have read that there are compatibility kits that allow newer API functions to be used on the older OS versions, but know nothing about them. Is that an option here?

If not, what would be the cleanest method for going about duplicating this functionality? I have considered using fromSocket() and making a simple network connection over the loopback interface, but that seems like more overhead than is needed, if there were a simpler way.

Any thoughts or advice would be much appreciated. I should also point out that I am using Monodroid, but a simple Java-based example that uses the Android API would be fine. I can translate it to C#.