Is it possible to get a notification as to when a sensor connects? When I use my Forerunner to just go for a regular run (or bike ride) the watch notifies me when the HRM (or speed sensors) are connected and ready. Is it possible to hook into those notifications?
Generally you can tell if a sensor is available by examining the result of a call to Activity.getActivityInfo() or Sensor.getInfo(). You just need to check the appropriate fields for the sensor you are interested in (Sensor.Info.heartRate or Activity.Info.currentHeartRate for the heart rate sensor). If the value is null, then no sensor is found.
I have heard that Activity.getActivityInfo() will get results quicker than Sensor.getInfo(), but I have no idea why. Other than that, I know of no advantage of one over the other.