Problem: XE8 for Android direction sensor does not work (normal in XE7)
Test: official example Samples\object pascal\mobile snippets\orientationsensor\
Applicable: XE8 for Android
Repair method:
Please copy the source System.Android.Sensors.pas to your project directory, and then make the changes.
Modify the following code:
Constructor tandroidnativelightsensor.create (Amanager:tsensormanager); begin inherited ; Fnativesensor:= tnativesensor.create (asensor_type_light); {+++>} // Join this line End;
Constructor tandroidnativepressuresensor.create (Amanager:tsensormanager); begin inherited ; Fnativesensor:= tnativesensor.create (asensor_type_pressure); {+++>} // Join this line End;
Constructor tandroidnativemagneticsensor.create (Amanager:tsensormanager); begin inherited ; Fnativesensor:= tnativesensor.create (asensor_type_magnetic_field); {+++>} // Join this line End;
Constructor tandroidnativeproximitysensor.create (Amanager:tsensormanager); begin inherited ; Fnativesensor:= tnativesensor.create (asensor_type_proximity); {+++>} // Join this line End;
Fix XE8 for Android direction sensor headingx,y,z not moving