Android Tutorial "cannot resolve symbol 'accModule'"

Hi,

I started with m CPro and the Android Tutorial but it doen't work as it should.
I downloaded the App Template and added the Code in public void ready() like in the tutorial but the error "cannot resolve symbol 'accModule'" occured.
Where is my mistake that it doesn't work? The necessary librarys in the build.gradle file are already added in the App Template, right?

The Function:

public void ready() {
try {
accModule = mwBoard.getModule(Accelerometer.class);
// Set the output data rate to 25Hz or closet valid value
accModule.setOutputDataRate(25.f);
} catch (UnsupportedModuleException e) {
Snackbar.make(getActivity().findViewById(R.id.device_setup_fragment), e.getMessage(),
Snackbar.LENGTH_SHORT).show();
}
}

Comments

  • 'Cannot resolve symbol' in this context means the variable was not declared, which looking at the tutorial, was not mentioned.  Sorry about that.
  • edited September 2016
    Came across this post while going through the tutorial and thought it would be helpful for others to know.
    I had to add the following import and member variable:
    import com.mbientlab.metawear.module.Accelerometer;
    private Accelerometer accModule;

This discussion has been closed.