Has anyone any idea about the real-time aspect of Samsung Sensor Simulator(http://developer.samsung.com/android/tools-sdks/Samsung-Sensor-Simulator)?
Their site does say indicate it's record-and-replay but not sure if I
get that right from their documentation. So, I have the below questions which
I have asked their forum as well. But, I am curios to know if anyone here
have tried it and have had some experiences to share.
Are the real hardware sensor readings of a linked device available
on the Android emulator available in real-time? I saw it saying
"Sensor Relay" which sounds like only record-and-replay of real
hardware sensor readings on the emulator linked to a real device.
If it's real-time, then how fast are the sensor readings reaching
from the linked device to the emulator?
Can any sensor-based application running on the emulator use these
sensor readings in real-time?
In order to use these sensor readings, do the sensor-based
applications need to be modified to include some extra specific code
to interact with some module of this simulator inside the emulator
from which the sensor readings are got and hence can be used within
that interacting sensor-based application in the emulator?
Why is Samsung Sensor Simulator not compatible with Linux variants
like Ubuntu?
Is it only compatible with Android 2.2 as it's mentioned in the
documentation and not higher?
Android SDK must be of API 9 - is this a must or will it also work
the latest API 19 but with some minor issues which can be ignored?
Can more than one sensor be active and be visualized in the eclipse
IDE plugin interface? If yes, assuming any sensor-based application
running on the emulator can use these sensor readings, can more than
one sensor-based application use the different sensors readings at
the same time in real-time?
Thanks,
Raghavan
Related
First of all, I spent more than 10 hours of searching for a solution on Google...
I'm working on an app for athletes, doing sports like running or cycling. It should be based on Bluetooth LowEnergy. I have a real heartbeat sensor device to work with and there is the problem.
The Problem is that the sensor doesn't always work if I want to test the scan or something. My phone isn't able to find the sensor all the time, it works just one out of 30 attempts. So what I want to ask is, is there a way to simulate a BLE sensor device like a heartbeat-sensor (over the PC for example)?
I have devices running 4.3 and higher (Samsung, LG and a Sony smartphone), so that shouldn't be the problem. Furthermore I already had a success in connecting to a BLE-Heartbeat sensor, but for testing it's really hard to work with a real sensor device (because of the problem that I can't find it all the time).
Hope my problem is understandable and somebody can help me!
As #bobh says, an old iOS device running a custom app would work as a test BLE peripheral. And I bought an iPod Touch for just that purpose.
Unfortunately Android has only introduced native BLE support as of 4.3 and won't yet work in "peripheral" mode.
There are cheaper alternatives too. There are many BLE dev kits out there:
https://developer.bluetooth.org/DevelopmentResources/DevelopmentPlatforms/Pages/Development-Platforms.aspx
If you don't want to mess around with wires and breadboards then you could try BlueGiga's programmable BLE USB dongle. It's about 26 bucks and they have example code for the Heart Rate Profile so your life would be very easy:
http://www.bluegiga.com/en-US/products/bluetooth-4.0-modules/bled112-bluetooth-smart-dongle/
If you have an old iPhone 4S or iPad 3 and are an iPhone dev (or jailbroken device), you can prog it to be a test device https://github.com/AttackPattern/BlueSim
And tweek the sensor characteristics.
Works on a Mac with old Xcode 5 and BLE dongle but requires some work.
github
I am using the Sensor.TYPE_GRAVITY in my pedometer implementation. However, I am not sure if this sensor is indeed always implemented on devices. The sensortype is available since android 2.3, so my question is: can I assume all devices implement this sensor on android 2.3+?
I am asking, because it's a software sensor, not a hardware sensor.
Well, it looks like the implementation in 2.3 is completely software based and based only on the accelerometer data. GravitySensor.cpp in android 2.3
So it can be safe to assume in android 2.3+ it's always available.
In android 4+ the sensor is a sensor fusion device (GravitySensor.cpp in android 4.0.3), and thus also uses other sensors to increase reliability. Again, I assume it will be available and uses whatever data is can get, it would be strange to assume it suddenly drops support if for example the accelerometer is not there.
The implementation in android 2.3 uses a 2nd order Butterworth filter to extract the gravity component and is fairly simple. Experiments with this sensor on android 2.3 shows indeed that it's not completely accurate, it misses 0.1G-0.2G or the real 1G expected signal, but it's usable enough to integrate into a pedometer.
I'm working on an Android project that uses the accelerometer feature of tablets. I'm now slightly at the beginning of this project, so there is no objection to find the solution of my complaint. The question is, I have no android device right now and I want to test the sensitivity or directions of my accelerometer. As you know, there is no such a feature in android emulators. How can I test these sensors and events?
You can try this to emulate sensor data in the emulator:
http://code.google.com/p/openintents/wiki/SensorSimulator
The SensorSimulator allows to Simulate the accelerometer in you emulator with the mouse actions.
Just download the and install it from This link.
I am trying to work on stuff related to a gyroscope. My phone does not have a built in
gyroscope. Is there a way to include the gyroscope functionality in the emulator, at least make the emulator set in such a way that it behaves as if it had a real gyroscope?
p.s. I do not need to read any values from the gyroscope, I just want the emulator to think that it has one.
I have searched thoroughly and all I've found was this: http://code.google.com/p/openintents/wiki/SensorSimulator
But this does not make the emulator feel that it has a in built gyroscope, instead it runs an app in the emulator and fetches readings from sensors that are simulated in "SensorSimulator".
Any info would be helpful
The Android Emulator, launched with Android Studio 3.0 can simulate a range of rotation sensors that just might address your use case. We specially added a Gyroscope in the Android Emulator v26.1.0.
Gyroscope is newly supported in the Emulator of Android Studio 3.0, released to the Canary Channel on 5/17/17. Note that (as of today) Android Studio 2.3.3 is the latest official (i.e. "stable") version. Here is how you setup the Preview Version of Android Studio, which can exist concurrently with the official version.
Note that running the emulator out of the box won't work, as it's not a recent enough version:
You need to follow the 'change your update channel' steps in the latter link: select File > Other Settings > Default Settings and update from the Canary Channel:
Note that while running a Virtual Device with Android 7+ (aka API 26) did show Gyroscope output in the emulator's Virtual Sensors (within Extended Controls), it does not (at least yet) send that output to the virtual device; to actually see the environment in the sample app move as I moved the phone, I had to use Android 7.1.1 (API 25).
(Thanks to #jamal-eason for the protip!)
PREVIOUS (6/12/17):
As of the date of writing the release version of the Android Emulator (in Android Studio 2.3.3) does not offer Gyroscope support.
While the documentation referenced by #Nesski suggests this, I offer the following as proof:
The Android SDK's Virtual Reality getting started demo is the game called Treasure Hunt. Here is what it looks like when played on a phone. Notice that the camera moves as the player looks around.
Of the handful of devices compatible with the Google Daydream - because they contain an internal Gyroscope - Android Studio's AVD Manager offers only two of them: the Pixel and Pixel XL. I downloaded two virtual devices for each of those phones so that I could run the latest two Android versions (7.1.1 and 8.0) on each device:
I ran each device in the Emulator, and got similar results: press CTRL + SHIFT + C (on Windows) to bring up the Extended Controls, and you'll be able to test the phone's Virtual Sensors:
Using its Rotate controls, you'll notice that while there is Accelerometer output, Magnetometer output, and Rotation output, there is no Gryroscope output. You can rotate the phone as if you were looking around, but the game's camera view does not change as the phone is moved.
While this sad reality is unfortunate, I do, however, hope and expect Android to add Gyroscope support to the emulator in the future as more developers jump on the Google Daydream Virtual Reality bandwagon.
I don't think there is any Gyroscope support in the Emulator.
source.android.com's Sensors docs states
The gyroscope cannot be emulated based on magnetometers and
accelerometers, as this would cause it to have reduced local
consistency and responsiveness. It must be based on a usual gyroscope
chip.
I am working on something similar so I'm kind of reading up on what data to collect and what not to.
I am migrating from Symbian to Android. For symbian based nokia mobile phones, the support for accelerometer sensing using java is by the Mobile Sensor API (JSR 256) which is provided in the technical specifications of every nokia mobile phone that supports it.
However, for Android based "HTC Desire" mobile phone, I am not sure whether the HTC mobile has to provide for sensor APIs or whether the mobile's support of Android 2.2 is enough to get java code to access the mobile's accelerometer data. Please advise.
To be more specific, I was thinking of writing a java application that uses the accelerometer to act like a wireless mouse for a PC. And then add some extra functionality to it to serve as a general purpose pc controller that takes the z axis into consideration apart from the standard x-y axes the mouse uses. For this, should HTC provide for any APIs to access accelerometer data? If so, what APIs? or is HTC's Android 2.2 enough to achieve this feat? Please advise. Thank you in advance.
Android provides an API to access the accelerometers of all Android devices (see here: http://developer.android.com/reference/android/hardware/SensorManager.html), and there are lots of examples on how to use it. This has nothing to do with HTC.