What are good ways (existing) to transmit data between multiple mobile phones without internet?
Asked Answered
G

6

13

Background

I have an idea for an app on vacation that needs to communicate to other phones with the same app. While on vacation those phones might not all have internet as roaming can be very expensive. The data is not a lot: like 500 kB max would suffice (in json).

Every phone has a bit of info that all the other phones would like to know, but if it helps the info can be stored on 1 phone (master phone from now on) and shared later to the other phones when back home over internet.

Phones

Android, iPhone and Windows Phone We can't assume they have NFC, IR or zigbee. Just the hardware almost every phone has like bluetooth, camera, microphone etc.

My ideas

  • QR codes that changes, based on new info: If the first phone is scanned the second phones QR code has data from the 1st phone and itself and the 3rd phone has data from the 1st, 2nd and 3rd (itself) until it reaches that master phone that holds all data.

  • Data transmission trough sound that we can't hear (or we can). Con is that I don't know if something like this exists for mobile platforms and writing it is like a 3 year master thesis project.

  • Bluetooth. Can we connect like 8 devices? Would it work consistent (connecting even my headphones can be a hassle, what about 8 phones who try to connect simultaneously)

All of these ideas have big cons. Maybe I'm overlooking a better way.

I will add a bounty to the question for the best solution An answer that explains it with a little bit of code reference (link is ok) is always better than just: "use bluetooth man"

Greig answered 9/2, 2016 at 10:2 Comment(3)
Was there something I missed in my answer?Amphetamine
@CaptJak Don't worry, I just thought it wouldn't be nice to give the bounty before more people had a chance to answer as well.Greig
OK, no problem. I was just wondering if i had greatly misunderstood your question (and did research for nothing...) :P.Amphetamine
A
15

TL;DR

The easiest (and most supported) way of getting multiple devices to connect to each other is using WiFi. Since your goal is to achieve data transfer with no internet, the most appealing solution would be to use a Peer-to-Peer network structure.

The two major smartphone OS's (Android and iOS) have API's and documentation on creating and transferring data over a Peer-to-Peer network.

These two also have a means to encrypt the data being transferred.

Windows doesn't seem to have an API to allow multiple peers connected, but their Proximity Class will work for one device at a time.


I can give a few outlines over the different options in each major OS:


Android

Android's WiFi P2P (peer-to-peer) API was created for transferring data without internet or another network.

From their documentation:

The Wi-Fi peer-to-peer (P2P) APIs allow applications to connect to nearby devices without needing to connect to a network or hotspot (Android's Wi-Fi P2P framework complies with the Wi-Fi Direct™ certification program). Wi-Fi P2P allows your application to quickly find and interact with nearby devices, at a range beyond the capabilities of Bluetooth.

Google even has Documentation and training on this API.


iOS

Apple's Multipeer Connectivity.

Very similar to Android's P2P API, they claim:

The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files).

Here is a decent looking tutorial on using Multipeer Connectivity.

--EDIT--

Another iOS way of doing this, which is a bit of a mis-utilization(?) of the tool, is by using GameKit.

However, I think that to get it to work for your purposes might result in a bit of a hack, since the "players" have to be using Game Center.


Windows

The only way (apparently) to connect phones in Windows Phone, is by using Proximity, however, that only gives you the option of connecting no more than two phones together.

They state:

Proximity is a great way to create a shared app experience between two instances of your app running on two different devices.


Those are options in each of the major mobile device OS's.

App usage could be something like:

  • Decide which device was going to be the "master", so that other devices can connect to it. It isn't required to know this before deploying the app, but there should be a way for the user to decide whether he is going to be a client (receiving data) or the server (pushing data).

  • Once it was decided between the group of devices which was going to be pushing data, that device would have to be registered as the server (in the Android P2P API, you can establish a "group owner"), and then start looking for peers by initializing the service.

  • Then, once the devices are connected to the master device, you can start pushing data. An additional bonus is that when using Android WiFi P2P, all communication is encrypted with WPA2, and with iOS, you can enable encryption using MCEnableEncryption (however they state that is slows down data transfer rate).

Now you would just have to pick one method to go with, and make sure that all the phones ran that OS. Because these three methods of connectivity won't work together.

All of the three methods listed are done programmatically, so there should be no strange or odd things that your user will have to do. Searching for other devices, connecting, and transferring data can all be done within your app.

More help can be provided if the question is narrowed down to specific problems, but this should be enough data to get you started.

Amphetamine answered 16/2, 2016 at 1:27 Comment(2)
Hello @CaptJak is it possible to connect multiple devices with Peer2Peer android ? I tried it but it is not helping me. Any help will be appricated.Tildy
Hello @AmitJayaswal. Yes it is possible, as I've outlined in my answer above. If there is a specific problem you are having when attempting to implement this, I suggest you post a new question showing what it is you are trying to achieve, what you have tried, and what is not working exactly.Amphetamine
P
4

