- 与Server端通信的建立过程
4,应用开发总结
1,类架构框图
如上图所示,Sensor Framework相对于Audio等模块来说,比较简单,摘录几个关键类的设计意图如下:
/**
-
- SensorManager lets you access the device’s {@link android.hardware.Sensor
- sensors}. Get an instance of this class by calling
- {@link android.content.Context#getSystemService(java.lang.String)
- Context.getSystemService()} with the argument
- {@link android.content.Context#SENSOR_SERVICE}.
-
- Always make sure to disable sensors you don’t need, especially when your
- activity is paused. Failing to do so can drain the battery in just a few
- hours. Note that the system will not disable sensors automatically when
- the screen turns off.