質問

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