sensor

Using orientation information to get down direction

不问归期 提交于 2019-12-24 17:13:10
问题 I am working on an app that involves drawing a line on my android screen based on its orientation and could use some help or pointers. The line is drawn in the following way: If the phone is held flat then then the line shrinks and becomes a dot and as the phone is tilted and orientatated the line becomes bigger - ie the phone stood up and the line points down and is max magnitude of 9.8 and held flat it is a small dot. Crucialy no matter what angle the phone is held at the arrow allways

Getting device orientation (yaw, roll and pitch) in Flutter

南笙酒味 提交于 2019-12-24 10:35:45
问题 In Android I can get the device yaw, roll and pitch using a GAME_ROTATION_VECTOR sensor. I need to do the same thing in Flutter, but I haven't been able to find anything but the sensors package, which only gives access to accelerometer & gyroscope sensors. What can I do? Do I need to calculate the orientation myself from the accelerometer and gyro? 回答1: Don't know if this is still relevant, as the question wasn't closed, but for those seeking the answer... there is now a Flutter Sensors

How to determine the size of a physical object image on a phone's screen?

末鹿安然 提交于 2019-12-24 10:11:07
问题 Can you derive the size of a physical object image displayed on a phone's screen from its size on the CCD sensor? When you know the dimensions of a physical object, its distance from the camera and the camera's focal lenght, you can determine the size of the image produced on the camera's CCD sensor. As I described here, I calculate how much larger the phone's screen is in pixels than the CCD sensor in millimeters. So if an object's dimension on the CCD is x , the screen is n -times larger

Python script stops, no errors giving

南楼画角 提交于 2019-12-24 07:31:39
问题 I have an python script that needs to be running all the time. Sometimes it can run for a hole day, sometimes it only runs for like an hour. import RPi.GPIO as GPIO import fdb import re con = fdb.connect(dsn='10.100.2.213/3050:/home/trainee2/Desktop/sms', user='sysdba', password='trainee') #connect to database cur = con.cursor() #initialize cursor pinnen = [21,20,25,24,23,18,26,19,13,6,27,17] #these are the GPIO pins we use, they are the same on all PI's! We need them in this sequence. status

Create service to detect any action from the user

十年热恋 提交于 2019-12-24 03:27:06
问题 I'm trying to create a service where I want to detect something about user, let's say when user lays the device on a table, the thing is that I have that action detected but I have it on a MainActivty and I want it to put on Service . The thing is that on my MainActivity() I had my registerAction() and on my onResume() were called and in onPause() I call the unregisterListener() from my sensor , as well I have a HandlerThread where I start it on my onCreate() how do I change it to Service ?

Android: Alternative to onSensorChanged? no ACCELEROMETER data when phone is lying on its back on a table( when no movement)

点点圈 提交于 2019-12-24 01:01:51
问题 So I'm using this code to get the Accelerometer data. When I am in the DDMS mode to check what my print statement is printing, I noticed that nothing is printed when the phone does not move. ie. its on the table. I think the reason is that onSensorChanged is not called when the phone does not move, and then its called when the phone starts moving again. If i want to capture data regardless of whether the phone is moving or not, should I use some other function? Any Alternatives? or Any

Does windows phone currently have APIs for proximity and light sensors?

人走茶凉 提交于 2019-12-23 19:15:57
问题 Does windows phone currently have APIs for proximity and light sensors? I want to access these two sensors, but can not find the API. Is there some methods to use them ? 回答1: Unfortunately, no. Sensor APIs available are listed here: http://msdn.microsoft.com/en-us/library/microsoft.devices.sensors%28v=VS.92%29.aspx If you really need it, then you should find it & vote for it here: http://wpdev.uservoice.com/forums/110705-app-platform ; They are listening to the feedback, if the recent news

Android AllJoyn: Connection with second machine gives error of BusAttachement

隐身守侯 提交于 2019-12-23 07:06:05
问题 I have developed application for two different sensors. They are working fine separately but when I try to use them togather and create two diffent buses than Alljoyn gives this exception. org.alljoyn.services.common.BusAlreadyExistException: The object has been set previously with a BusAttachment. Below is my source code for connection. Can anyone tell me why I'm having this issue. private void connect() { org.alljoyn.bus.alljoyn.DaemonInit.PrepareDaemon(getApplicationContext()); bus = new

Count Steps using accelometer in android [duplicate]

北慕城南 提交于 2019-12-23 04:19:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to Count the Number of Steps Using the Accelerometer Are there any well known algorithms to count steps based on the accelerometer? Hi i have developed android application. In one module I have to create a pedometer. Now at this stage I have to count the steps user walked by using accelormeter. I have search on internet and found different methods but none of that working. I have tried this Does anyone have

Android: Synchronize Timestamps of Sensors and GPS

喜夏-厌秋 提交于 2019-12-23 01:16:37
问题 Is there a way to synchronize the timestamps in values meassured by Sensors (e.g. acceleration) ( SensorEvent.timestamp ) and GPS ( Location.getTime() ). SensorEvent.timestamp are the nanoseconds since the device has been booted (local time). Location.getTime() are the miliseconds since1970 (global time). One solution I had in mind was to calculate the offset between the local time and the global (GPS) time. But the problem is, that the time in Location is the time when the GPS-message