I have created an android app and would like to enable users to transfer data (e.g. over TCP). Both have my app installed. Is there any framework or guide how to use bluetooth and/or w-lan to get a good user experience? How do they initiate the connection?
Thanks!
I learned how to use Bluetooth on Android by this link, analysing the source code of the example.
About sending information through TCP/IP, use normal Java for that (Sockets, for example). The only extra you could put it is to send an Intent to activate Wireless if was not activated yet.
Related
I want to send data (for an example it contains the information: name,address) from my app to another hotspot enabled android device using the same app and display the information in it. So, how do I transfer? If it is not possible please tell me if there any possible way to transfer data via WiFi. Since I am new, procedure with code help me a lot.
This is what you need. P2P communication can only by performed by devices that run android 4.0 and up.
The scenario:
I have a android app running my in cellphone. I´m the owner of this app.
I have a google-glass synced with this cellphone. I´m developing a my app for google-glass using the new GDK launch a few weeks ago.
I want to send a data from glass to cellphone and then receive a answer.
No internet connection is necessary, so i´m planning to use Bluetooth to this data communication.
I can create a Bluetooth socket connection, however this will obligate me to manage it.
There is no android high level abstraction that permit me to call a service or a activity directly on the cellphone?
AFAIK, there's no direct pipe between them, the glass is basically a phone with a different set of inputs and outputs. You can create and manage the connection, and it's yours.
AFAIK, there is no other way to do this, as Travis said there's no direct pipeline between them, seems to be true. You can use use BLUETOOTH Chat Application included in the Android SDK.
Just change the input method to voice input in the application
Install that Application in both the devices
Try It
change the code accordingly to send files too.
I am trying to provide an application which sends multiple data between two different devices via NFC. For ex: device1 sends "date" comment and device2 gets the comment via NFC communication and then device2 checks the comment coming from device1. For device2, "date" means date of today and then device2 sends response message (such as 23.05.2013 14:21:45) at the same time. Not only "date" comment, but also the other comments should be used for the communication. For ex: when device1 sends "who are you" comment via NFC, device2 should send "i am Alice's device" at the same time. Is it possible? Can i make such a communication between two different devices at the same time? Thank you for your help.
Sending data via Android Beam in response to a received NDEF message transfered via Android Beam is not possible.
Technically the protocol Android Beam is built upon (LLCP) allows bi-directional data exchange on roughly 240 logical channels at the same time. This capability is just not exposed to Android applications.
You can hope for an API update, but I wouldn't wait for it. A hidden API for this existed in Android 2.3.3 but was later removed for some reason.
As Nils said - via NFC alone, this is not possible due the the limited Android API.
However, I am aware of one way of achieving it by using connection handover. Essentially, the NFC communication is used to send some credentials to the other device that allow the two of them to connect over Bluetooth.
The EasyNFC library claims to achieve this bluetooth functionality. I gave it a try and I think I was able to set up a socket, but never properly tested it. I didn't find it too reliable and I did not want the addition of bluetooth in my application, nor the use of the "Touch-to-beam" UI.
I have a task to integrate a Bluetooth device into my application. Now my requirement is very specific. The device has a specific communication protocol which relies on certain ACKs but I figured it would make my development much easier if there was a program that let me test communication with the device.
I was wondering if there was a program for Linux, or perhaps a simple Android program which let me communicate with any Bluetooth device with a series of pings using data I enter and simply log the responses.
EDIT: I might not have been clear enough in my question.
I have a scale that I need to integrate into my application, and the scale has a protocol similar to this:
Get a specific byte string from device
Transfer data
Transfer packet for disconnection
Receive acknowledgement for disconnect packet
Disconnect
Now when I have to issue a POST request from my application, I usually build a test script online so I can test if the POST works properly.
I was wondering if there was something similar I could do with the device.
Thanks
Your question is not clear enough. To communicate with a BT device, you need to know what profile your device supports. Depending on that, you can find a way in Android or Linux or windows to communicate with the device.
The simplest way is to open an RFCOMM channel from android/PC and transfer data to and from the device. For this the device has to support the serial port profile (SPP). If you want to do this in Android, look for the BluetoothChat example from google.
If you want to use a PC/mac/linux look at the Bluez python module. It's really simple to use. There are plenty of other options too..
I was looking for something like SENA BTerm. It lets me connect to any device and send whatever data I wish.
It is an extremely useful tool for testing my code.
http://www.sena.com/download/manual_bterm/overview.html is where you can find it.
I want to send and receive information between Emulators in Android.i am using two systems and i have installed android in both the systems and i have to consider one emulator as server and another as client.Now i want to send data from one to another.Anyone knows regrading this please help me with some sample code.
What sort of information do you want to send between the emulators?
You can transmit SMS messages, or simulate phone calls, from one emulator to another using the target emulator's console port number as the number to dial. The Android Developer Site describes the process in more detail under "Sending a Voice Call or SMS to Another Emulator Instance"
If you want to transmit data, unfortunately Android doesn't currently provide any P2P or Instant Messaging APIs, so there's no generic technique available through the SDK you can use.
Your best alternative is to create your own server-based solution (or your own P2P API, though that might be a little more complicated).
Take a look at Java Socket.