Jump to content

  • Log In with Google      Sign In   
  • Create Account


Help with Android Networking


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Canvas   Members   -  Reputation: 239

Like
0Likes
Like

Posted 31 December 2012 - 12:30 PM

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



Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 31 December 2012 - 12:55 PM

Here's an post on ad-hoc networks in Android and here's the documentation for Wi-Fi Direct (requires Android 4.0). There's this question and this one on StackOverflow which seem pretty relevant. These might help.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#3 Canvas   Members   -  Reputation: 239

Like
0Likes
Like

Posted 31 December 2012 - 01:01 PM

Just a quick question, does android 3.0 have that much different from 4.0 android networking?



#4 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 31 December 2012 - 01:11 PM

Not a ton. 4.0 has WiFi-Direct, network usage, VPN services, and Bluetooth health devices, which 3.0 lacks.


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#5 hplus0603   Moderators   -  Reputation: 5099

Like
0Likes
Like

Posted 31 December 2012 - 01:58 PM

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 };

#6 Canvas   Members   -  Reputation: 239

Like
0Likes
Like

Posted 31 December 2012 - 06:55 PM

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



#7 hplus0603   Moderators   -  Reputation: 5099

Like
0Likes
Like

Posted 01 January 2013 - 02:22 PM

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 };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS