Open farzamani opened 4 years ago
Regards, Farhad
It's strange. Try to rebuild your project.
I think I found the problem. In my project, the isConnected()
method is not contained in NeuroSky.java
file but in Preconditions.java
(both files are downloaded via Gradle).
Perhaps I put wrong code in dependencies?
Or maybe I can skip that isConnected()
part since it already exist in startMonitoring()
and stopMonitoring()
method?
public void startMonitoring() { if (Preconditions.isConnected(device)) { device.start(); }}
public void stopMonitoring() { if (Preconditions.isConnected(device)) { device.stop(); }}
Method isConnected()
is available as a public method in NeuroSky
object and it's invoked from the Preconditions
object. Invoking it from NeuroSky
and Preconditions
should have the same effect. It's strange that it's not working on your computer. It seems like a local bug or issue with your environment. Alternatively you can use Preconditions
class if it works for you.
There is no isConnected()
method in NeuroSky.java
. There is also no Preconditions
object in that java file.
Is it really like this? Because the library I've downloaded via Gradle is different from here
ps: actually there are no start()
and stop()
method too in the library maybe I need to re-check my env and project
Thank you for your response!
I already copied the code below to Gradle
dependencies { implementation 'com.github.pwittchen:neurosky-android-sdk:0.0.2' }
and imported
com.github.pwittchen.neurosky.library.NeuroSky;
in my projectthen I tried to use
neuroSky.isConnected()
method but I got "Cannot resolve method 'isConnected()' in 'NeuroSky'" messageHow could I fix it? Thanks