Target:
Sending a file to connected peers. The connected peers should recieve the File without a preinstalled app.
Situation - Question:
I'm writing an app that opens WiFi-direct or a WiFi-Hotspot for other devices. The other devices connect to the device (Main-Device) where the App is installed on. Now the Main-Device should broadcast a file and every device connected to the Main-Device should get a notification, that it could receive a file. But, the other devices should not need an App to receive the file!
Is this possible? Cause all I found till now describes how you can send something from one to an other device if both installed the same app. Using sockets and one device becomes server and the other client.
Reason:
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi, then they'll receive a HTML5-file from the Main-Device which they can open in their browser. As soon as they have the HTML5-file they'll be able to interact with the game on the Main-Device.
But I don't want to force everybody who likes to join the game to download the app. Another Point is, if this is possible, I don't need to rewrite the app for other systems. Cause every Smartphone/Tablet has a Browser.
But, the other devices should not need an App to receive the file! Is this possible?
No, it isn't.
I try to create a game, which just is installed on a Main-Device. Other devices can join the game by connecting over WiFi
That, is possible. What you need to do is build a captive portal.
Basically, all DNS names resolve to your server's IP address, and all traffic that would be routed elsewhere is not routed to the internet. How you do this depends on your network setup. There is a lot of software available. I've used Untangle before with decent results: https://www.untangle.com/store/captive-portal.html
Related
I want to develop an android application for LAN calling.My app resembles apps like whatsapp, viber etc, so I googled for the same. What I got from different answer is:
Whenever we install whatsapp, the whatsapp server register our number and contact list. The app continuously pings the server and update its status on server.
When we open the app, it gets the data from server, and if a number is found in contact list, it displays the status of the number and other things.
Whenever we message some one, the message goes to server and stays there until delivered successfully.
For my app the two steps are:
Find all the devices which has my app, their IP and mac address.
When devices are found,allow calling between them.
For step 1, I have two options:
As whatsapp, I can have a server. It registers the info of the mobile phone, whenever the app is installed. The app pings the server and shows its status.
I can use my own network device discovery code. This code scans the network and find the devices.
This step is costly, whole network is flooded with the packets. And also it is quite difficult to write network device discovery code.
For step two, I want to implement client-socket programming and simply connect the microphone of one device to the speaker of another phone. I think it is challenging, but it is possible.
Please help me with network discovery code or the server setup. I am quite familiar with android development, but very novice to networking.
Also how calling is done between these devices?
I have searched for the answer and found the following links: Peer-to-peer SIP call with Android SIP Stack?
how to implement voip in android
VOIP on Android libraries or sample code
I also put a question on quora:
https://www.quora.com/How-can-I-develop-an-app-having-feature-like-whatsapp-calling-in-android
But, still I am stuck at the beginning. Please help me with it.
Not a complete answer yet, but here are the things to look for:
Assuming Java is your language, use Multicast Network discovery in Java using multicasting and https://en.wikipedia.org/wiki/IP_multicast
Calling needs more description. Does the call starts immediately (as soon as the peers detect one-another) ? How does one know the identity information - a number or a username etc. ?
I have one Bluetooth application. If I install that app in 2-3 devices then How to know that same app is install in another devices or not like xender.
How to share local database of application via Bluetooth.?
You can Create UUID's for your Application and connect your application using that UUID.
While discovering devices, you can check whether the UUID of your application is supported by the other device. If yes, then you can display it, otherwise don't display !!
Something like this to initiate connection - device.createInsecureRfcommSocketToServiceRecord(YOUR_UUID);
For more insights, refer the BluetoothChat Application by Google, available at https://developer.android.com/samples/BluetoothChat/index.html
So I am developing an APP and I need to connect multiple android and multiple Iphone to send text data without any internet connection or service provider data network.
So one of the phone will have to act as a server to relay information between them. But the app will have to decide which phone will be the server and if a phone that is the server leaves the conversation then another phone will pickup as the server this will all be done with some smart programming but before I get there.
I know Android WiFi direct can do a one to many connection setup which makes it easy to connect android phone and accomplish the task between android phone only. But the problems comes when I need to connect Iphone with the android phones. Since the Iphone must be able to act as a server as well.
I would like to know a few things:
Can I connect Android and Iphone via WiFi Direct?
Can I connect Android and Iphone using Multipeer connectivity feature on Iphone?
Is there anyway to create a soft access point using Iphone? I know android can do this via WiFi direct feature.
If non of these can work can you suggest something.
From the discussion here it doesn't look possible
I wonder though if both OS allow enough control over the WiFi transceiver if you couldn't just write an app that could what you are asking and just bypassing the built in software architecture all together. I would think Bluetooth would be too weak except in extremely dense device saturation environments, but just for proof of concept that could be another route to take. My guess though is that you just wouldn't get that level of control over any of the radios inside a phone through the current OS.
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:
Is there any way of sending messages through wifi between 2 android
devices without the use of internet?
Since Ad Hoc is not supported, is there any alternative?
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.
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.
You'll be able to communicate between two devices over wifi without a router/access point using Wifi Direct (P2P) in Android 4.0.
Otherwise, I don't believe you can achieve this over Wifi (bluetooth would be the next best alternative). Since 2.2 you can set your phone up to be a Wifi Access Point (for tethering your device's network connection), but during this time, the Wifi hardware is unavailable for normal use. If you had 3 devices it could work (1 AP, 2 connecting to it).
Is this for a constant connection, or a one-off small delivery? You could use NFC if you want to transmit a URL for example (Android Beam integrates this type of sharing in Android 4.0, but could implement it in 2.3).
I'm trying to learn android and for my app i have few questions.
If i type a computer name on the EditText in my android phone, I
should be able to ping the device (So basically i need to first
resolve the ARP to get the mac address of the device which I want to
ping and then send the ping as an ICMP request).
I believe there is some command to retrieve the computer name and
send this ping command, but i would like to do it the hard way so
that i can learn stuffs better - It would be nice if you can show me
some pointers to some tutorial apps and open source code which does
similar tasks.
Once I have identified and connected to the device. I should be able
to start a chat with the device.
Assume the second device is also an android device, how can I
establish basic message sending from one android device to another.
Basically my app will be a client and server (I guess 2 services - service listening to sockets for incoming messages and client can send out messages).
Does anyone know any sample app / tutorials [basically code examples] which does this in android.
To Nr.1
I'm not quite sure why you first need to ping the device, as you could simply try to connect to the given device (using a timeout) and see if it can be connected.
I found some informations on this, here.
To Nr.2
So, if you want your Devices to communicate to each other, you'll want to use Sockets.
But, if your App is only for chatting and you don't need to know if the last send package was successfully send, you could also use UDP instead of TCP (So you don't need your application to run both the Server and the Client-Socket).
Although, all your questions could have been answered by doing a little googleing...