Search code examples
javaandroidandroid-studiogoogle-play-servicesgoogle-fit

Can't find Google fit class


I'm trying to copy the official Google Fit sample from here Setup and Sensors. I'm having problems with the DataSourceListener. When I try to add that class in AndroidStudio it doesn't seem to find it, the class doesn't seem to exist...


Solution

  • The API has changed slightly since that video was released. See the SensorApi documentation for more details. The DataSourceListener has been replaced by the OnDataPointListener which is used in a call to SensorApi.add(GoogleApiClient, SensorRequest, OnDataPointListener).