Have you checked Alljoyn?

As quoted:

"Developers can write applications for interoperability regardless of transport layer, manufacturer, and without the need for Internet access"

Pelmas answered 17/2, 2016 at 8:46 Comment(1)
Just as a note, the devices connecting still must be on the same network (doesn't have to be internet), so that would have to be established first.Amphetamine
U
3

Don't try QR or sound. I think it would be very painful to transmit 500kb of data. Bluetooth seems like a good solution but maybe, as you already said, hard to configure.

What do you think about wifi?
At least every Android and iPhone device can create a mobile wifi hotspot. By using this, you can easily setup a environment where 8 devices are in the same LAN (without using the internet by any of your devices).

Now your "master phone" runs a simple server to synchronize data (just like an internet server would do). Every of the seven clients could receive the ip adress of you master by scanning a simple QR code or sending a short message and afterwards configure itself accordingly.

Uxorious answered 9/2, 2016 at 14:25 Comment(5)
but can I start / connect all devices from my app even on iOS? Googling didn't give a clear answer, but I actually am afraid apple wouldn't allow it. and everything by hand is not doable for "normal" users (UX whise)Greig
Not if it is not jailbroken. But you could display the qr code on your master phone and encode the wifi name, password and master ip adress in the qr code. Then explain to the user how to connect.Glucose
what about setting up the hotspot itself? I want even the most technically challenged of users to be able to use my appGreig
You can setup a hotspot programatically with android. I have no idea about the situation on iOS. As far a I know, you can at least open the matching settings screen programicallyGlucose
If you provide some nice code reference or example for all 3 platforms in which the user had to do the least amount of work themselves the bounty is probably yours.Greig
S
2

You can create a Wifi connection between your devices. Than after connection it creates local network between your devices. Inside this network you, of course, can interact between your devices using TCP/IP connection. It works both on Android and iOS. Simply lauch your app as server on the one device

EDIT Note, you have to connect your devices using any network. It is possible to connect the devices by initializing your device as WiFi-router. It can be both Android and iOS. If it is possible, you can connect your devices to any wifi connection. Than, launch your app as Server-socket, the others as clients. for Android (java) server use this link: https://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html

try ( 
    ServerSocket serverSocket = new ServerSocket(portNumber);
    Socket clientSocket = serverSocket.accept();
    PrintWriter out =
        new PrintWriter(clientSocket.getOutputStream(), true);
    BufferedReader in = new BufferedReader(
        new InputStreamReader(clientSocket.getInputStream()));
) {

for android device client:

try (
    Socket kkSocket = new Socket(hostName, portNumber);
    PrintWriter out = new PrintWriter(kkSocket.getOutputStream(), true);
    BufferedReader in = new BufferedReader(
        new InputStreamReader(kkSocket.getInputStream()));
)

The same idea is for iOS (Objective-C): server https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html#//apple_ref/doc/uid/CH73-SW8

and client: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html#//apple_ref/doc/uid/CH73-SW4

Suannesuarez answered 9/2, 2016 at 15:2 Comment(1)
If you provide some nice code reference or example for all 3 platforms in which the user had to do the least amount of work themselves the bounty is probably yours.Greig
F
-1

A better way could be use Ble.

It's easiers to connect the phones because you don't need user confirmation.

Seems like you can connect up to 20 devices Maximum number of peripherals on CoreBluetooth?.

To transfer 500KB should require few minutes (may be between 2 and 5).

Floury answered 9/2, 2016 at 14:5 Comment(1)
Thanks for thinking along, but 1 of the requirements was: We can't assume they have NFC, IR or zigbee. Just the hardware almost every phone has like bluetooth, camera, microphone etc. BLE is not yet available for everyone.Greig
W
-1

You can track an Android device without Internet via GPS.

Connection without The Internet:

  • SMS

  • USSD

  • DTMF (very slow)

How to design a tracking device on USSD is mentioned at M2M IoT Cookbook

How to develop a device based on Wireless Wide Area Network modules

You also can use the Android phone as a data logger and store under the Micro SD Card and read the card by:

  • Replacing the SD card to your PC

  • Streaming the data local by Bluetooth

  • Forwarding the data at home by Wi-Fi

Or Possibly:

Your app can use SMS API to transmit the DATA or other SOURCES.

Watchdog answered 15/2, 2016 at 13:11 Comment(1)
SMS is very expensive abroad, USSD and DTFM are not programmable as for as I know (besides I see no reason it would be better). Swapping SD cards around: so much for UX. Bluetooth: Please provide an answer with examples for 8 phones to share data at the same time that work well (because I know it can be hell to connect even 2 devices over BT) forwarding: it does not answer the question, we want the data of all phones on at LEAST 1 of the phones while abroad.Greig

© 2022 - 2024 — McMap. All rights reserved.