0

i'm having a hard time figuring out how to get the android device orientation. the sensor itself is a piece of work. The tilting and heading shows NAN. the gyro dose not work either. i've upgraded to Delphi 10.3.3 but Orientation sensor still not working ! . some gut tried to use the AndroidApi senors but still the Magnetometer dosent work ! Fusion Sample

is there any solution of fix for this problem ?! or maybe an implemnation of Androidapi gyro sensor.

  • Have your tried other apps that use the same sensors? Do they seem to report accurate values, or at least react to changes in the values? To rule out the possibility that maybe your device just has faulty sensors – Remy Lebeau Nov 23 '19 at 19:56
  • Yes i did, the `SensorInfo` in `\Object Pascal\Multi-Device Samples\Device Sensors and Services` + `\Object Pascal\Mobile Snippets\OrientationSensor` + `\Object Pascal\Mobile Snippets\Gyroscope` all dosent work . i tried bunch of comapss app from google play and all works @RemyLebeau – Androidcode Nov 23 '19 at 20:51
  • i tired some senor test apps and gyro and orientation sensors dosent work ! , but how it works in the Compass ?! @RemyLebeau – Androidcode Nov 23 '19 at 21:16
  • See my answer at https://stackoverflow.com/questions/46122825/delphi-androidapi-motion-detection – Freddie Bell Nov 27 '19 at 08:37
  • The solution you mention is mine. It works, at least for the phones I tested (S9, A7, iphone). For Android is uses sensor code from DelphiWorlds. Note that Android magnetic sensor sometimes stops for no apparent reason. Check other apps that use it ( compass apps). It may be in need a figure 8 calibration, or is detecting magnetic interference. Sometimes booting the device helps. – Omar Reis May 30 '20 at 14:37
  • check this sample app: https://github.com/omarreis/BoatAttitude – Omar Reis Jun 03 '20 at 13:16

0 Answers0