Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


#Actualfrob

Posted 28 July 2014 - 03:13 AM

You wrote that you don't want internet but you do want wifi, which says you really don't understand what you are looking for.


Bluetooth allows your device to talk to other nearby bluetooth devices within a range of about 10 meters (30 feet).

Wifi, or wireless Ethernet, is basically an Internet connection.

In both cases you need to build a way to discover another player, connect with them, and then read and send data. The processes are fairly similar but the libraries are different.


Android's bluetooth libraries can be set up for long term connections and for an ad-hoc bluetooth pairing. Basically you tell two devices that they are looking for each other, they turn on their radios, and then authenticate. Once they are talking to each other you send and read data. Documentation for that is at http://developer.android.com/guide/topics/connectivity/bluetooth.html

If you are looking for wifi, you need the user to connect to a wifi network on their own in the network settings. Alternatively if they are on a data-enabled cell phone you may not need a wifi connection, the data connection connects you to the Internet. Yet another option is an ad hoc wifi network, where devices act as though they are on their own private LAN. No matter which option you go for, you can then use Java's networking classes (java.net.*) to do the work. There are hundreds of tutorials on the web for that, including several linked to on this site's Networking forum FAQ.

#1frob

Posted 28 July 2014 - 03:08 AM

You wrote that you don't want internet but you do want wifi, which says you really don't understand what you are looking for.


Bluetooth allows your device to talk to other nearby bluetooth devices within a range of about 10 meters (30 feet).

Wifi, or wireless Ethernet, is basically an Internet connection.

In both cases you need to build a way to discover another player, connect with them, and then read and send data. The processes are fairly similar but the libraries are different.


Android's bluetooth libraries can be set up for an ad-hoc bluetooth pairing. Basically you tell two devices that they are looking for each other, they turn on their radios, and then authenticate. Once they are talking to each other you send and read data. Documentation for that is at http://developer.android.com/guide/topics/connectivity/bluetooth.html

If you are looking for wifi, you need the user to connect to a wifi network on their own in the network settings. Alternatively if they are on a data-enabled cell phone you may not need a wifi connection, the data connection connects you to the Internet. You can then use Java's networking classes (java.net.*) to do the work. There are hundreds of tutorials on the web for that, including several linked to on this site's Networking forum FAQ.

PARTNERS