Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help with Android Networking

Started by Canvas Dec 31, 2012 at 6:30 PM 5 replies 1.9k views
Original Post
Canvas
Canvas

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

hplus0603
hplus0603
Note that turning an Android into a "hotspot" generally requires a rooted device, because the cell phone carriers want to be able to charge for that service separately from "device" or "tethered" data usage.
enum Bool { True, False, FileNotFound };
Canvas
Canvas

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

hplus0603
hplus0603
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.)
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.