views:

37

answers:

0

Hey all, this is briefly what im trying to do:
Im making an Android application that uses C++ libraries compiled from the Android NDK. Some of these C++ libraries create connections and act as servers to report data over a wifi connect (i am not trying to use the phones 3g connection or anything similar). The connection will be created using a specificed port number.

A arbitrary client application will know the IP address of the phone and port number to listen on and use that information to listen to served data from the phone.

The problem is my team and i dont know anything about handling connections on android phones. What do i need to do on the Android/Java side to allow these connections to be created inside C++ libraries? If i have a phone with a wireless connection, can i simply preform the instantiation of a connection on a port # and have it work?

Assume that:
1) the app is only required to open connections while it has a wireless internet connection
2) the C++ libraries require only a port number to open/create a server connection (everything else about creating the server is abstracted in the libraries)
3) the client only needs the phone's IP and the port of the server connection

Also, if there is any other information i need to provide, let me know.