I would like to use a raspberry pi as a central server for an application I'm building. Basically, I want the raspberry Pi to act as a server which can be used by co-located mobile devices to communicate with each other. I'm trying to build a local access network, and there is no need for an Internet connection. I am going to build an application on Android to interface with the server.
I have considered using an ad-hoc network, however, I have found through the following (among others):
Can
Android do peer-to-peer ad-hoc networking?
xda-developers
thread
that Android does not play nicely with ad-hoc networks unless rooted. I am not in a position to root the cellphones, so what else could one do in this instance?
What is a replacement for an ad-hoc network that is compatible with android?
I ended up creating an Access Point, as suggested by #Jonathon Reinhart. Here's a tutorial on how to do that http://elinux.org/RPI-Wireless-Hotspot
Related
I am trying to create Client-Server connection network over android devices via blue-tooth(as the connection platform).One device acting as Server and other 4 or five devices as Clients.I have tried many examples from git-hub repository but there is no multi-connectivity implementation.Here is the link I tried for multi connection via blue-tooth
https://github.com/arissa34/Android-Multi-Bluetooth-Library
First of all, you have to notice this library is for socket communication using RFCOMM protocol which is not Low Bluetooth
https://en.wikipedia.org/wiki/List_of_Bluetooth_protocols
If you want help, I need more informations, as your android version, a piece of your code and your logs as well.
Moreover, you can see this library in work on this game https://play.google.com/store/apps/details?id=com.drgames.domino Using one server and 3 clients in bluetooth.
i'm working on a wireless ad hoc network, at the moment i still designing my network.
The network should work for android devices.
Until now i thought to use a phone as a hotspot, so nearby devices could connect each other, but what if two hotspots have to speak to each others?
Basically the question is: Can two or more hotspots connect and communicate each other?
Thank you.
Yes, you need to use WiFi Direct for this. When using WiFi direct in concurrent mode, and device can act as both a client and an AP the same time. This is what you need. Whether it will work for you as is, depends on your specific device and driver, but there is support for WiFi Direct in Android since v4.0. Sometimes WiFi Direct is also called WiFi Peer-To-Peer or WiFi P2P and this is what the Android API calls it.
see Android WiFi P2P
With the Android API you can discover other peers and services you define and connect to them.
The WiFi p2p utilities are under very active development, so I am not sure if the Android is currently supporting the concurrent mode. You can try. However, you can also setup your connections directly by using the wpa_supplicant utility which is actually what Android is using internally. I have been able to use this directly from my applications for other purposes. If the version that Android is using is not working, or if you find it a bit unstable, you can get the latest version from the hostap and wpa_supplicant projects. Installing those may require root access though.
I have two android apps connected with wifi (over AllJoyn framework). Can
I test (e.g. ping) their connection using a test framework like JUnit?
Android simulator doesn't support wifi.
Is there any mock object simulation wifi?
Especially for alljoyn how can I test my app?
Update on 19/7/2014: I have given up AllJoyn. I had many problems. Especially multicast packets on most routers are blocked. And since I cannot modify every router my app is useless with AllJoyn.
I'm trying to develop an Android application which have to be able to transfer data/message between two Android mobiles, as a client server connection using their own Wifi, which having no network or routers nearby. I just tried using Tcp program to do this but it fails, its not connecting, I'm getting ConnectException and connection refused.
[Edited] Is it possible to achieve this using Android Portable Hotspot integrated with application? Is there any tutorial regarding this approach?
Any Ideas, how to do this?
Thanks.
You need to get the two devices networked to each other before you can worry about tcp usage of that network connection.
If one device is willing to perform access-point like functionality as part of a portable hotspot, and you select that as a wirelss network on the other, you may achieve a network connection between the two that can be used for custom traffic. Though there are ways the hotspot could be implemented where that would not work. Also of concern, the "client" device will now be sending all of its network traffic through the hotspot device, including not just foreground apps but anything it decides to do in the background.
Is it possible to push data directly from one device to another over the mobile network without using a server and without wifi or Bluetooth?
(Both have the same app installed.)
How? :)
Yes. Android is capable of peer to peer communication over 3G
Google for android 3G peer to peer and you will get many hits. And you'll see that you have some hurdles to overcome:
Identifying own and target Android's internet IP
Configuring the right sockets etc.
Getting past firewalls
And all this is depended on whether or not your telecomm provider allows P2P in the first place.