7

I am currently working on the creation of an application for mobile devices with Android which should be capable of sending and receiving messages through local means like wifi and bluetooth. After making a research about it I found out that Android doesn't have a native wifi ad hoc functionality and that the only way to achieve that is through rooting your device and patching the wpa_suplicant and some other similiar methods which are not generic for every device.

Synopsis of what I am trying to achieve:

An application for Android that scans for devices nearby and tries to connect to them automatically. If the other device also got this application isntalled then it automatically accepts any connection request it receives and when the connection is established it sends back a message which ensures that it has this app installed so that both can start exchanging messages automatically and the users don't have to allow/deny any of the sending/receiving in real time.

My questions are:

  1. Is there any way of sending messages through wifi between 2 android devices without the use of internet?

  2. Since Ad Hoc is not supported, is there any alternative?

  3. In case the answer to 2 is no , then is it possible to make one of the devices to be an access point so the other can connect to it and vice versa.

  4. As for bluetooth, is it possible to skip or automate the allow/deny pop up of an incoming connection and the pairing procedure?

I'll be glad if you could give me an answer to those and/or any suggestions.

5
  • Sorry, but development questions are off-topic here and belong on Stack Overflow. Please take a look at our FAQ to see what is on-topic for this site. Commented Aug 22, 2011 at 15:30
  • 3
    I think this question is fair for this site. It's asking more if what is desired is technically possible, not so much a programming solution. (That said, I think it also could have been asked at Stack Overflow, but in its current format would probably be kicked over here.)
    – ale
    Commented Aug 22, 2011 at 15:56
  • 1
    @AlEverett: I'm not sure I see that in this case, but either way: I don't think the new title really reflects what the OP is looking for. Answering "How do I do this?" as an end user can be a lot different than "How do I do this?" as a developer, IMHO. The answer to #3 on the list, for example, would be to use a wifi tethering app that supports infrastructure mode. I don't think that really helps if you're trying to implement it on your own, though, unless you just use the source code from the tethering app or make it a prerequisite to using your own app. Commented Aug 22, 2011 at 16:07
  • Also, from a user standpoint: this question might be related, though I think it only specifically covers voice over wifi (without internet access). Commented Aug 22, 2011 at 16:09
  • yes thanks for pointing this out, I am sorry I took the fact that this site deals with developing for granted, could someone of you migrate it there or should I repost?
    – user452730
    Commented Aug 23, 2011 at 16:16

2 Answers 2

3

I've myself worked on similar project in which not just text messages we were also interested in having audio chat (real time). As you pointed it, Android doesn't really support ad-hoc wifi functionality as of now (like u said that patching the wpa_suplicant isn't generic and frankly I'd call that method useless.) Also as your needs even I wanted to NOT use internet, so not being able to find any other way, for that time I just went with using any local wifi connection in proximity to connect with (just to be clear, still we're not using internet) I hope this possibly answers your points 1/2/3. I'm not sure whether a better solution to 1/2/3 exist atleast as long as Android people doesn't allow an ad-hoc to be created (or atleast joined..as of now one can't even join ad-hoc wifi from android if I'm correct)

Regarding 4, I'm again sorry to say that answer to that is also 'No'. When two devices connect first time, pairing has to happen. And, as far as I remember (I did this project a few months back and didn't get any time to continue/build upon) for subsequent connections to already paired devices it didn't ask for any confirmation besides our own confirmation which we asked to accept incoming voice call. Other than that bluetooth method actually worked perfectly fine.

Hope that helped. Let me know if there is something I can clarify more.

-Atul

3
  • One advantage of using external wifi connection was range can be much more than possible with ad-hoc created from Android (even if we could create ad-hoc from android)
    – Atul Goyal
    Commented Aug 22, 2011 at 17:07
  • Thank you Atul for your quick reply, what do you mean by "any local wifi connection in proximity to connect with" I guess it is through an access point only right?
    – user452730
    Commented Aug 23, 2011 at 16:24
  • yes. sorry, if I wasn't clear.
    – Atul Goyal
    Commented Aug 23, 2011 at 17:02
1

This use case now have an obvious long term solution:  Android Beam/NFC. Not many devices supports NFC yet though, so there's still necessity for other techniques.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .