From: Alexis Laferrière Date: Tue, 17 May 2016 00:32:22 +0000 (-0400) Subject: lib/android: update import and doc of `sensors` X-Git-Url: http://nitlanguage.org lib/android: update import and doc of `sensors` Signed-off-by: Alexis Laferrière --- diff --git a/lib/android/sensors.nit b/lib/android/sensors.nit index b969389..0681e4a 100644 --- a/lib/android/sensors.nit +++ b/lib/android/sensors.nit @@ -14,28 +14,30 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This module is used to manipulate android sensors -# The sensor support is implemented in android_app module, so the user can enable the type of sensor he wants to use. -# There is an example of how you can use the android sensors in nit/examples/mnit_ballz : +# Access Android sensors +# +# Sensors are to be enabled when `App` is created. +# The following example enables all sensors. +# The events (`SensorEvent`, `ASensorAccelerometer`, `ASensorMagneticField`...) +# are sent to the `input` callback of `App` # # ~~~~nitish -# #FIXME rewrite the example # redef class App -# sensors_support_enabled = true -# accelerometer.enabled = true -# accelerometer.eventrate = 10000 -# magnetic_field.enabled = true -# gyroscope.enabled = true -# light.enabled = true -# proximity.enabled = true +# init +# do +# sensors_support_enabled = true +# accelerometer.enabled = true +# accelerometer.eventrate = 10000 +# magnetic_field.enabled = true +# gyroscope.enabled = true +# light.enabled = true +# proximity.enabled = true +# end # end # ~~~~ -# -# In this example, we enable the sensor support, then enable all types of sensors supported by the API, directly with `App` attributes -# As a result, you get all type of SensorEvent (ASensorAccelerometer, ASensorMagneticField ...) in the `input` callback of `App` module sensors -import android +import game import mnit in "C header" `{