sensor

Sending text message SMS without user intervention

此生再无相见时 提交于 2019-11-27 08:53:12
问题 Is it possible to send sms via iphone without user intervention? I already know about MessageUI framework and MFMessageComposeViewController class, but this option requires user to click Send button when MGMessageComposeViewController is presented. I would like the device to automatically, without my help send a text message when certain conditions are met. (I have some sensors connected to the device) 回答1: If you want to be able to send sms without user's interaction, consider using some

JSR 256 battery events

删除回忆录丶 提交于 2019-11-27 07:28:35
问题 How can I detect whenever the power cord is unplugged from electrical socket using JSR 256? 回答1: You would add javax.microedition.io.Connector.sensor to the API Permissions tab of the Application Descriptor of the project properties. 回答2: From a quick look at the specifications of the JSR: (you might want to look for code examples, starting with Appendix D of the spec itself, the latest JavaME SDK, Sony Ericsson developer website, then google) As always, I would be worried about fragmentation

iPhone Proximity Sensor

怎甘沉沦 提交于 2019-11-27 06:41:58
Can the iPhone SDK take advantage of the iPhone's proximity sensors? If so, why hasn't anyone taken advantage of them? I could picture a few decent uses. For example, in a racing game, you could put your finger on the proximity sensor to go instead of taking up screen real-estate with your thumb. Of course though, if this was your only option, then iPod touch users wouldn't be able to use the application. Does the proximity sensor tell how close you are, or just that something is in front of it? Assuming you mean the sensor that shuts off the screen when you hold it to your ear, I'm pretty

android compass seems unreliable

狂风中的少年 提交于 2019-11-27 05:30:20
问题 I have been working on a small compass app the past couple of days, and have gotten the code up and running, but it seems that the compass reading is not accurate. After calibrating both phones, my first test that i found this in what that i simply held the phone against and flat surface looked at the reading then flipped it horizontally and put it against the same flat surface (a 180* turn) and the value did not change 180* it was closer to 240*. I then tested the reading vs a compass, at

How to use Kalman filter in Python for location data?

若如初见. 提交于 2019-11-27 04:11:20
问题 [EDIT] The answer by @Claudio gives me a really good tip on how to filter out outliers. I do want to start using a Kalman filter on my data though. So I changed the example data below so that it has subtle variation noise which are not so extreme (which I see a lot as well). If anybody else could give me some direction on how to use PyKalman on my data that would be great. [/EDIT] For a robotics project I'm trying to track a kite in the air with a camera. I'm programming in Python and I

Get temperature of battery on android

青春壹個敷衍的年華 提交于 2019-11-27 03:51:51
How do I get the temperature of the battery in android? Ingo Try this: private class mBatInfoReceiver extends BroadcastReceiver{ int temp = 0; float get_temp(){ return (float)(temp / 10); } @Override public void onReceive(Context arg0, Intent intent) { temp = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE,0); } }; then define in your Variable declarations: private mBatInfoReceiver myBatInfoReceiver; and in onCreate: @Override public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.activity_main); // ... // Add this myBatInfoReceiver = new mBatInfoReceiver(); this

How should I calculate azimuth, pitch, orientation when my Android device isn't flat?

老子叫甜甜 提交于 2019-11-27 03:40:51
I'm using the Android gravity and magnetic field sensors to calculate orientation via SensorManager.getRotationMatrix and SensorManager.getOrientation. This gives me the azimuth, pitch and orientation numbers. The results look sensible when the device is lying flat on a table. However, I've disabled switches between portrait and landscape in the manifest, so that getWindowManager().getDefaultDisplay().getRotation() is always zero. When I rotate the device by 90 degrees so that it's standing vertical I run into trouble. Sometimes the numbers seem quite wrong, and I've realised that this relates

Calculate Android sensor power consumption

假如想象 提交于 2019-11-27 03:28:49
问题 getPower() returns the power in mA used by a sensor while in use: Now, I need to calculate how much battery is used by the registration of the sensor. Does he value returned by getPower() indicate the mAH (mA per HOUR) or something else? If yes, is there a way to get the battery mAH in order to calculate the % of battery used by the sensor? 回答1: Something quite related has been discussed in Google groups not too long ago. You can find the full thread here for reference. A small excerpt from

Android accelerometer not working when screen is turned off

ぃ、小莉子 提交于 2019-11-27 02:53:42
I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen on). Also, this isn't a market targeted application, so it is pretty acceptable to do some serious hacking, even low level C/C++ coding, if required. It is well known that on many devices the listeners for accelerometer events stop generating events when screen goes off (some links regarding this problem: http://code.google.com/p/android/issues/detail

Smoothing data from a sensor

旧时模样 提交于 2019-11-27 02:38:33
I have a 3D sensor which measures v(x,y,z) data. I'm only using the x and y data. Smoothing only x and y would be enough. If I use a log to show the data, it shows me something like this: (time) 0.1 ... (Data log) x = 1.1234566667 (time) 0.2 ... (Data log) x = 1.1245655666 (time) 0.3 ... (data log) x = 1.2344445555 Well the data is more exact actually, but I want to smooth between the 1.1234 value and the 1.2344 value, because for me it's the same, I can use integers to, showing only "x= 1" but I need the decimals too, then, I need to show a sort of "smoothed" value here. Anyone has any idea?