is it possible to send data (e.g. a textfile) directly from one android wearable to another wearable - for example via bluetooth? Or is it required to communicate over the two associated handhelds?
Many thanks!
Henriette
Yes, it is possible since Android Wear fully support the Bluetooth library. You may not use the Android Wear Library that for NOW only connect ONE Wearable to ONE Smartphone.
You need to implement a wearable application managing bluetooth discovery and pairing, then by opening a connection socket you can exchange the data you want.
From the second part of your question, it seems you are referring to two wearable devices that are paired with two separate phones. In that case, there is no connectivity or association between these two devices and you can only achieve communication between them by, say, using the phones and handling the communication over there; that may happen in a variety of ways depending on your requirements
Related
I need to transfer data from android phone to each other through my application using BLE. When a device comes near to me and my application is already installed in it, So my phone will establish a connection and send some data in strings and also receive from that device without notify user. Is it possible to do with BLE and I have studied BLE from
https://developer.android.com/guide/topics/connectivity/bluetooth-le
But I am new so I dont know from where to start and what should i have to do? Kindly let me know about BLE more easy for my better understanding and refer me some tutorials where I can learn that how will fulfill my application functionalities.
Thanks
I suggest starting with the Central-Peripheral example. Here you have an simple application:
https://github.com/itanbp/android-ble-peripheral-central
And tutorial with basis:
https://www.bignerdranch.com/blog/bluetooth-low-energy-on-android-part-1/
In the case you described, if there are not defined roles for the android phones (master, slave), the program will have to work in alternately in two modes: central and peripheral.
This is possible form the BLE side. However, there may be a problem with the application wroking as a background service. Since Android 8 there are new restrictions and limitations in background sericves:
https://developer.android.com/about/versions/oreo/background
Bluetooth Low Energy on Adnroid is very troublesome technology. A lot depends on the version of Android, processor and antenna system of the phone.
When I researched about this problem I came across this. So I know this is possible in Wifip2p api, but I want to achieve the same thing with Bluetooth api. Is it possible?
In Wifip2p api the app broadcasts some text (let's say the app unique code) that other devices (running the same app) are listening and respond, so I can show the device list running my app. But is it possible to broadcast something to all nearby devices using the bluetooth api?
Of course it's possible. Bluetooth applications follow a typical client/server architecture. See the official Android documentation for more info.
As far as I know, wear smartwatches are designed to be companion devices that stay connected to your smartphone. Without a phone around, though, they aren't entirely useless.They'll still function as watches, for one, giving you the time and the date.
But I am not sure if there are any changes to this in any of the latest updates. So I want to know if it is possible to pair two smart watches and send messages using messageapi without the help of a smartphone.Just curious to know ?
Ideally, I want two watches to interact using messageapi to send messages. Is it possible to do without a smartphone?
Well, if talking about pairing two watches with each other, you definitely CAN NOT do this.
But, if you want to extend the abilities of an android smartwatch, you may add some features based on WiFi connection. Since a watch can be connected to a WiFi network, you're able to send messages and do some other stuff with it.
Also you should check up the Together feature, but as I may say, it's built on the interaction of two handhelds, but not wearables.
I have an android app, it does the following:
Connects with a server to read and update a database at the same time as others.
I want to convert this to an app that does not need an internet connection. Therefore i would like to know if its possible to have an android device acting as the server with the database, whilst multiple phones connect to it via bluetooth getting and updating the information in the database?
Thanks
Yes. It possible.
However all of your devices will have to be located nearby, so they can connect to each other through bluetooth.
You can take a look at Android Bluetooth API.
However, my recommendation would be to use Wifi instead of Bluetooth. YOu will need additional WiFi router. However, you won't need to deal with Bluetooth API in such case.
You will only need to write a server on one of Android device and the rest of devices will work the same (as now)
There are a few options to doing so, that don't involve a server. Both of them require a slightly different approach than both devices connecting to a server.
Wi-fi Direct- Only available with Android 4.0+.
Bluetooth
Personally, I have been using the Bluetooth option, and not found it terribly difficult. Essentially, you have to do the following to make it work.
Have one of the devices listen for a connection. If it is unpaired, you will have to make the device discoverable.
The second device needs to initiate a connection. It can do this by looking at the known devices and trying to connect to one, or listening for a new device
After the two devices connect, they must initiate some kind of a communication protocol. The communication is essential a serial connection.
Blue-tooth requires that the devices be within about 10 m of each other. Wi-fi direct will allow somewhat further, but as mentioned, is less supported. It is possible to allow for both communication methods, but is somewhat challenging.
I want to create an Android app that could communicate itself over network. What I want is to send a message from an app to the same app in another device (like how a messenger app communicates with each other). How do I do this?.I would really appreciate any suggestions.
Thanks,
-Parash-
There are various ways and modes of communincation avaiable nowadays, please specify your requirements more precisely. As per messenger communications, devices dont directly interact with each other there is a chat server by which both applications/phones interact. You also make your own. but you need to own a chat server to do so.
If you use Bluetooth or NFC as mode of communications, devices need to be in range of each other.
Third way is to have sms communication, but it involves operator cost to send sms.