sensor

android SensorEventListener problem

不打扰是莪最后的温柔 提交于 2019-12-19 04:47:32
问题 I am trying to create an application which reads data from digital compass. I tried to reuse the code from the book Professional Android Application Development but the IDE displayed a note The type SensorListener is deprecated I guess it is because the code from the book is written for the earlier SDK version so I tried to use SensorEventListener instead. Then when I tried to register the listener sensorManager.registerListener(sensorListener, SensorManager.SENSOR_ORIENTATION, SensorManager

How to get sensor data over TCP/IP in nodejs?

二次信任 提交于 2019-12-18 13:48:13
问题 I have a nodejs app with socket.io. To test this, save the below listing as app.js. Install node, then npm install socket.io and finally run on command prompt: node app.js var http = require('http'), fs = require('fs'), // NEVER use a Sync function except at start-up! index = fs.readFileSync(__dirname + '/index.html'); // Send index.html to all requests var app = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end(index); }); // Socket.io server

CMDeviceMotion yaw values unstable when iPhone is vertical

*爱你&永不变心* 提交于 2019-12-18 13:01:47
问题 In a iOS prototype I use a combination of CMDeviceMotion.deviceMotion.yaw and CLHeading.trueHeading to make stable compass heading that is responsive and accurate. This works well when the iPhone is held flat, where I have a graphical arrow that point to a stable compass heading. The problem appear when the iPhone is held vertical in portait mode. The UIDeviceOrientation constantly changes from UIDeviceOrientationFaceDown to UIDeviceOrientationFaceUp and back. This makes the yaw value to skip

How do I use the Google Maps API GPS sensor?

我是研究僧i 提交于 2019-12-18 12:48:11
问题 All I've been able to find is how to specify the sensor parameter: http://code.google.com/apis/maps/documentation/v3/#SpecifyingSensor But nowhere does it say how to actually USE it. Isn't the whole point to be able to get the user's current lat/long coordinates through the device GPS, or am I mistaken? 回答1: That sensor parameter is only there to indicate to Google that you are using a GPS sensor to determine the user's location. Unless using the W3C Geolocation API in browsers that support

Using getRotationMatrix and getOrientation in Android 2.1

老子叫甜甜 提交于 2019-12-18 12:32:46
问题 I've been having issues with this for far too long. This code should output dx,dy,dz for the accelerometer, and a running total of the dx. It should also output azimuth, pitch, and roll. I've used the information given here, but to no avail. This code does not correctly output pitch, azimuth, or roll. It outputs 0.0, -0.0, -0.0 for the last three textviews, respectively. switch (event.sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: accelerometerValues = event.values.clone(); case Sensor

access (faster polling) accelerometer via NativeActivity NDK

老子叫甜甜 提交于 2019-12-18 11:28:12
问题 I've searched for a tutorial/an answer on polling accelerometer faster with NDK but didnt find solver yet. just found an androiddevelopers documentation here. what i need is polling acceleration about 100 samples per second (100Hz), by default my device (Samsung Galaxy SL i9003 with gingerbread 2.3.5) with default SENSOR_DELAY_FASTEST can only get about 60 samples persecond (60Hz). Therefore i tried to access sensor via NativeActivity with NDK by generating .c files that i try to make based

Get Device Moving Direction without GPS

匆匆过客 提交于 2019-12-18 05:23:33
问题 With Which Sensor I Can Detect when device is moving to a direction In Absolute Coordinate(for example moving to +x or -x). I need accurate data,so i cannot use GPS . the Complete Task is to plot in paint(in computer) with android device sensors and this part of task in unknown for me. 回答1: I'm a little confused about what you're asking. Do you want to put a device in your pocket and walk around, and make a plot of everywhere you walked? Or do you want to wave the device around in your hand

Custom Plugin for PhoneGap Windows8 that will call c# code

﹥>﹥吖頭↗ 提交于 2019-12-18 05:23:09
问题 I want to develop an application that will display sensor data in both windows8 and android. I'm using phoneGap for some sensors, but, for example, barometer, there is no implementation in phoneGAP. I want to develop a plugin for cordova-windows8. but there is no example in the web for how to do it. I want to call c# function that uses Microsoft.codePack API for sensors in order to display the barometer data. the ApiCodePack uses windows 7 API for sensors. http://archive.msdn.microsoft.com

How to access CPU's heat sensors?

做~自己de王妃 提交于 2019-12-17 22:39:32
问题 I am working on software in which I need to access the temperature sensors in the CPU and get control over them. I don't know much hardware interfacing; I just know how to interface with the mouse. I have googled a lot about it but failed to find any relevant information or piece of code. I really need to add this in my software. Please guide me how to have the control over the sensors using C or C++ or ASM. 回答1: Without a specific kernel driver, it's difficult to query the temperature, other

calculate acceleration in reference to true north

可紊 提交于 2019-12-17 18:50:30
问题 For my App I need to calculate the acceleration of my device in reference to true north. My idea was to calculate the device orientation to magnetic north and apply the declination to it to get the orientation to true north. Then I want to calculate the acceleration of the device and reference it to the orientation, but I do not know how I should do this. I would try to get the device orientation using SensorManager.getRotationMatrix() and SensorManager.getOrientation() . Then I get the