Question

I followed this direction here and added the two USB wrapper the author created (AdkPort and Ringbuffer)

enter image description here

Moving cursor on it says "class" or "interface" expected.

Any idea how to resolve this?

Was it helpful?

Solution

You are declaring mbed outside a class.

The link you point to shows the following code snippet:

private AdkPort mbed;
...
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
            ...
            mbed = new AdkPort(this);
            Thread thread = new Thread(mbed);
            thread.start();
            mbed.attachOnNew(new AdkPort.MessageNotifier(){ 
        @Override
        public void onNew()
        {
            byte[] in = mbed.readB();
                            // Do something with the data
                    }
            });
            ...
   }

What may not be evident to you is that, in the above snippet, "private AdkPort mbed;" is inside an Activity, which is a class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top