I am trying to pipeline some audio over a udp socket on android using eclipse

I keep getting the following error

"The method fromDatagramSocket(DatagramSocket) is undefined for the type ParcelFileDescriptor"

The android docs show that such a method is already available and I believe this is the proper way to create a UDP pipeline

Reference:

http://developer.android.com/reference/android/os/ParcelFileDescriptor.html#fromDatagramSocket(java.net.DatagramSocket)

Code :

DatagramSocket socket = new DatagramSocket(port, InetAddress.getByName(hostnameUDP));
ParcelFileDescriptor pfd = ParcelFileDescriptor.fromDatagramSocket(socket);
有帮助吗?

解决方案

The problem was with the included Android Library which was Android 2.2 Changed it to Android 4.3 and it worked Apparently the older version of the Android library did not have UDP defined

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top