Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  eldarerathis Aug 22 '11 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.) –  Al E. Aug 22 '11 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. –  eldarerathis Aug 22 '11 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). –  eldarerathis Aug 22 '11 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 Aug 23 '11 at 16:16
add comment

2 Answers 2

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

share|improve this answer
    
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 Aug 22 '11 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 Aug 23 '11 at 16:24
    
yes. sorry, if I wasn't clear. –  Atul Goyal Aug 23 '11 at 17:02
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.