Grim
Grim

Reputation: 2030

Message from Android to Android without Accesspoint

I have two Android-Devices, i have no IP-Addresses the Mac-Addresses are

 d0:e7:82:fa:90:33 (a)
 8c:bf:a6:a8:77:8f (b)

how to send a byte from a to b? Is it possible?

EDIT: droped DatagramSocket-Sources because its packed-based.

By the way: Wifi-Direct or Bluetooth is not supported by the devices.

Upvotes: 9

Views: 880

Answers (6)

Reza Mohammady
Reza Mohammady

Reputation: 101

Can you use wifi Hotspot technology? Make adhoc network. See Create Wifi Hotspot Configuration or Programmatically Turn on WiFi hotspot or Android turn On/Off WiFi HotSpot programmatically

Upvotes: 1

Grim
Grim

Reputation: 2030

As some mentioned, this is not possible without an active connection!

Because any other way will loose support and warranty:

I realy was able to send packages between those devices in 802.11(by filter uninterresting octets) without beeing connected but all devices must be rooted!

Another solution i successfully handled: was to download the Android OS-Sources and compile a realy own OS having modified permission-checks (loose of warranty).

Upvotes: 1

Don Chakkappan
Don Chakkappan

Reputation: 7560

Thats what we have BlueTooth Data Transfer .

Accordning to your criteria you should go for data transfer using BlueTooth .

Here is nice answer clarifies the use of Mac Address .

Here is sample project for Android BlueTooth chat

Upvotes: 0

Steven Mark Ford
Steven Mark Ford

Reputation: 3432

What you looking for is the rich wifi p2p api that android offers. Please see https://developer.android.com/guide/topics/connectivity/wifip2p.html

or for close range small packets: http://developer.android.com/guide/topics/connectivity/nfc/index.html

or for larger range if bluetooth supported: http://developer.android.com/guide/topics/connectivity/bluetooth.html

Upvotes: 0

Kushal
Kushal

Reputation: 8508

Your 2 devices should be connected via any network, then we can communicate over UDP protocol using DatagramPaket and more from java.net.DatagramPacket

Note : If we can communicate between 2 devices only knowing their MAC physical address then what is need of network !!

This is contradiction against Network Layer definition

EDIT :

You can use JPcap application but there also your 2 devices should be connected via Ethernet. Check Tutorial and More information

Upvotes: 0

Sarim Sidd
Sarim Sidd

Reputation: 2176

You can use UDP to broadcast message. It simply broadcast the message and every device on the networks gets it, even the sender. However, message delivery in UDP is not guaranteed, it may drop. So you need to handle that on client side.

Upvotes: 3

Related Questions