Is it possible to transmit fake values to the accelerometer sensor like it is possible with GPS coordinates?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you mean the GPS location, then yes, you can fake that (look at the very bottom of the page): Android DDMS
Using the DDMS, you can simply tell your device its current GPS coordinates.
EDIT: I guess, this post answers your question Stackoverflow. It points out that SensorSimulator is capable of doing that. If you scroll down a little bit on the page, it explains you how to connect the tool with a real device. I myself have never used it, so just try it :)
Hope it helps!
You can do that if you find the input event file, and write the values directly to the file.
ls -l /dev/input/
and you will see the list of the events you may access. Not sure if you need to be root for that (which can be the case).I tried to follow the logic and reached this area of the code: https://github.com/mozilla-b2g/android-device-crespo/tree/master/libsensors which refers to gyros and whatnot in the various device builds
The code actually makes reference to chip-specific /dev files and paths like /sys/devices/platform/soc-audio.0/sound/card0/pcmC0D9p/dev which I could probably work out how to interpret, but fear I've already squandered too much time on.
It looks like if you're going to try this, you'd need to pretend to be a variety of accelerometer chips, but I suspect squirting data into them is unlikely to work the same way it does with the easier devices.