Sign in to follow this  
Canvas

Help with Android Networking

Recommended Posts

Hey guys,

 

I'm going to be createing a networked Android application, I just want to create a very simple and straight forward application where one user can become a wifi hot-spot while the other user connects to that wifi hot-spot, I don't know much about networking programming, but I have read a lot about networking. I'm just interested in any tutorial websites you guys may know, or any information that will help, I do understand that Android using Java, but Android API does offer somethings that Java doesn't,

 

I understand this forum is for more "programming" problems, but I just need some help with getting started with Android Network programming, any websites or documents on the web that would help me

 

Cheers for the help

 

Canvas

Share this post


Link to post
Share on other sites

My mobile device HTC desire can turn itself into a wifi hotspot, and a mobile can connect to it with no problem, just needs the pass key, then they are connected just like a router, I just need to program the application to use UDP to send out data to all connected peers that are on the same application :). As I stated above, any information will be appreciated.

 

Canvas

Share this post


Link to post
Share on other sites
I just need to program the application to use UDP to send out data to all connected peers

Do you need a list of all connected peers, or just the ability to broadcast UDP on the local subnet?

For the latter, if your subnet is 192.168.1.0/255.255.255.0, then the broadcast address is 192.168.1.255. Create SOCK_DGRAM sockets on clients/server, and bind them to your chosen port number. Enable SO_BROADCAST on all the sockets (sending and receiving) and send the UDP datagram to the broadcast address; the clients will receive the packet (minus some small risk of UDP data loss.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this