Вопрос

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