I made an android app that relies heavily on very accurate sensor data (magnetometer, gravitymeter and accelerometer). To achieve this I validate all these device sensors periodically for highest quality of service by checking the sensor status for SENSOR_STATUS_ACCURACY_HIGH. If one of these sensors doesn't have this status I show a calibration screen until the high accuracy can be delivered. On my own device this is working perfectly fine, but I get a lot of app reviews from people who can't get around my calibration screen. My question is, can I rely that every android device is per se capable of delivering SENSOR_STATUS_ACCURACY_HIGH or do I have to lower the minimum accuracy? If so, how is this status even defined cross devices?
No, you can't. And even if you could, its possible for the sensor to be broken and returning the high status incorrectly. And you don't know if OEM A and OEM B have the same definition of high. In the end, you're trusting the individual hardware drivers for each device, and hoping all of them are both acting in good faith and had the same definition of "high accuracy". Neither of which are really reliable.
Related
This question is not exactly about code but rather knowing the sensors on android phones.
My application use sensors. So I would like to know is Light sensor or Proximity sensor is present on most of Devices. I have got some test devices and my observation is only higher end devices have got Light Sensor whereas the same is not available on lower end(low cost) Phones but the Proximity is available on all Phones. There would be someone playing with sensors so far, can share your observation so I can take the decision what to choose to go further with my application.
Thanks.
Check
https://developer.android.com/guide/topics/sensors/sensors_overview.html
and especially the "Sensor Availability" part.
My personal observation is that proximity and light sensors are available at least from 19 and work so far on Samsung, ASUS, Huawei, and other devices. But light sensors are more sensitive on high-end devices. So sometimes an extreme light change is needed for a light sensor on lower-end devices to even show a change from baseline 0.0. Proximity sensors work more reliably across versions, but the distance they support varies from 5cm until 10cm and more.
In short these sensors will work virtually on all relevant devices, but their sensitivity itself will be different.
I have been using Google's ActivityRecognitionApi to try to determine when an Android device is being moved. On most devices I've tried this gives pretty decent results. But on some devices I mainly get an activity of "still" with a few "tilting" and "unknown".
I assume that this poor performance of the ActivityRecognitionApi is due to the sensors available on a device, given that the ActivityRecognitionApi uses these, from the documentation:
The activities are detected by periodically waking up the device and reading short bursts of sensor data. It only makes use of low power sensors in order to keep the power usage to a minimum.
What I want to be able to do is determine, for any given device, if I can rely on the ActivityRecognitionApi or not.
Again in the documentation it says
To conserve battery, activity reporting may stop when the device is 'STILL' for an extended period of time. It will resume once the device moves again. This only happens on devices that support the Sensor.TYPE_SIGNIFICANT_MOTION hardware.
Which clearly states that a device that supports Sensor.TYPE_SIGNIFICANT_MOTION is relevant, but it's not clear, at least to me, from this, that this sensor is actually required to provide good Activity Recognition results.
So what is the best way of determining if a device is going to give good Activity Recognition results?
As an amusing (at least to me) aside, I'm particularly fond of results such as:
activity: unknown
activity_confidence: 50%
I and a couple of friends have got a list of requirements for a new project. This project, basically asks us to synchronize a specific directory in a laptop with the user's phone (just like dropbox does) but using BLE for the communication.
Everything is working as expected. We're using Android on the phones and a BlueGiga USB dongle on the laptop side. The only problem we're facing is that we cannot limit the distance in which the phone is detected.
We do know that we can modify the TX Power and also the Advertising mode as it's explained here (https://developer.android.com/reference/android/bluetooth/le/AdvertiseSettings.html). The real problem is that we cannot get the same max distance on every phone because of differences with the chipsets, antennas, etc throughout all the Android devices in the market.
How could we do to limit the connection distance to 1 meter for all the devices running Android? We'd need to rely on the RSSI values but I'm open to different approaches anyway.
Thank you very much in advance guys and remember that everything is working perfectly. We just need to adjust the max distance.
Thanks.
Max.
Simple answer: You can't get an absolutely exact range limitation because of the physical properties of electromagnetic radiation. There are so many things you have to take into account, which makes it a quite difficult and complex task.
What you can do is very sophisticated calculations based ony many different factors to get an approximation. As already mentioned in the comments, you might find helpful libraries with algorithms and formulas for well known devices, chipsets antennas etc. so you don't have to do all the calculations on your own.
With the help of some libraries and tools, you may be able to quite safely determine if the device is within a range of between 1 and 3 meters.
I have a GPS logger app I have wanted to make for a few years now. My old phone could never do it (HTC Desire Bravo A8183) as the GPS update rate was only 1Hz. Friends are telling me their Samsung and iPhones can do 5Hz GPS now. I have installed the same app I used in my HTC in my Nexus 5 to measure the GPS update rate and I am still getting 1Hz as the standard update rate from the Nexus 5.
At first all I want to make is a position recorder that saves GPS coordinates to the onboard storage. For this application power use does not matter, as using a USB car charger at the same time would make sense. It also does not matter if the 'phone' functionality of the device is impaired whilst the app is running.
My idea is to make something for personal use similar to a GoPro with inbuilt GPS logging. GPS would give you location, and distance over time gives you speed, and delta speed over time knowing weight and drag co-efficient gives you horsepower. I already know the Cd and CdA and running weight for my race car.
Anyway how do I get the phone to poll the GPS more often? Do I need to root kit the phone and then install some obscure hack? Or is it not possible?
I need accurate data in the 4-10Hz range or I may as well just forget about making this. I'm pretty sure I can buy a bluetooth GPS 'mouse' that does this but it would be much more practical to use the phones internal hardware.
i need to develop an app that needs data from the accelerometer. could some one please suggest which android phone in the market would be good enough for accurate accelerometer data generator. since the entire app is based on data fetched by the accelerometer, the device has to be pretty accurate.
The accelerometers in any smart phone are cheap and the difference in the accuracy of the readings is negligible. Even though these devices are cheap, they're very accurate and can output a few thousand readings per second - so the accuracy of your program is going to be dependent on what you DO with the readings in your code not by the device itself.
If you just want an Android phone for development - not to use with a wireless plan, then go to ebay and swoop a used one up for $30-40. Most of these phones have accelerometers in them, but before you buy it - google the model and make sure.
I own a G1 - the original Android phone, and the accelerometer is very accurate.