I'm trying to implement the Google Fit API into my android wearable application.
I have followed the GoogleFitAPI online steps with registering for an OAuth ID.
When trying to connect, I get an invalid account error.
Do I need to enable the free trial within the developer api console, or is there another issue that is causing this?
mClient = new GoogleApiClient.Builder(this)
.addApi(Fitness.API)
.addScope(Fitness.SCOPE_ACTIVITY_READ)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
Actually the Fit API is available on Android Wear devices. But you still have to do the initial setup (Step 5) one time on a paired handheld device. Once you've logged in and displayed the consent screen on the phone, you can access the API from the watch. A recommendation would be to send the selected user account to the watch using the MessageAPI to avoid trying to connect to the API before the required information has been synced to the watch.
Please note that if you chose to access the API from the watch you will ONLY get data collected by the watch (data is synced from the watch to the phone and to the cloud, but not back to the watch).
An alternative solution is to fetch the fitness data from the phone and send it to the watch (again using the MessageAPI).
EDIT:
As of Google Play Services 7.3.0 you can also use Fitness.HistoryApi.readDailyTotal() if you just want to get the daily total value. This doesn't require any authentication, but will also only give you data from the local device.
Google Fit APIs are not yet enabled on Android Wear devices. You can connect to Google Fit on the handheld device and use the Wearable Data Layer to send data across, but obviously that uses the sensors and requires the use of a handheld device.