I am looking for the best way to send accelerometer data from my Android Wear device (20 entries per second) to my smartphone. The exchange should be as fast as possible to create a nearly real time XYchart on the smartphone.
What is the best way to send my data? Does MessageAPI provides an exchange which is fast enough?
You need to use either the Message or Data API. SharedPreferences aren't automatically "shared" between devices (such as a watch and a phone).
Also, be realistic about data transfer rates. You'll get accelerometer data on the watch at a much faster rate than you can realistically send it to the phone, and will need to handle that discrepancy. It might be that you want to use the Channel API instead - but that will require repackaging your ArrayList into a Stream.
Related
Context to understand my need: I moved to an area without good cellular data coverage but with good cellular voice coverage.
I want to send small amounts of digital data over voice. Preferably over Android phones.
I was trying a way to connect my phone acting as a dial-up modem, but actually I don't think that is possible to use Android as Dialup/FAX Modem
Anyway I don't need that because I have my own servers and I can configure a PBX to receive calls and translate "voice" (sounds) to digital data and send something in response.
Could be great to use all TCP-IP through voice in my phone, but my question accepts answers that just translate "voice" to small amounts of ASCII bytes (or less than ASCII) that my server could send to internet in a predefined way.
So my idea is to programming something for both (Android and server), but maybe exists another easier way to do it (with or without a PBX) or somebody knows of a ready-made library that I can base my invention on. I'm open to start from some good point.
Extra: Also this "feature" could be used in emergencies. And also is a good idea to encrypt data through voice (that is something that you can't do because GSM encryption is broken).
I am new to Wear OS development, and am trying to get user's sleep duration.
I've managed to get sleep data from other smartbands using raw BLE stack, but I don't know how should I gather sleep data from Wear OS?.
I've searched a bit in the web, and most people suggest to use Google Fit API, but in my case, I can't depend on external APIs.
So these are my questions
1) Is there anyway I can get sleep data from the Wear OS direclty ? If Yes, How?
If No,
2) Should I build a sleep tracker myself (by analyzing watch's movement and heart rate) ?
1) No. WearOS is just a system that provides a runtime environment, maybe along with some base functions. Sleep data is not a basic function, while the raw sensor data is yes.
2) Yes. If you don't want to rely on GoogleFit or other 3rd part API. The only way is to fetch the raw sensor data and analyze them your self.
I am trying to find a way to send measurements from a digital device (as the blood pressure device) to a mobile application that can analyse these data ..... How to send these measurements wireless efficiently?
Please use a simple language
You need to make sure your digital device has an embedded Bluetooth adapter so that it can broadcast either BLE with standardized payloads for medical industry like. Your other option, if the data is larger, or streaming or secure, is to use standard traditional Bluetooth.
For this scenario your embedded code would create a server socket.
your mobile would create a client socket and a pairing request would occur.
You can either programmatically handle the pairing or allow the user to do it. Once the devices are paired, you can send bytes directly to and from the device to the mobile phone. Parsing these bytes into the object models that represent the data you are displaying or analyzing.
If you need a Bluetooth Manager Class example for Android I can supply that, but your embedded C code for the digital device is not something i have an immediate sample to provide.
Hope that helps. Let me know if you meant something else.
Im working on a mobile project that involves gathering data from multiple phones that is then distributed to all the phones. Would it be better(power/data usage) to:
1) Send out a single update with the information from all the phones when a phone requests
2) Any time a phone updates a delta with just that information is sent to all the other phones
I am assuming each phone will have a diffrent update frequency.
EDIT: For clarity what is being passed is a simple location object, so it would be either a array of locaiton objects less often or single location objects more often, this will be over 4G or wifi whatever is avalable
It depends on how much data will be transferred and the frequency. If there are multiple changes that can be lumped together maybe you are bettered off sending it as a compressed binary to the server.
However, smaller amount might benefit from differential synchronisation something like git json patches. Google published an article on it: https://research.google.com/pubs/pub35605.html
Alternatively, for small packets of data you might benefit using the MQTT protocol and libraries such as https://github.com/eclipse/paho.mqtt.android
In regards to data persistence and sync, https://realm.io has a good solution going so it might speed up your project. I've only started using that DB on a personal project.
I require a fast reliable method of sending control commands (simple data, possibly only a few dozen possible commands) to a remote system which is using a smartphone* as its onboard computer. I have deemed standard data packages used for mobile internet data transfer as too unreliable of control purposes, however I have noticed that once a voice call is initiated it is much more reliable. Has there been any development into sending data between phones across a connected call, and if not are there any known reasons a modified dialup modem in software form couldn't be used?
Furthermore, could this protocol be robust enough to send back low res video and other simple numeric data?
*Smartphone - A phone with significant processing power and ability to run custom programs (most likely with an Android based OS however am open to suggestions)
Have you tried SMS? while you won't get video data it may work for small chunks of data. Also if the small chunks are from the phone to a server, you may try sending DTMF down the line (however I've yet to see that working.
Other than that it's customised hardware.
Hmmm...this reminds me of those old TV games like Hugo...there you had a voice connection and I think the commands were given by the different tone of the key pressed from 0-9. Maybe you should try something similar.